Maker Pro
Maker Pro

Need Some Help Figuring Out How to Use the PDSP2112

Yeah, I will change it to write_sr, no probs.

Totally missed the bit1 and w2 things, good eye! but I guess around me you have to have one. Lol! :p:D

And I will add the "gosub write_sr" command too, that's very good idea.
I didn't know that about the ASCII stuff, I will change that in the code also. :)

Here it is:
Code:
;*********************************************************;
;*             <- START OF PDSP PROGRAM ->               *;
;*********************************************************;
;*********************************************************;
;* This program displays 'Hello!' on the PDSP2112        *;
;*********************************************************;
;F E D C B A 9 8 7 6 5 4 3 2 1 0  (bits in w0)
;7 6 5 4 3 2 1 0 . . . . . . . .  (bits in b1)
;. . . . . . . . 7 6 5 4 3 2 1 0  (bits in b0)
;* . . . . . . . . . . . . . . .  U1.QA - available for future use
;. * . . . . . . . . . . . . . .  U1.QB: -CE to PDSP2110
;. . * . . . . . . . . . . . . .  U1.QC: -RST to PDSP2110
;. . . * . . . . . . . . . . . .  U1.QD: -FL to PDSP2110
;. . . . * * * * . . . . . . . .  Character position:
;. . . . * . . . . . . . . . . .  U1.QE: char position, bit 3 (A3 to PDSP2110)
;. . . . . * . . . . . . . . . .  U1.QF: char position, bit 2 (A2 to PDSP2110)
;. . . . . . * . . . . . . . . .  U1.QG: char position, bit 1 (A1 to PDSP2110)
;. . . . . . . * . . . . . . . .  U1.QH: char position, bit 0 (A0 to PDSP2110)
;. . . . . . . . * * * * * * * *  Character:
;. . . . . . . . * . . . . . . .  U2.QA: character, bit 7 (D7 to PDSP2110)
;. . . . . . . . . * . . . . . .  U2.QB: character, bit 6 (D6 to PDSP2110)
;. . . . . . . . . . * . . . . .  U2.QC: character, bit 5 (D5 to PDSP2110)
;. . . . . . . . . . . * . . . .  U2.QD: character, bit 4 (D4 to PDSP2110)
;. . . . . . . . . . . . * . . .  U2.QE: character, bit 3 (D3 to PDSP2110)
;. . . . . . . . . . . . . * . .  U2.QF: character, bit 2 (D2 to PDSP2110)
;. . . . . . . . . . . . . . * .  U2.QG: character, bit 1 (D1 to PDSP2110)
;. . . . . . . . . . . . . . . *  U2.QH: character, bit 0 (D0 to PDSP2110)

;***********************PIN_LAYOUT************************;
;*   PIN___FUNCTION || PIN___FUNCTION || PIN___FUNCTION  *;
;*   C.0   SDI      || C.1   LCHCLK 12|| C.2   SHFCLK 11 *;
;*   B.1   -WR      ||                ||                 *;
;*********************************************************;
;*********************************************************;
;* This section is for renaming variables and constants  *;
;*********************************************************;
symbol SDI=c.0
symbol SHFCLK=c.2
symbol nWR=b.1
symbol LCHCLK=c.1
symbol TM=2 ;this will make all delays 5.7uS

;*********************************************************;
;* This is the main code which was made so it would      *;
;* be easy to change what's on the display               *;
;*********************************************************;
main:
    let b1=%01110000 ;high nCE,nRST,nFL
    high nWR
    low SHFCLK,LCHCLK,SDI
    gosub write_sr ;a do nothing state
    let b1=%01010000 ;low nRST
    gosub write_sr ;start the clear process
    let b1=%01110000 ;high nRST
    gosub write_sr ;disable the reset pin
    let b1=%00110000 ;low nCE
    gosub write_sr ;get access to the display
    do ;start endless loop
        let b1=%00110001 ;high nFL, nRST. address #1
        let b0="H"
        gosub load_on_screen
        let b1=%00110010 ;high nFL, nRST. address #2
        let b0="e"
        gosub load_on_screen
        let b1=%00110011 ;high nFL, nRST. address #3
        let b0="l"
        gosub load_on_screen
        let b1=%00110100 ;high nFL, nRST. address #4
        let b0="l"
        gosub load_on_screen
        let b1=%00110101 ;high nFL, nRST. address #5
        let b0="o"
        gosub load_on_screen
        let b1=%00110110 ;high nFL, nRST. address #6
        let b0="!"
        gosub load_on_screen
    loop until b10=10 ;endless loop

    ;***************************************************;
    ;* this stores the data above in the shift         *;
    ;* register.                                       *;
    ;***************************************************;
    write_sr:
        let b2=0 ;start loop value
        do ;start loop
            if bit0=1 then
                high SDI
            else
                low SDI
            endif
            pauseus TM ;let it register
            high SHFCLK ;load value to shift register
            pauseus TM ;let it register
            low SHFCLK
            let w0=w0/2 ;shift value down one place
            inc b2 ;let b2=b2+1 so the loop will work right
        loop until b2=16
        pauseus TM ;let it register
        high LCHCLK ;load shift register to the output
        pauseus TM ;let it register
        low LCHCLK
        pauseus TM ;let it register
        return
;*********************************************************;
;* This loads the data in the shift register to the      *;
;* screen.                                               *;
;*********************************************************;
load_on_screen:
        gosub write_sr
        pauseus TM ;let it register
        low nWR ;put it on the PDSP2112
        pauseus TM ;let it register
        high nWR ;remove access from the display
        pauseus TM ;let it register
        return

;*********************************************************;
;*              <- END OF PDSP PROGRAM ->                *;
;*********************************************************;

;*******************************************************************;
;* Version 1.0 Supercap2F                                          *;
;*-----------------------------------------------------------------*;
;* Update list:                                                    *;
;* 1) - Code Complete - Supercap2F - 10/28/2014                    *;
;* 2) - Simplified the main code - Supercap2F - 10/29/2014         *;
;* 3) - Simplified the display code - Supercap2F - 10/29/2014      *;
;* 4) - Changed pin layout. And made code more robust              *;
;*      Supercap2F - 10/30/2014                                    *;
;* 5) - Changed varaibles back to how they where - Supercap2F      *;
;*      - 10/31/14                                                 *;
;*                                                                 *;
;*******************************************************************;
I will lay it out on a breadboard next, it's going to be so cool to have this working! :)
Dan
 
Last edited:
I realized a little while ago that I forgot to buy the 74HC595s - Sorry about that, I just ordered some from china today... So it might be a while before they get here. o_O

Thanks again for all you have done on this project Kris! :) Sorry that there's going to be a delay. :(
Dan
 
Hey Kris! Just thought I would let you know that I haven't forgot about this!

The 74HC595 still haven't came in from china yet... And the guy I ordered them from said that if they haven't got here in 31 days then they're most likely lost in the mail... So I decided to reorder them, and I was lucky enough to find someone in Kansas who was selling them for less than the chinese! :)

They should be in in a couple days..
Dan
 
Well the shift registers got here today... But lo and behold, they where the ones from china not Kansas! :eek: Oh well, having twenty shift registers on hand wont be that bad. :p:D

So I laid everything out on the breadboard. Here's a photo:
IMG_9980.jpg
I then added the LEDs:
IMG_0002.jpg
After programing the chip (and increasing the pause time so it would be visible to the human eye), it all seemed to be working right. Then I noticed an error in the code, right above the command that sets b0 to '!'. It says: "let b1=%00110011 ;high nFL, nRST. address #3" it should be "let b1=%00110110 ;high nFL, nRST. address #6". So after changing that, I re-downloaded the code on the chip, and then the whole thing stopped working. It didn't completely stop working, it just didn't do anything but light up some random LEDs. I tried downloading the program again, but all it did was light up some different random LEDs. Then to make sure the PICAXE was still running, I hooked the SDI and SHFCLK signals up to my oscilloscope, and they looked in order. I then hooked up some switches (with pull-up resistors) to the SDI, SHFCLK, and LCHCLK signals (with the 14M2 removed) and played around with it some. The shift registers didn't seem to be working as expected...

