LED Display with PT6961 chip
Jammer7071
Posts: 17
in Propeller 1
I found a display module from a DVD player. It is a LiteOn module model LTM-0305BM. I've tried
to write my own spin code for it from the spi.spin from obex, but not successfully. I also found the code for this chip
only its for a BS2. Can someone steer me in the right direction?
The PT6961 chip has a STROBE pin instead of CS and it's got me stumped.
I am fairly new to spin so go easy on me. Thanks
to write my own spin code for it from the spi.spin from obex, but not successfully. I also found the code for this chip
only its for a BS2. Can someone steer me in the right direction?
The PT6961 chip has a STROBE pin instead of CS and it's got me stumped.
I am fairly new to spin so go easy on me. Thanks
Comments
-- http://pdf1.alldatasheet.com/datasheet-pdf/view/391689/PTC/PT6961.html
...the STB line seems to behave like a CS line: it goes low before the transaction and is raised after.
From what I can tell Strobe goes High to send a command byte then low for a data byte.
I just can't seem to get the timing right.
The SPI object sets CS low for the duration. I tried to go thru the code from the BS2 and
convert it to spin, but I'm not understanding the process as spin is new to me.
Thanks for you help
This is the code I'm trying to convert
' {$STAMP BS2}
' {$PBASIC 2.5}
EN PIN 0 ' enable
CLK PIN 1 ' clock
DOUT PIN 2 ' data out
digit VAR Byte
b VAR Byte
phrase VAR Byte
idx VAR Word
char VAR Byte
x VAR Nib
disp0 DATA $3f
DISP1 DATA $06
DISP2 DATA $5b
DISP3 DATA $4f
DISP4 DATA $66
DISP5 DATA $6d
DISP6 DATA $7d
DISP7 DATA $07
DISP8 DATA $7f
DISP9 DATA $6f
DISP10 DATA $77
DISP11 DATA $7c
DISP12 DATA $58
DISP13 DATA $5e
DISP14 DATA $79
DISP15 DATA $71
DIRA = 15
START:
idx = 0
LOOKUP (phrase - 0),
[disp0,disp1, disp2, disp3, disp4,disp5, disp6,disp7, disp8,disp9, disp10,disp11, disp12,disp13, disp14,disp15], idx
PAUSE 1
GOSUB SET
GOSUB SETWRITE
GOSUB CLEAR
GOSUB DMAX
GOSUB COUNT15
GOTO start
'set display TO 6×12 segments
SET:
EN = 0
SHIFTOUT DOUT, CLK, LSBFIRST, [$02]
EN = 1
RETURN
'set TO writing mode, auto increment address after DATA WRITE
SETWRITE:
EN = 0
SHIFTOUT DOUT, CLK, LSBFIRST, [$40]
EN = 1
RETURN
'clear 8 bytes of the display RAM – This will get rid of weird looking symbols
CLEAR:
EN = 0
SHIFTOUT DOUT, CLK, LSBFIRST, [$C0] 'This is the RAM address
FOR x = 1 TO 8
SHIFTOUT DOUT, CLK, LSBFIRST, [$00] 'This writes 0 TO RAM
NEXT
EN = 1
RETURN
'display ON, MAX brightness
DMAX:
EN = 0
SHIFTOUT DOUT, CLK, LSBFIRST, [$8F]
EN = 1
PAUSE 10
RETURN
'COUNT through 0-9-a-f
COUNT15:
FOR b = 0 TO 15
READ idx ,char
EN = 0
SHIFTOUT DOUT, CLK, LSBFIRST,[$C0,char,$C2,char,$C4,char,$C6,char]' reads idx of data starting at 0 to f
EN = 1
DEBUG ? idx , CR
idx = idx + 1 ' <<< I put this line below shiftout so it will read 0 instead of starting with 1
PAUSE 1000
NEXT
RETURN
When I load this to ram I get segments on then after about 2 seconds
it goes blank again. when loaded to eeprom the display remains on
There is something in my code resetting the propeller.....
When loaded to eeprom the segments stay on but flash about twice a second.
Thanks for the help.
It might be useful to others if you shared what the problem was.
Jim