Let's Make Robots!

Picaxe LCD problem

Hi

A friend of mine is using a picaxe 20m2 to drive a milford instrument 20x4 LCD with a serial backpack. However, when he turns it on, it just comes on with a screen filled with triangles. The LCD is connected to pin 0 .The code he's running is below. What is the problem?

PS: This is my first post, so sorry if it's in the wrong place.

 

code:


pause 1000


pause 2000                       
serout 0,T1200_4,(124, 4) 'Sets 20 char (3)    |
pause 200                       
serout 0,T1200_4,(124, 6) 'Sets 4 line (5)    |
serout 0,T1200_4,(124, 4) 'Sets 20 char (3)    |
pause 200                       
serout 0,T1200_4,(124, 6) 'Sets 4 line (5)    |
serout 0,T1200_4,(124, 4) 'Sets 20 char (3)    |
pause 200                       
serout 0,T1200_4,(124, 6) 'Sets 4 line (5)    |
serout 0,T1200_4,(124, 4) 'Sets 20 char (3)    |
pause 200                       
serout 0,T1200_4,(124, 6) 'Sets 4 line (5)    |
serout 0,T1200_4,(124, 4) 'Sets 20 char (3)    |
pause 200                       
serout 0,T1200_4,(124, 6) 'Sets 4 line (5)    |
serout 0,T1200_4,(124, 4) 'Sets 20 char (3)    |
pause 200                       
serout 0,T1200_4,(124, 6) 'Sets 4 line (5)    |
serout 0,T1200_4,(124, 4) 'Sets 20 char (3)    |
pause 200                       
serout 0,T1200_4,(124, 6) 'Sets 4 line (5)    |
serout 0,T1200_4,(124, 4) 'Sets 20 char (3)    |
pause 200                       
serout 0,T1200_4,(124, 6) 'Sets 4 line (5)    |
serout 0,T1200_4,(124, 4) 'Sets 20 char (3)    |
pause 200                       
serout 0,T1200_4,(124, 6) 'Sets 4 line (5)    |
serout 0,T1200_4,(124, 4) 'Sets 20 char (3)    |
pause 200                       
serout 0,T1200_4,(124, 6) 'Sets 4 line (5)    |
serout 0,T1200_4,(124, 4) 'Sets 20 char (3)    |
pause 200                       
serout 0,T1200_4,(124, 6) 'Sets 4 line (5)    |
serout 0,T1200_4,(124, 4) 'Sets 20 char (3)    |
pause 200                       
serout 0,T1200_4,(124, 6) 'Sets 4 line (5)    |
pause 200
serout 0,T1200_4,(124, 6) 'Sets 4 line (5)    |
serout 0,T1200_4,(124, 4) 'Sets 20 char (3)    |
pause 200                       
serout 0,T1200_4,(124, 6) 'Sets 4 line (5)    |
serout 0,T1200_4,(124, 4) 'Sets 20 char (3)    |
pause 200                       
serout 0,T1200_4,(124, 6) 'Sets 4 line (5)    |
serout 0,T1200_4,(124, 4) 'Sets 20 char (3)    |
pause 200                       
serout 0,T1200_4,(124, 6) 'Sets 4 line (5)    |
serout 0,T1200_4,(124, 4) 'Sets 20 char (3)    |
pause 200                       
serout 0,T1200_4,(124, 6) 'Sets 4 line (5)    |
serout 0,T1200_4,(124, 4) 'Sets 20 char (3)    |
pause 200                       
serout 0,T1200_4,(124, 6) 'Sets 4 line (5)    |
serout 0,T1200_4,(124, 4) 'Sets 20 char (3)    |
pause 200                       
serout 0,T1200_4,(124, 6) 'Sets 4 line (5)    |
serout 0,T1200_4,(124, 4) 'Sets 20 char (3)    |
pause 200                       
serout 0,T1200_4,(124, 6) 'Sets 4 line (5)    |
serout 0,T1200_4,(124, 4) 'Sets 20 char (3)    |
pause 200                       
serout 0,T1200_4,(124, 6) 'Sets 4 line (5)    |
serout 0,T1200_4,(124, 4) 'Sets 20 char (3)    |
pause 200                       
serout 0,T1200_4,(124, 6) 'Sets 4 line (5)    |
serout 0,T1200_4,(124, 4) 'Sets 20 char (3)    |
pause 200                       
serout 0,T1200_4,(124, 6) 'Sets 4 line (5)    |

pause 1000
serout 0,T1200_4,(0x7c, 128)    'Sets backlight full on (128-157 '128 is full on

pause 1000
serout 0,T1200_4,(254, $01) 'Clear Screen


main:
serout 0,T1200_4,(254, $01)
serout 0,T1200_4,("Welcome to your")
serout 0,T1200_4,("     for timing laps on a")
serout 0,T1200_4,("Lap Timer")
serout 0,T1200_4,("           Scalextric car game!")
wait 3
serout 0,T1200_4,(254, $01)

Lapreset:
serout 0,T1200_4,(254, $01)
serout 0,T1200_4,("Are you ready...                                                     ...to race?")
wait 3
serout 0,T1200_4,(254, $01)
serout 0,T1200_4,("3...")
wait 1
serout 0,T1200_4,("...2...")
wait 1
serout 0,T1200_4,("...1...")
wait 1
serout 0,T1200_4,(254, $01)
serout 0,T1200_4,("GO!")
wait 1

Timer:
serout 0,T1200_4,(254, $01)
Let b1=b1+1
serout 0,T1200_4,("0")
serout 0,T1200_4,(#b1)
wait 1
if pin1=1 then goto cat
if pin2=1 then goto car
goto timer


cat:
serout 0,T1200_4,(254, $01)
serout 0,T1200_4,("Well done lane 1!")
serout 0,T1200_4,(#b1)
wait 5
let b1=0
goto Lapreset

car:
serout 0,T1200_4,(254, $01)
serout 0,T1200_4,("Well done lane 2!")
serout 0,T1200_4,(#b1)
wait 5
let b1=0
goto Lapreset


AttachmentSize
NVMNHVNHVMVMGV.bas4.18 KB

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

If he's using this serial backpack from milford instrument then yes, 1200 baud will not do. The backpack speaks at 2400 and 9600 baud, which is switch selectable...

http://www.seetron.com/docs/bpk000mnl.pdf

Sorry, double post

(PS: how do you delete a post?)

First off, if the LCD came with a serial backpack, it is probably working at a baud rate of 9600, or 115200 (I would assume) and thus, your picaxe speaking at 1200 baud is not going to work. Double check the information on your LCD and be sure your baud rates are the same. This is probably your main issue.

The "commands" you are sending --are they as described by Picaxe or from the LCD information?

Why are you sending the command to set the cursor multiple times?

 

Thanks.

This isn't my project, so I'm not sure of all the information about it. I'll tell him to try changing the baud rate.

The commands may be for other LCDs, I didn't know they weren't standard. Will they just be in the datasheet?

I'm not sure why the set cursor command is being used several times, I'll have to ask him.