Here's some things I think the problem might be:
  • The shift registers died after the first use
  • I messed something up in the code
  • The PICAXE or download cable has been fried
  • My wiring on the breadboard is messed up
I will do some tests on the download cable/PICAXE 14M2/shift registers in the next couple of days. I will also review all the code and see if I can spot anything I messed up.

I'll let you know what I find out. :)
Dan
 
Hey Kris! Well I found out a lot, here's the code that's changed for trouble shooting:
Code:
;*********************************************************;
;*             <- START OF PDSP PROGRAM ->               *;
;*********************************************************;
;*********************************************************;
;* This program displays 'Hello!' on the PDSP2112        *;
;*********************************************************;
;F E D C B A 9 8 7 6 5 4 3 2 1 0  (bits in w0)
;7 6 5 4 3 2 1 0 . . . . . . . .  (bits in b1)
;. . . . . . . . 7 6 5 4 3 2 1 0  (bits in b0)
;* . . . . . . . . . . . . . . .  U1.QA - available for future use
;. * . . . . . . . . . . . . . .  U1.QB: -CE to PDSP2110
;. . * . . . . . . . . . . . . .  U1.QC: -RST to PDSP2110
;. . . * . . . . . . . . . . . .  U1.QD: -FL to PDSP2110
;. . . . * * * * . . . . . . . .  Character position:
;. . . . * . . . . . . . . . . .  U1.QE: char position, bit 3 (A3 to PDSP2110)
;. . . . . * . . . . . . . . . .  U1.QF: char position, bit 2 (A2 to PDSP2110)
;. . . . . . * . . . . . . . . .  U1.QG: char position, bit 1 (A1 to PDSP2110)
;. . . . . . . * . . . . . . . .  U1.QH: char position, bit 0 (A0 to PDSP2110)
;. . . . . . . . * * * * * * * *  Character:
;. . . . . . . . * . . . . . . .  U2.QA: character, bit 7 (D7 to PDSP2110)
;. . . . . . . . . * . . . . . .  U2.QB: character, bit 6 (D6 to PDSP2110)
;. . . . . . . . . . * . . . . .  U2.QC: character, bit 5 (D5 to PDSP2110)
;. . . . . . . . . . . * . . . .  U2.QD: character, bit 4 (D4 to PDSP2110)
;. . . . . . . . . . . . * . . .  U2.QE: character, bit 3 (D3 to PDSP2110)
;. . . . . . . . . . . . . * . .  U2.QF: character, bit 2 (D2 to PDSP2110)
;. . . . . . . . . . . . . . * .  U2.QG: character, bit 1 (D1 to PDSP2110)
;. . . . . . . . . . . . . . . *  U2.QH: character, bit 0 (D0 to PDSP2110)

;***********************PIN_LAYOUT************************;
;*   PIN___FUNCTION || PIN___FUNCTION || PIN___FUNCTION  *;
;*   C.0   SDI      || C.1   LCHCLK 12|| C.2   SHFCLK 11 *;
;*   B.1   -WR      ||                ||                 *;
;*********************************************************;
;*********************************************************;
;* This section is for renaming variables and constants  *;
;*********************************************************;
symbol SDI=c.0
symbol SHFCLK=c.2
symbol nWR=b.1
symbol LCHCLK=c.1
symbol TM=200 ;this was 'symbol TM=2' Change back when done testing
         ;this will make all delays 5.7uS
;*********************************************************;
;* This is the main code which was made so it would      *;
;* be easy to change what's on the display               *;
;*********************************************************;
main:
    setfreq m16 ;set system clock to 16MHz
    let b1=%01110000 ;high nCE,nRST,nFL
    low SHFCLK,LCHCLK,SDI
    high nWR
    gosub write_sr ;a do nothing state
    let b1=%01010000 ;low nRST
    gosub write_sr ;start the clear process
    let b1=%01110000 ;high nRST
    gosub write_sr ;disable the reset pin
    let b1=%00110000 ;low nCE
    gosub write_sr ;get access to the display
    do ;start endless loop
        let b1=%00110001 ;high nFL, nRST. address #1
      
      let b0="H"
        gosub load_on_screen
        let b1=%00110010 ;high nFL, nRST. address #2
      
      let b0="e"
        gosub load_on_screen
        let b1=%00110011 ;high nFL, nRST. address #3
      
      let b0="l"
        gosub load_on_screen
        let b1=%00110100 ;high nFL, nRST. address #4
      
      let b0="l"
        gosub load_on_screen
        let b1=%00110101 ;high nFL, nRST. address #5
      
      let b0="o"
        gosub load_on_screen
        let b1=%00110110 ;high nFL, nRST. address #6
      
      let b0="!"
        gosub load_on_screen
    loop until b10=10 ;endless loop

    ;***************************************************;
    ;* this stores the data above in the shift         *;
    ;* register.                                       *;
    ;***************************************************;
    write_sr:
        let b2=0 ;start loop value
        do ;start loop
            if bit0=1 then
                high SDI
            else
                low SDI
            endif
            pauseus TM ;let it register
            high SHFCLK ;load value to shift register
            pauseus TM ;let it register
            low SHFCLK
            let w0=w0/2 ;shift value down one place
            inc b2 ;let b2=b2+1 so the loop will work right
        loop until b2=16
        pause TM ;let it register
        high LCHCLK ;load shift register to the output
        pause TM ;let it register
        low LCHCLK
        pause TM ;let it register
        return
;*********************************************************;
;* This loads the data in the shift register to the      *;
;* screen.                                               *;
;*********************************************************;
load_on_screen:
        gosub write_sr
        pause TM ;let it register
        low nWR ;put it on the PDSP2112
        pause TM ;let it register
        high nWR ;remove access from the display
        pause TM ;let it register
        return

;*********************************************************;
;*              <- END OF PDSP PROGRAM ->                *;
;*********************************************************;

;*******************************************************************;
;* Version 1.0 Supercap2F                                          *;
;*-----------------------------------------------------------------*;
;* Update list:                                                    *;
;* 1) - Code Complete - Supercap2F - 10/28/2014                    *;
;* 2) - Simplified the main code - Supercap2F - 10/29/2014         *;
;* 3) - Simplified the display code - Supercap2F - 10/29/2014      *;
;* 4) - Changed pin layout. And made code more robust              *;
;*      Supercap2F - 10/30/2014                                    *;
;* 5) - Changed varaibles back to how they where - Supercap2F      *;
;*      - 10/31/14                                                 *;
;*                                                                 *;
;*******************************************************************;

Most of the pauses are changed so it can be sean by the eye. The first thing I found out was that all of the wires going over to the D0-D5 LEDs are shifted over one place. You can see it in the photo I attached in post #46. After fixing that, I tested the download cable and it worked fine.

I then hooked up a PICAXE to the shift registers and downloaded a program that should move a 1 through all their outputs.. It worked fine. I think the reason the shift register appeared to not be working at first, was because of switch bounce.

Okay, so all the hardware was working fine, next thing to do was check out the code. After a few minutes of sifting through it, I found a huge problem! Some how SHFCLK and LCHCLK got set on the same pin in the symbol statements at the top! It read:
Code:
symbol SHFCLK=c.2
symbol nWR=b.1
symbol LCHCLK=c.2
Instead of:
Code:
symbol SHFCLK=c.2
symbol nWR=b.1
symbol LCHCLK=c.1

So after changing it back, it appears to all be working right. Except when the MCU is started up all of the shift registers pins go wild, then they go back to working as anticipated.

Do you think that's anything to be worried about? I can send you a video so you can see it for yourself...

Thanks very much Kris!! :)
Dan
 

KrisBlueNZ

Sadly passed away in 2015
That's great Dan! Good work :)

If the disturbances only happen on startup, it's probably not a sign of a problem, but if you want to avoid them, you could probably do that by holding -RST (to the PDSP2112s) low initially, until the firmware has started up. If that signal is driven directly from the MCU, and the MCU powers up with all I/O pins set to input mode, just use a pulldown resistor (e.g. 10k) and have the firmware drive that pin high once it starts up. I expect holding -RST active on the PDSP2112s at startup should prevent them from displaying anything.
 
That sounds great Kris! :)

Just to make sure I'm following you, I should hook up the -RST pin directly to the PICAXE, and have a resistor going from the -RST pin to ground. Then when the MCU turns on, have it pull -RST high.

Is that right?
Dan
 
Okay here's the new schematic:
PDSP-s.jpg
And here's the code:
Code:
;*********************************************************;
;*             <- START OF PDSP PROGRAM ->               *;
;*********************************************************;
;*********************************************************;
;* This program displays 'Hello!' on the PDSP2112        *;
;*********************************************************;
;F E D C B A 9 8 7 6 5 4 3 2 1 0  (bits in w0)
;7 6 5 4 3 2 1 0 . . . . . . . .  (bits in b1)
;. . . . . . . . 7 6 5 4 3 2 1 0  (bits in b0)
;* . . . . . . . . . . . . . . .  U1.QA - available for future use
;. * . . . . . . . . . . . . . .  U1.QB - available for future use
;. . * . . . . . . . . . . . . .  U1.QC: -CE to PDSP2110
;. . . * . . . . . . . . . . . .  U1.QD: -FL to PDSP2110
;. . . . * * * * . . . . . . . .  Character position:
;. . . . * . . . . . . . . . . .  U1.QE: char position, bit 3 (A3 to PDSP2110)
;. . . . . * . . . . . . . . . .  U1.QF: char position, bit 2 (A2 to PDSP2110)
;. . . . . . * . . . . . . . . .  U1.QG: char position, bit 1 (A1 to PDSP2110)
;. . . . . . . * . . . . . . . .  U1.QH: char position, bit 0 (A0 to PDSP2110)
;. . . . . . . . * * * * * * * *  Character:
;. . . . . . . . * . . . . . . .  U2.QA: character, bit 7 (D7 to PDSP2110)
;. . . . . . . . . * . . . . . .  U2.QB: character, bit 6 (D6 to PDSP2110)
;. . . . . . . . . . * . . . . .  U2.QC: character, bit 5 (D5 to PDSP2110)
;. . . . . . . . . . . * . . . .  U2.QD: character, bit 4 (D4 to PDSP2110)
;. . . . . . . . . . . . * . . .  U2.QE: character, bit 3 (D3 to PDSP2110)
;. . . . . . . . . . . . . * . .  U2.QF: character, bit 2 (D2 to PDSP2110)
;. . . . . . . . . . . . . . * .  U2.QG: character, bit 1 (D1 to PDSP2110)
;. . . . . . . . . . . . . . . *  U2.QH: character, bit 0 (D0 to PDSP2110)

;***********************PIN_LAYOUT************************;
;*   PIN___FUNCTION || PIN___FUNCTION || PIN___FUNCTION  *;
;*   C.0   SDI      || C.1   LCHCLK 12|| C.2   SHFCLK 11 *;
;*   B.1   -WR      || C.4   -RST     ||                 *;
;*********************************************************;
;*********************************************************;
;* This section is for renaming variables and constants  *;
;*********************************************************;
symbol nRST=c.4
symbol SDI=c.0
symbol SHFCLK=c.2
symbol nWR=b.1
symbol LCHCLK=c.1
symbol TM=200 ;this was 'symbol TM=2' Change back when done testing
         ;this will make all delays 5.7uS
