Shop OBEX P1 Docs P2 Docs Learn Events
SX/B and a Parallax Serial LCD — Parallax Forums

SX/B and a Parallax Serial LCD

Mike WMike W Posts: 105
edited 2005-12-02 16:01 in General Discussion
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

Comments

  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2005-11-29 03:00
    Mike,

    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 WilliamsJon Williams Posts: 6,491
    edited 2005-11-29 03:05
    I converted our BS2 demo to SX/B.· It's attached.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • Mike WMike W Posts: 105
    edited 2005-11-29 03:15
    Jon

    I downloaded your attachment and recieved an error message:

    INVALID PARAMETER "CC0"
    INVALID PARAMETER "CC1"
    INVALID PARAMETER "CC2"
    INVALID PARAMETER "Smiley"

    Mike
  • Mike WMike W Posts: 105
    edited 2005-11-29 03:24
    Timothy

    I had better luck with your example but it doesn'nt always start at the upper left corner (0,0)
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-11-29 05:41
    Mike,

    ·· 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 WilliamsJon Williams Posts: 6,491
    edited 2005-11-29 06:30
    Yes, Mike, do make sure you have the latest compiler:1.42.01 -- my code takes advantages of features incorporated in that update, specifically the ability to move DATA tables to any place in memory.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • Mike WMike W Posts: 105
    edited 2005-11-30 18:51
    I finally got back to my post, and·I had not updated to the latest compiler. everything works fine now.

    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 WilliamsJon Williams Posts: 6,491
    edited 2005-11-30 19:02
    Start small -- there are differences that need to be accommodated. And remember SX/B is not PBASIC, but it is very similar. Once you learn how SX/B works (and how it differs from PBASIC) you'll be able to take full advantage of it. There are *real* examples in the help file (and more posted here) that should be helpful.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • RsadeikaRsadeika Posts: 3,837
    edited 2005-11-30 19:24
    Mike W and Tim,

    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
  • Mike WMike W Posts: 105
    edited 2005-11-30 19:32
    Rsadeika

    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
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2005-11-30 22:54
    I mainly used the documentation that came with the Serial LCD and of course Jon's help to fill in what I missed. The SX/B help is about the best resource we have at the moment. Although I can't wait to see Jon's new book (when available) on SX/B. Research your BS2 resources too and do the conversion. There is not many differences as Jon as stated before.

    Good luck.
  • Mike WMike W Posts: 105
    edited 2005-12-01 02:54
    Since everyone is attentive I might as well as one more favor. I have already figured out that the
    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
  • Mike WMike W Posts: 105
    edited 2005-12-01 22:15
    I have looked through all the examples and help files and I still am lost.
    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
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2005-12-01 22:17
    I will build up my LCD SX28 circuit tonight and provide feedback later tonight.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-12-02 02:08
    Mike,

    I've added numeric output routines to my Parallax Serial LCD demo with SX/B.· It's attached.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2005-12-02 04:09
    Jon beat me to the punch.

    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
  • Mike WMike W Posts: 105
    edited 2005-12-02 16:01
    Hey guys;

    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
Sign In or Register to comment.