HELP! first SX project
I am new to the SX, plently of PBASIC experience, I'm trying to drive a HD44780 LCD in 4bit mode, can anyone tell me why this doesn't work???· I've tried all kinds of playing with timing, I can't figure out what is wrong, There are two problems in this code, #1 is a LOOKUP function that I am used to in pbasic for convertering an ASCII string that doesn't seem to work right in SX/B.· Normal syntax I would use in pbasic is LOOKUP loopctr,[noparse][[/noparse]"I WANT TO DISLPAY THIS"],char to break up the string, does not work in sx/b.· The next problem is much more serious, even if I hard code ascii values, I cannot get anything to dislplay on the LCD.· I am using an SX48.· I tried example code for the SX28, and could not get that to work either.· From an SX/B standpoint, should the processor make a difference (other than I/O)?
Please help!
thanks
Please help!
thanks
Comments
The do-loop reads the characters until a zero is encountered.
regards peter
LOOKUP idx,[noparse][[/noparse]"THIS IS THE TEXT FOR LINE 1"],char
with a for loop corresponding to the length of the character array running around it, but something is SX/B does not like the syntax of a character array constant, any ideas?
·
P.S. -- I might argue that using DATA and READ on a Stamp is also a better approach than using LOOKUP.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
All you have to do is move the cursor to the starting position of the string and then:
LCD_STR "This is a string"
or
LCD_STR SomeLabel
... where SomeLabel is a z-string in a DATA statement. Had you taken two minutes to study the listing you would have seen all this -- and the demo from which you liberated this code showed the strings in action. Oi....
Here's the story, I first started with code I wrote based on how I always used to do it on a BS2.· It didn't work, display would not even initalize, no cursor, nothing.· I literally spent a day on this using a logic analyzer and comparing timing against datasheets, I was stumped.· I then started downloading other 'example' code and tried every one I could find, I liked the way the subroutines were written (better than mine) the best in the one that had the LCD_STR, so I started adapting those.· But I still couldn't get the display to work.· It wasn't until after spending almost a full day on this that I figured out the problem, I was using a "special" HD44780 (futaba VFD) display that could be configured to work as serial or parallel, the jumpers on the display were set for serial [noparse]:)[/noparse].· My bad.· After fixing that, all the programs (including mine) worked to some extent.· I am still having a really tough time getting through the differences between PBASIC and SX/B though.
Thanks for all your help, and thanks for some great sample code.