;*********************************************************;
;* This is the main code which was made so it would      *;
;* be easy to change what's on the display               *;
;*********************************************************;
main:
    setfreq m16 ;set system clock to 16MHz
    let b1=%00110000 ;high nCE,nFL
    low SHFCLK,LCHCLK,SDI
    high nWR
    gosub write_sr ;a do nothing state
    high nRST ;start the reset process
    pauseus TM
    low nRST
    pauseus TM
    high nRST ;end of reset process
    let b1=%00010000 ;low nCE
    gosub write_sr ;get access to the display
    do ;start endless loop
        let b1=%00010001 ;high nFL, low nCE. address #1
      
      let b0="H"
        gosub load_on_screen
        let b1=%00010010 ;high nFL, low nCE. address #2
      
      let b0="e"
        gosub load_on_screen
        let b1=%00010011 ;high nFL, low nCE. address #3
      
      let b0="l"
        gosub load_on_screen
        let b1=%00010100 ;high nFL, low nCE. address #4
      
      let b0="l"
        gosub load_on_screen
        let b1=%00010101 ;high nFL, low nCE. address #5
      
      let b0="o"
        gosub load_on_screen
        let b1=%00010110 ;high nFL, low nCE. address #6
      
      let b0="!"
        gosub load_on_screen
    loop until b10=10 ;endless loop

    ;***************************************************;
    ;* this stores the data above in the shift         *;
    ;* register.                                       *;
    ;***************************************************;
    write_sr:
        let b2=0 ;start loop value
        do ;start loop
            if bit0=1 then
                high SDI
            else
                low SDI
            endif
            pauseus TM ;let it register
            high SHFCLK ;load value to shift register
            pauseus TM ;let it register
            low SHFCLK
            let w0=w0/2 ;shift value down one place
            inc b2 ;let b2=b2+1 so the loop will work right
        loop until b2=16
        pause TM ;let it register
        high LCHCLK ;load shift register to the output
        pause TM ;let it register
        low LCHCLK
        pause TM ;let it register
        return
;*********************************************************;
;* This loads the data in the shift register to the      *;
;* screen.                                               *;
;*********************************************************;
load_on_screen:
        gosub write_sr
        pause TM ;let it register
        low nWR ;put it on the PDSP2112
        pause TM ;let it register
        high nWR ;remove access from the display
        pause TM ;let it register
        return

;*********************************************************;
;*              <- END OF PDSP PROGRAM ->                *;
;*********************************************************;

;*******************************************************************;
;* Version 1.0 Supercap2F                                          *;
;*-----------------------------------------------------------------*;
;* Update list:                                                    *;
;* 1) - Code Complete - Supercap2F - 10/28/2014                    *;
;* 2) - Simplified the main code - Supercap2F - 10/29/2014         *;
;* 3) - Simplified the display code - Supercap2F - 10/29/2014      *;
;* 4) - Changed pin layout. And made code more robust              *;
;*      Supercap2F - 10/30/2014                                    *;
;* 5) - Changed varaibles back to how they where - Supercap2F      *;
;*      - 10/31/14                                                 *;
;*                                                                 *;
;*******************************************************************;
I changed where -CE is hooked up (from QB to QC). So I had to change the binary in b1.. I think I did it right, but you might want to double check me on it. :D:p

Other than that, I reprogrammed the chip and it all seams to be working right on the breadboard... Do you think I should put the PDSP in it's place and see if it works now? :)
Dan
 

KrisBlueNZ

Sadly passed away in 2015
That all looks OK. The code that deals with -RST could be reduced slightly and commented. After "gosub write_sr ;a do nothing state", you don't need to drive nRST high wait. You just need the three lines that set nRST low, wait, and set nRST back high again.

You should include a comment explaining now nRST works - at startup, the PIC's I/O pins are all in input mode, and R3 (10k) pulls nRST low; this ensures that the display device powers up blank. The "low nRST" command sets the PIC's I/O pin to an output and drives it low, "just to make sure", then the "high nRST" command drives it high so the display can accept commands.
 
Okay, that sounds great! :) Here's the new code:
Code:
;*********************************************************;
;*             <- START OF PDSP PROGRAM ->               *;
;*********************************************************;
;*********************************************************;
;* This program displays 'Hello!' on the PDSP2112        *;
;*********************************************************;
;F E D C B A 9 8 7 6 5 4 3 2 1 0  (bits in w0)
;7 6 5 4 3 2 1 0 . . . . . . . .  (bits in b1)
;. . . . . . . . 7 6 5 4 3 2 1 0  (bits in b0)
;* . . . . . . . . . . . . . . .  U1.QA - available for future use
;. * . . . . . . . . . . . . . .  U1.QB - available for future use
;. . * . . . . . . . . . . . . .  U1.QC: -CE to PDSP2110
;. . . * . . . . . . . . . . . .  U1.QD: -FL to PDSP2110
;. . . . * * * * . . . . . . . .  Character position:
;. . . . * . . . . . . . . . . .  U1.QE: char position, bit 3 (A3 to PDSP2110)
;. . . . . * . . . . . . . . . .  U1.QF: char position, bit 2 (A2 to PDSP2110)
;. . . . . . * . . . . . . . . .  U1.QG: char position, bit 1 (A1 to PDSP2110)
;. . . . . . . * . . . . . . . .  U1.QH: char position, bit 0 (A0 to PDSP2110)
;. . . . . . . . * * * * * * * *  Character:
;. . . . . . . . * . . . . . . .  U2.QA: character, bit 7 (D7 to PDSP2110)
;. . . . . . . . . * . . . . . .  U2.QB: character, bit 6 (D6 to PDSP2110)
;. . . . . . . . . . * . . . . .  U2.QC: character, bit 5 (D5 to PDSP2110)
;. . . . . . . . . . . * . . . .  U2.QD: character, bit 4 (D4 to PDSP2110)
;. . . . . . . . . . . . * . . .  U2.QE: character, bit 3 (D3 to PDSP2110)
;. . . . . . . . . . . . . * . .  U2.QF: character, bit 2 (D2 to PDSP2110)
;. . . . . . . . . . . . . . * .  U2.QG: character, bit 1 (D1 to PDSP2110)
;. . . . . . . . . . . . . . . *  U2.QH: character, bit 0 (D0 to PDSP2110)

;***********************PIN_LAYOUT************************;
;*   PIN___FUNCTION || PIN___FUNCTION || PIN___FUNCTION  *;
;*   C.0   SDI      || C.1   LCHCLK 12|| C.2   SHFCLK 11 *;
;*   B.1   -WR      || C.4   -RST     ||                 *;
;*********************************************************;
;*********************************************************;
;* This section is for renaming variables and constants  *;
;*********************************************************;
symbol nRST=c.4
symbol SDI=c.0
symbol SHFCLK=c.2
symbol nWR=b.1
symbol LCHCLK=c.1
symbol TM=200 ;this was 'symbol TM=2' Change back when done testing
         ;this will make all delays 5.7uS
