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!
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:
I will lay it out on a breadboard next, it's going to be so cool to have this working!
Dan
Totally missed the bit1 and w2 things, good eye! but I guess around me you have to have one. Lol!
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 *;
;* *;
;*******************************************************************;
Dan
Last edited: