Making a SPI VFD work with PICAXE
Note: This thread is regarding an issue with the display. Detailed info on interfacing the display can be found in this thread.
After Buzby recently pointed out cheap VFDs on eBay I decided I'd get one. I didn't get the one he linked but I got an alphanumeric dot matrix one instead. I found the datasheet but I simply can't get it to work properly.
The VFD is correctly connected to a regulated 12V power supply and the PICAXE is powered off a 7805 connected to this power supply. Yes there is a decoupling capacitor!
Attempt using hardware SPI (to display 'PICAXE'):
This code and slight modifications would only result in nothing or the entire display lit.
Attempt using bit-banging (to display "PICAXE"):
All the uncommented for : next loops are character codes. At first, I was just trying to send an 'A' which gave me a checkerboard pattern in all but the first square and a garbled mess in the first square. I then extended it to '!!!!!!!!!!!!!!!A' (in the code above) and on the display every occurence of '!' has a slight ghosting of 'A' in the background and the 'A' in the last square has '!' over it at the same brightness. And the commas were on.
Then I tried to display 'PICAXE' and also tried a different method of turning off the commas:
There was still a lot of ghosting and only the first comma turned off (I repeated the second byte of the comma setting loop and more commas turned off so there's no problem with the commas anymore).
How do I get rid of this ghosting?
Note: This thread is regarding an issue with the display. Detailed info on interfacing the display can be found in this thread.
After Buzby recently pointed out cheap VFDs on eBay I decided I'd get one. I didn't get the one he linked but I got an alphanumeric dot matrix one instead. I found the datasheet but I simply can't get it to work properly.
The VFD is correctly connected to a regulated 12V power supply and the PICAXE is powered off a 7805 connected to this power supply. Yes there is a decoupling capacitor!
Attempt using hardware SPI (to display 'PICAXE'):
Code:
#picaxe 28x2
#no_table
symbol cs = C.2
high cs
pause 200
hspisetup spimode10e,spislow
'Also tried spimode10
low cs
pause 10
main:
hspiout ($60)
pulsout cs,100
hspiout ($57)
pulsout cs,100
hspiout ($3F)
pulsout cs,100
hspiout ($70)
pulsout cs,100
hspiout ($10,"PICAXE")
Attempt using bit-banging (to display "PICAXE"):
Code:
#picaxe 28x2
#no_table
symbol cs = C.2
symbol clock = C.3
symbol dataout = C.5
symbol dataoutpin = pinC.5
main:
output dataout
high clock
high cs
pause 200
low cs
pause 1
for b0 = 0 to 7
low clock
lookup b0,(0,0,0,0,0,1,1,0),dataoutpin 'Set display length
pause 1
high clock
pause 1
next
high cs
pause 1
low cs
pause 1
for b0 = 0 to 7
low clock
lookup b0,(1,1,1,0,1,0,1,0),dataoutpin 'Use maximum brightness
pause 1
high clock
pause 1
next
high cs
pause 1
low cs
pause 1
for b0 = 0 to 7
low clock
lookup b0,(0,0,0,0,1,1,0,0),dataoutpin 'Turn off commas and decimal points
pause 1
high clock
pause 1
next
high cs
pause 1
low cs
pause 1
for b0 = 0 to 7
low clock
lookup b0,(0,0,0,0,1,1,1,0),dataoutpin 'display on/off
pause 1
high clock
pause 1
next
high cs
pause 1
low cs
pause 1
for b0 = 0 to 7
low clock
lookup b0,(0,0,0,0,1,0,0,0),dataoutpin 'set character position
pause 1
high clock
pause 1
next
pause 1
for b0 = 0 to 7
low clock
lookup b0,(1,0,0,0,0,1,0,0),dataoutpin
pause 1
high clock
pause 1
next
for b0 = 0 to 7
low clock
lookup b0,(1,0,0,0,0,1,0,0),dataoutpin
pause 1
high clock
pause 1
next
for b0 = 0 to 7
low clock
lookup b0,(1,0,0,0,0,1,0,0),dataoutpin
pause 1
high clock
pause 1
next
for b0 = 0 to 7
low clock
lookup b0,(1,0,0,0,0,1,0,0),dataoutpin
pause 1
high clock
pause 1
next
for b0 = 0 to 7
low clock
lookup b0,(1,0,0,0,0,1,0,0),dataoutpin
pause 1
high clock
pause 1
next
for b0 = 0 to 7
low clock
lookup b0,(1,0,0,0,0,1,0,0),dataoutpin
pause 1
high clock
pause 1
next
for b0 = 0 to 7
low clock
lookup b0,(1,0,0,0,0,1,0,0),dataoutpin
pause 1
high clock
pause 1
next
for b0 = 0 to 7
low clock
lookup b0,(1,0,0,0,0,1,0,0),dataoutpin
pause 1
high clock
pause 1
next
for b0 = 0 to 7
low clock
lookup b0,(1,0,0,0,0,1,0,0),dataoutpin
pause 1
high clock
pause 1
next
for b0 = 0 to 7
low clock
lookup b0,(1,0,0,0,0,1,0,0),dataoutpin
pause 1
high clock
pause 1
next
for b0 = 0 to 7
low clock
lookup b0,(1,0,0,0,0,1,0,0),dataoutpin
pause 1
high clock
pause 1
next
for b0 = 0 to 7
low clock
lookup b0,(1,0,0,0,0,1,0,0),dataoutpin
pause 1
high clock
pause 1
next
for b0 = 0 to 7
low clock
lookup b0,(1,0,0,0,0,1,0,0),dataoutpin
pause 1
high clock
pause 1
next
for b0 = 0 to 7
low clock
lookup b0,(1,0,0,0,0,1,0,0),dataoutpin
pause 1
high clock
pause 1
next
for b0 = 0 to 7
low clock
lookup b0,(1,0,0,0,0,1,0,0),dataoutpin
pause 1
high clock
pause 1
next
for b0 = 0 to 7
low clock
lookup b0,(1,0,0,0,0,0,1,0),dataoutpin
pause 1
high clock
pause 1
next
high cs
do:loop
Then I tried to display 'PICAXE' and also tried a different method of turning off the commas:
Code:
#picaxe 28x2
#no_table
symbol cs = C.2
symbol clock = C.3
symbol dataout = C.5
symbol dataoutpin = pinC.5
main:
output dataout
high clock
high cs
pause 200
low cs
pause 1
for b0 = 0 to 7
low clock
lookup b0,(0,0,0,0,0,1,1,0),dataoutpin 'Set display length
pause 1
high clock
pause 1
next
high cs
pause 1
low cs
pause 1
for b0 = 0 to 7
low clock
lookup b0,(1,1,1,0,1,0,1,0),dataoutpin 'Use maximum brightness
pause 1
high clock
pause 1
next
high cs
pause 1
low cs
pause 1
for b0 = 0 to 15
low clock
lookup b0,(0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0),dataoutpin 'Turn off commas and decimal points
pause 1
high clock
pause 1
next
high cs
pause 1
low cs
pause 1
for b0 = 0 to 7
low clock
lookup b0,(0,0,0,0,1,1,1,0),dataoutpin 'display on/off
pause 1
high clock
pause 1
next
high cs
pause 1
low cs
pause 1
for b0 = 0 to 7
low clock
lookup b0,(0,0,0,0,1,0,0,0),dataoutpin 'set character position
pause 1
high clock
pause 1
next
pause 1
for b0 = 0 to 7
low clock
lookup b0,(0,0,0,0,1,0,1,0),dataoutpin
pause 1
high clock
pause 1
next
pause 1
for b0 = 0 to 7
low clock
lookup b0,(1,0,0,1,0,0,1,0),dataoutpin
pause 1
high clock
pause 1
next
pause 1
for b0 = 0 to 7
low clock
lookup b0,(1,1,0,0,0,0,1,0),dataoutpin
pause 1
high clock
pause 1
next
pause 1
for b0 = 0 to 7
low clock
lookup b0,(1,0,0,0,0,0,1,0),dataoutpin
pause 1
high clock
pause 1
next
pause 1
for b0 = 0 to 7
low clock
lookup b0,(0,0,0,1,1,0,1,0),dataoutpin
pause 1
high clock
pause 1
next
pause 1
for b0 = 0 to 7
low clock
lookup b0,(1,0,1,0,0,0,1,0),dataoutpin
pause 1
high clock
pause 1
next
pause 1
for b0 = 0 to 7
low clock
lookup b0,(0,0,0,0,0,1,0,0),dataoutpin
pause 1
high clock
pause 1
next
pause 1
for b0 = 0 to 7
low clock
lookup b0,(0,0,0,0,0,1,0,0),dataoutpin
pause 1
high clock
pause 1
next
pause 1
for b0 = 0 to 7
low clock
lookup b0,(0,0,0,0,0,1,0,0),dataoutpin
pause 1
high clock
pause 1
next
pause 1
for b0 = 0 to 7
low clock
lookup b0,(0,0,0,0,0,1,0,0),dataoutpin
pause 1
high clock
pause 1
next
pause 1
for b0 = 0 to 7
low clock
lookup b0,(0,0,0,0,0,1,0,0),dataoutpin
pause 1
high clock
pause 1
next
pause 1
for b0 = 0 to 7
low clock
lookup b0,(0,0,0,0,0,1,0,0),dataoutpin
pause 1
high clock
pause 1
next
pause 1
for b0 = 0 to 7
low clock
lookup b0,(0,0,0,0,0,1,0,0),dataoutpin
pause 1
high clock
pause 1
next
pause 1
for b0 = 0 to 7
low clock
lookup b0,(0,0,0,0,0,1,0,0),dataoutpin
pause 1
high clock
pause 1
next
pause 1
for b0 = 0 to 7
low clock
lookup b0,(0,0,0,0,0,1,0,0),dataoutpin
pause 1
high clock
pause 1
next
pause 1
for b0 = 0 to 7
low clock
lookup b0,(0,0,0,0,0,1,0,0),dataoutpin
pause 1
high clock
pause 1
next
high cs
do:loop
How do I get rid of this ghosting?
Attachments
-
74.5 KB Views: 65
-
69.4 KB Views: 58
Last edited: