Sparkfun V2.5 Serial Serial LCD Help.... PLEASE im going to smash it with a hammer!

speed23947

New Member
I'm fairly new with the picaxe chip but I have the basics of the basics down.
I'm tying to get working a serial LCD from sparkfun.
www.sparkfun.com/datasheets/LCD/SerLCD_V2_5.PDF
I'm running a 18m2 picaxe and I'm only trying to get it to say "Hello" but I've been trying for two days!
From what i can guess its a baud rate issue because it is sending info but it looks like its in scans script. If I
change the text in the script I do see it change the weird letters on the lcd so I think its talking just not saying the right thing.
This is some of what ive been trying....

serout c.0, n4800, ("hello")
serout c.0, n9600, ("hello")
serout c.0, n4800_8,("hello")
serout c.0, n4800,(254,128,"text")
serout c.0, n2400, (254,124,"<controll>l"
and every combo in between
Ive used setfreq 4 setfreq 8
they all give me different non readable characters and dont know where to go from here.

was just trying to get a temp sen working but didnt think this would be the hard part.
and help would be greatly appreciated!!!!!!
speed23947
 
Last edited by a moderator:

SAborn

Senior Member
A quick look at the data sheet and it quotes........9600 baud as a default, so unless you have changed the baud rate your 4800 baud in your code is wrong.
You will need to overclock the picaxe to 8meg to get the 9600 baud, then once working you can change the display baud to a lower speed, but will also need change the code and picaxe speed to suit.

I did not notice in the data sheet if the serial is true or inverted, so if N9600_8 dont work then try T9600_8 for you baud rate.
 

westaust55

Moderator
Have you tried a search on this forum about the Sparkfun LCD?
It has been the topic of confusion/problems on a number of occasions in the past.
There may be working examples if someone was nice enough to document once running.

As alluded to by SAborn, if running the PICAXE at other then the default clock speed, you need to append the clock speed as a suffix to the baud rate. That is _x. Wher "x" is the clock speed.
Do recall the Sparkfun LCD display is True rather than iNverted serial signal.
 

westaust55

Moderator
See here and in particular post 7:
http://www.picaxeforum.co.uk/showthread.php?12920-Serial-LCD

note that:
- control-a = 01 = $01
- control-k = 11 or $0B
- control-l = 12 or $0C ; "l" is the 12th letter of the alphabet
get the idea



now don&#8217;t bother with this thread:
http://www.picaxeforum.co.uk/showthread.php?10372-How-to-with-SerLCD-2-5
mentioned just to show that we get dead links if folks give links to there own website rather than posting the actual code here on the PICAXE forum where it is most unlikely to be lost.
 

mrburnette

Senior Member
SparkFun's displays use "T" signaling. Scott Edwards', PICAXE LCD/OLED, etc. do not.... that is, they use "N"
I have several of the SF displays, work fine but occasionally they are picky when sending them control sequences... I generally use a pause instruction to give the display time to stabilize.

- Ray
 

MikeGyver

Senior Member
Yup, use T9600, not N9600

Try this...

Code:
serout c.0,T9600, (254,1)
serout c.0,T9600, (254,132,"Giggity")
pause 500
serout c.0,T9600, (254,199,"Goo!")
 

speed23947

New Member
Thanks to everone that answer, I did get it to work. the liak for westaust55
sent me to another page where vfx morley had this....
setfreq m8 'sets picaxe frequency
pause 2000 'wait 1 sec (at 8mhz) to initialise lcd
serout 3, t4800,(124,9) 'i think this will turn off the boot screen
serout 3, t4800, (124,11) ' 11 = $0B = Ctrl-k
setfreq m4 'returns picaxe to default speed
serout 3,t2400,(254,128,"can you see this")

Minus the last line if I add that before the Main: header it will print to the lcd fine.
Thanks everyone
speed23947
 

Technical

Technical Support
Staff member
For SparkFun LCD users in the future:
M2 parts

Code:
; Routine for M2 and older parts, use at 2400 baud

symbol LCD_pin = B.7    ; adjust pin as necessary
 

Initialise_Sparkfun_LCD:
    high LCD_pin    ; switch LCD pin to a high output
    pause 1000    ; wait for LCD to initialise
    setfreq m8    ; change to 8MHz to use 9600 baud
    serout LCD_pin,T9600_8,(124,9)     ; toggle boot screen (hide)
    pause 10
    serout LCD_pin,T9600_8,(124,11) ; change baud to 2400
    pause 10
    setfreq m4     ; return to 4MHz operation

Main:
    serout LCD_pin,T2400_4,(254,128,"This is line 1")
    serout LCD_pin,T2400_4,(254,192,"This is line 2")
X2 parts
Code:
; Routine for X2 parts, use at 9600 baud

symbol LCD_pin = B.7    ; adjust pin as necessary
 
Initialise_Sparkfun_LCD:
    high LCD_pin    ; switch LCD pin to a high output
    pause 1000    ; wait for LCD to initialise
    serout LCD_pin,T9600_8,(124,9)     ; toggle boot screen (hide)
    pause 5

Main:
    serout LCD_pin,T9600_8,(254,128,"This is line 1")
    serout LCD_pin,T9600_8,(254,192,"This is line 2")
 
Top