SX/B and a Parallax Serial LCD
Mike W
Posts: 105
I have been trying to send strings and numbers to a Parallax 2X16 (#27976) with the code below but it only transmits the first letter (M) what·am I missing.
Mike W
'
' Device Settings
'
DEVICE········· SX28, OSC4MHZ, TURBO, STACKX, OPTIONX
FREQ··········· 4_000_000
'
' IO Pins
'
·Lcd··VAR·RA.2
'
' Constants
'
·Baud··CON·"T19200"
·LcdOn1········· CON···· $18········ ' LCD on; cursor off, blink off
·LcdCls········· CON···· $0C··········' clear the LCD
·LcdBkLtOn·CON·$11················· ' Back Light On
·LcdBkLtOff·CON·$12·················' Back Light Off
·LcdLine1·CON·$80··················· ' CLS and move to 0,0
'
' Variables
'
' =========================================================================
· PROGRAM Start
' =========================================================================
Pgm_ID:
· DATA· "SX/B Lcd", 0
Start:
· PLP_A = %0100································· ·' enable pull-up
· PLP_B = %00000000···························· ' resistors except
· PLP_C = %00000000····' RA.2
·
· HIGH Lcd········································· ··' make serial output pin high
· PAUSE 750······································· ··' pause to initialize LCD
· SEROUT Lcd, Baud, LcdCls
· PAUSE 10
Customize:
·
· SEROUT Lcd, Baud, LcdOn1
· PAUSE 10
· SEROUT Lcd, Baud, LcdBkLtOn
· PAUSE 10
·
'
' Program Code
'
Main:
· SEROUT Lcd, Baud, LcdLine1
· PAUSE 10
· SEROUT Lcd, Baud, "Mike"
· PAUSE 10
··GOTO Main
Mike W
'
' Device Settings
'
DEVICE········· SX28, OSC4MHZ, TURBO, STACKX, OPTIONX
FREQ··········· 4_000_000
'
' IO Pins
'
·Lcd··VAR·RA.2
'
' Constants
'
·Baud··CON·"T19200"
·LcdOn1········· CON···· $18········ ' LCD on; cursor off, blink off
·LcdCls········· CON···· $0C··········' clear the LCD
·LcdBkLtOn·CON·$11················· ' Back Light On
·LcdBkLtOff·CON·$12·················' Back Light Off
·LcdLine1·CON·$80··················· ' CLS and move to 0,0
'
' Variables
'
' =========================================================================
· PROGRAM Start
' =========================================================================
Pgm_ID:
· DATA· "SX/B Lcd", 0
Start:
· PLP_A = %0100································· ·' enable pull-up
· PLP_B = %00000000···························· ' resistors except
· PLP_C = %00000000····' RA.2
·
· HIGH Lcd········································· ··' make serial output pin high
· PAUSE 750······································· ··' pause to initialize LCD
· SEROUT Lcd, Baud, LcdCls
· PAUSE 10
Customize:
·
· SEROUT Lcd, Baud, LcdOn1
· PAUSE 10
· SEROUT Lcd, Baud, LcdBkLtOn
· PAUSE 10
·
'
' Program Code
'
Main:
· SEROUT Lcd, Baud, LcdLine1
· PAUSE 10
· SEROUT Lcd, Baud, "Mike"
· PAUSE 10
··GOTO Main
Comments
I recently bought a SX Tech Tool Kit PRO and a parallel LCD and serial LCD module from Parallax. I noticed there was not any serial LCD code written for the SX. I converted the BS2 example code into SX code as my first SX code writing. I have attached the last·working version B. You can also see the link to show the process I went·through with the excellent support by Parallax.
http://forums.parallax.com/showthread.php?p=557801
(also see attachment)
Timothy Gilmore
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
I downloaded your attachment and recieved an error message:
INVALID PARAMETER "CC0"
INVALID PARAMETER "CC1"
INVALID PARAMETER "CC2"
INVALID PARAMETER "Smiley"
Mike
I had better luck with your example but it doesn'nt always start at the upper left corner (0,0)
·· Do you have the latest version of the SX/B compiler?· If not, you can find it at the following link...
http://forums.parallax.com/showthread.php?p=517621
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Thanks to Timothy, Jon and Chris for their help.
I have tried to convert from pbasic to SX/B and I am still having slim to no success I now need to study your examples and tyr to learn from them. and hopefully begin to develope my own code.
Thanks All
Mike W
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
I am considering a serial LCD as my next endeavor. The prgram that is in the Help/Example Projects Serial LCD, was that of any use. I thought maybe you could give me some real feed back, since you have something that is functional.
Thanks
I used the Help/Example projectsSerial LCD to try and get my LCD to work. the code I posted was the result of my efforts. If you look at either Jon's or Timothy's example you will see that I missed a considerable amount of know how.
Although their is a lot of information out their you really have to research it to come up with answers. fortunially there is the Parallax forum to help with the really dark area's
Mike W
Good luck.
sample programs only transmit text strings, or anything between "double quotes" how about
digits (0 - 9) like a counter or outputing data from a sensor.
Mike W
I don't exactly need written code as much as just help. If someone could
just point me in a direction like which comands should I read and work with
maybe I could figure it out.
thank's
Mike W
I've added numeric output routines to my Parallax Serial LCD demo with SX/B.· It's attached.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Here is my rendition (attached) to display numbers (between 0 and 99 - one or two digits only)
But Jon has it done very well.
He is the man!
Great Job Jon!
Post Edited (tdg8934) : 12/2/2005 4:18:00 AM GMT
THANKS!!!!!!
You guys are great.
I just barely got to look at them, I have a Christmas Lunch today
but I will be deep into it sometime later tonight.
I just wanted to say Thank You
Mike W