;*********************************************************;
;* This is the main code which was made so it would      *;
;* be easy to change what's on the display               *;
;*********************************************************;
main:
    setfreq m16 ;set system clock to 16MHz
    let b1=%00110000 ;high nCE,nFL
    low SHFCLK,LCHCLK,SDI
    high nWR
    gosub write_sr ;a do nothing state
    low nRST   ;when the PICAXE starts up, all of the pins are in input mode
    pauseus TM ;the 10K resistor on nRST will make sure the display powers up blank
    high nRST  ;the "low nRST is just to make sure it all works right and the "high nRST"
             ;is so the display can accept commands
    
    let b1=%00010000 ;low nCE
    gosub write_sr ;get access to the display

    do ;start endless loop
        let b1=%00010001 ;high nFL, low nCE. address #1
      let b0="H"
        gosub load_on_screen
        let b1=%00010010 ;high nFL, low nCE. address #2
      let b0="e"
        gosub load_on_screen
        let b1=%00010011 ;high nFL, low nCE. address #3
      let b0="l"
        gosub load_on_screen
        let b1=%00010100 ;high nFL, low nCE. address #4
      let b0="l"
        gosub load_on_screen
        let b1=%00010101 ;high nFL, low nCE. address #5
      let b0="o"
        gosub load_on_screen
        let b1=%00010110 ;high nFL, low nCE. address #6
      let b0="!"
        gosub load_on_screen
    loop until b10=10 ;endless loop

    ;***************************************************;
    ;* this stores the data above in the shift         *;
    ;* register.                                       *;
    ;***************************************************;
    write_sr:
        let b2=0 ;start loop value
        do ;start loop
            if bit0=1 then
                high SDI
            else
                low SDI
            endif
            pauseus TM ;let it register
            high SHFCLK ;load value to shift register
            pauseus TM ;let it register
            low SHFCLK
            let w0=w0/2 ;shift value down one place
            inc b2 ;let b2=b2+1 so the loop will work right
        loop until b2=16
        pause TM ;let it register
        high LCHCLK ;load shift register to the output
        pause TM ;let it register
        low LCHCLK
        pause TM ;let it register
        return
;*********************************************************;
;* This loads the data in the shift register to the      *;
;* screen.                                               *;
;*********************************************************;
load_on_screen:
        gosub write_sr
        pause TM ;let it register
        low nWR ;put it on the PDSP2112
        pause TM ;let it register
        high nWR ;remove access from the display
        pause TM ;let it register
        return

;*********************************************************;
;*              <- END OF PDSP PROGRAM ->                *;
;*********************************************************;

;*******************************************************************;
;* Version 1.0 Supercap2F                                          *;
;*-----------------------------------------------------------------*;
;* Update list:                                                    *;
;* 1) - Code Complete - Supercap2F - 10/28/2014                    *;
;* 2) - Simplified the main code - Supercap2F - 10/29/2014         *;
;* 3) - Simplified the display code - Supercap2F - 10/29/2014      *;
;* 4) - Changed pin layout. And made code more robust              *;
;*      Supercap2F - 10/30/2014                                    *;
;* 5) - Changed varibles back to how they where - Supercap2F       *;
;*      - 10/31/14                                                 *;
;* 6) - SHFCLK and LCHCLK where defined as the same pin            *;
;*       fixed that - Supercap2F - 12-26-14                        *;
;* 7) - Removed some useless code, and updated comments -          *;
;*       Supercap2F-12-27-14                                       *;
;*******************************************************************;
Do you think I should put the PDSP in it's place now, or should I change something else? :)
Dan
 

KrisBlueNZ

Sadly passed away in 2015
I don't understand the question. Do you mean should you move the PDSP2110 from breadboard to prototyping board? Yes I think so. I'm pretty happy with the hardware. The only hardware changes you'll need to make in the future are the unforeseeable ones :)
 
I don't understand the question. Do you mean should you move the PDSP2110 from breadboard to prototyping board?
Sorry about that, I guess I worded it kind of badly. :confused: I meant should I put the PDSP in the place of the LED on the breadboard now, and see if it works..

But I decide to try it anyway... It didn't work. AGGGGGH!!! :mad::mad::mad::mad:

When turned on it shows this for about a split second (sorry for the bad photo, but it's kind of hard to turn it on and take a photo at the same time):
SPLIT.JPG
Then it shows this:
ON.JPG
And blinks on and off every second or two...

Got any Ideas on what I should do next? :confused:o_O
Dan
 
I got it to work Kris!! :)

IMG_0133.JPG

On page 9 of the data sheet it says: "if A3=1, D0-D7 will load the RAM with ASCII and page select data." Well in the code we had A3 set to 0! So I removed A3s wire that went to the shift register, and tied it high. It works like a charm now!
I'll redo the binary in the code later so it works with the shift register...

Thanks for all the help and time you put into this project Kris!!! :) And thanks to you also Steve! I really appreciate it! :)
Dan
 
Top