Shop OBEX P1 Docs P2 Docs Learn Events
can't get my serial LCD to work with SX — Parallax Forums

can't get my serial LCD to work with SX

datacpsdatacps Posts: 139
edited 2007-06-22 22:39 in General Discussion
I can't get my Parallax serial LCD to work with the SX chip. I know I am doiing something wrong but·don't know what. With the BS2·I had no problems sending and displaying on the LCD. Since the SX/B code is different I don't know how to set it up. I have the LCD 27976
can someone point me in the right direction. Also I would like to use serial LCD and I see some code for some other serial LCD but it's not the one I have.·The SX chip is a lot different than the BS2. cry.gif

Comments

  • JonnyMacJonnyMac Posts: 9,215
    edited 2007-06-17 19:55
    I've attached demo I wrote (at Parallax's request) for the Parallax Serial LCD some time ago -- this should get you going. Yes, SX/B is different than PBASIC, but it doesn't take long to learn and work with the differences.
  • datacpsdatacps Posts: 139
    edited 2007-06-17 20:20
    Thanks Jonny Mac. I will start to play with the Code. I guess most of definitions are already in the BS2
    .Thanks for your fast reply. This is a great site and Parallax has great products and unmatched support. Thanks again
  • JonnyMacJonnyMac Posts: 9,215
    edited 2007-06-17 20:35
    Truth be told you would have found that same demo on the Parallax Serial LCD page -- you should always check with a manufacturer for demo code before going public for a request for help.
  • datacpsdatacps Posts: 139
    edited 2007-06-18 03:09
    Thanks Jonny I saw the code but the code I saw said it was for compatible IUY&*UIY I can't remember the name. Sorry to ask for info that maybe I should of found, You are correct .. but even after downloading your code I would like to ask another question only because I am a newbie to the stamp and even more the SX Chip. The BS2 was so much esier to learn,, but I want to ask.. I maybe having some problems with my Pro board running with a 9V power supply. I read that it was recomended I use 12V. anyway if I just wanted to display "hello I am the SX Chip"... What do I have to do. Convert each letter into ASCII or hex or bin..If I do how would I assemlbe them in the BS2 it was simple [noparse][[/noparse] "put the data in beween the" ] It probably is a very stupid question but I am having trouble getting started with this chip.... thank you ..... Charlie
  • datacpsdatacps Posts: 139
    edited 2007-06-18 03:45
    SEROUT Pin, BaudMode, Value

    Function
    Transmit asynchronous serial byte (e.g., RS-232).


    Pin ....is any SX IO pin (RA.0 .. RA.7, RB.0 .. RB.7, RC.0 .. RC.7, RD.0 .. RD.7, RE.0 .. RE.7).
    BaudMode.... is a string constant that specifies serial timing and configuration. SX/B will raise an error if the baud rate specified exceeds the ability of the target FREQ.
    Value..... is a byte variable or constant (0 - 255) to be transmitted.

    SEROUT RA.0, T9600, "A"


    That is the way SX/B explains it to me but no matter what I try to do I can't display any text # or data of any kind. AM I having hardware problems? I got my Baud set at "T9600" lcdtx set to RA.0What am I doing wrong?
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2007-06-18 04:58
    Are you using the SX's internal 4-MHz or are you using an external oscillator (or a crystal)?· Does your LCD show the "default screen" in the TEST Mode?
  • datacpsdatacps Posts: 139
    edited 2007-06-18 10:23
    '
    ' Device Settings
    '

    DEVICE SX28, OSCXT2, TURBO, STACKX, OPTIONX
    FREQ 4_000_000

    Internal 4mhz
    yes you are right it does show the test mode so I have plenty of power to it? Are my device settings off I have a 50mhz resonator but I just use what the test programs settings are...
  • datacpsdatacps Posts: 139
    edited 2007-06-18 12:39
    I have the resonator in the socket and I was testing the freqout code Bean helped me with. I thought the device setting will set up the chip when I program?? . I am going to set up the device to work with the resonator at 50Mhz.. Thanks for your input I overlooked the setting testing different codes. hop.gif
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2007-06-18 14:52
    FREQ must (emphatically) match your clock source.
  • Shawn LoweShawn Lowe Posts: 635
    edited 2007-06-18 20:19
    There should be another resonator with your kit. It should be a 4 mhz resonator. Try using that one

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Shawn Lowe


    My last words shall be - "NOT YET!!!"
  • datacpsdatacps Posts: 139
    edited 2007-06-19 12:38
    I don't see another resonator I bought the 50mhz on e. sholud there be one with the probpoard???? because if there is I did not get one..
  • datacpsdatacps Posts: 139
    edited 2007-06-21 00:42
    Ok I am a new bie and I downloaded the LCD test

    I looked at me device settings and set it up I try to program the chip and I get this error

    lcdTx··PIN·RA.0···' LCD serial connection
    "unkown Command· lcdtx"

    anyone have a test code that I can use with the 50mhz resonator
    and all I want it to do is display.. "hello" the·test code i downloaded·just looks complicated to a newbie like me.. Sorry for being so green guys but switching over from BS2 to the sx is harder than I thought. If I see the code·in just a simple piece of code I will understand it so much better..Thanks
  • JonnyMacJonnyMac Posts: 9,215
    edited 2007-06-21 00:51
    The code I posted earlier (in this thread) will work with a 50 MHz resonator -- change the DEVICE and FREQ directives accordingly.
  • datacpsdatacps Posts: 139
    edited 2007-06-21 01:04
    I did that and now it seems no matter what I try to program to the sx I get that error on the first line

    lcdtx···· pin· ra.0
    error 16 unkown command··· "lcdtx"

    I can 't even debug it shows that error all the time now.. is there something in the SX/B compiler setting??? this is getting strange
  • JonnyMacJonnyMac Posts: 9,215
    edited 2007-06-21 01:11
    Can you provide a screen shot from your IDE?
  • datacpsdatacps Posts: 139
    edited 2007-06-21 01:44
    jonny i can load and run any example file in the SX program test folder I have the LED flashing right now. but when I try to load the LCD code I get that error every time. my ide setting in the config setting just has default to sx/b and restore workspace checked if that is what you mean..what should I look for????or is somthing diff in you lcd test setting??
  • Capt. QuirkCapt. Quirk Posts: 872
    edited 2007-06-21 06:00
    datacps,

    to get a screen shot for JonnyMac,

    (1)reproduce your problem with SX/B, (2)then press the button on you're keyboard that says "Print Scrn". (3)Then open "Paint" from the Windows Accessories folder. (4) Click on "Edit", then "Paste". (5) that will give you a snap shot of your computer. (6) Next you need to save it in a format, that is small enough to be transmitted to the forums. (7) "File"-"Save As. In the pop-up box on the bottom, you have the option to "Save as type", Select .PNG and then save it. (8)upload the program by just picking the file with the attachment manager

    If you have made any changes to the program, you can easily upload the program by just picking the file with the attachment manager also

    Myself, I think you need to start over. Leave the program alone, Put both Dip switches on the LCD to the ON position make sure your wire connections are correct (be sure you are using the same ground that the chip does) and after you program the chip, remove the SX-Key or Blitz and make sure you have a 4Mhz resonator in place.

    Then turn on your SX and see if it works.


    Also, if you don't have it, Your manual is here

    Post Edited (Capt. Quirk) : 6/21/2007 6:09:04 AM GMT
  • datacpsdatacps Posts: 139
    edited 2007-06-21 12:31
    Thanks for the info Quirk .. what is strange is that all the sample code that come with the sx/key work perfect. I can flash the LED and I did just about every thing to the code to change time and delays and it all works fine. The Pro board has the VSS and VDD on the side where the stamp chips goes. those are the only Grounds i see on the boards that I can use. I did the LCD test and it is getting power and it does display the Parallax text. Just look at the code that jonny put up and run debug and tell me if you get the error I get. There is something different about it because the other test code work perfect. I will do as you ask and upload the image later today. I did try to upload it last night but you already know it was to big and I will have to do it the way you are stating. Even if I have a LCD problem I can't get the code to debug or program the Chip in sx/key. Thanks again Quirk I will upload later on today...
  • BeanBean Posts: 8,129
    edited 2007-06-21 12:41
    datacps,
    The BS2 code you sent me said T2400 in the comments.
    The code I just sent you uses T2400.
    But the faster baud rates would be better, try the code as it (with the display set to 2400) and see if it works.
    19,200 would make it much more responsive.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    “The United States is a nation of laws -· poorly written and randomly enforced.” - Frank Zappa

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    www.hittconsulting.com


    Post Edited (Bean (Hitt Consulting)) : 6/21/2007 1:38:04 PM GMT
  • Capt. QuirkCapt. Quirk Posts: 872
    edited 2007-06-21 18:20
    Datacps,

    It's not "strange". Your SX chip is working, your SX-key is working and your LCD is working. That means it's something simple, that is staring you in the face and it will be worth a good laugh, after you find it.


    <
    Bill
    Even if I have a LCD problem I can't get the code to debug or program the Chip in sx/key
    You do know that the Debug system is not the same as the BS2. .....Read This

    When you use the SX-Key and you want to just program the chip with the resonator in place, use the shortcut keys "CTRL-P" (this is the simplest way, you don't need Debug yet)

    If you want to program it with the "Debug" feature you need to remove the resonator, conect the SX-key, turn on the PDB.

    Then·set the clock speed with "CTRL-K", Now your ready to click on the "spider" and debug. But you really should read that link and This One Too.

    Post Edited (Capt. Quirk) : 6/21/2007 6:50:20 PM GMT
  • Sparks-R-FunSparks-R-Fun Posts: 388
    edited 2007-06-21 21:41
    I hope you will not be too discouraged. It is really hard for other people to troubleshoot a problem they can not see. We are still trying to help you, though!

    The compiler is telling you that "lcdtx" is not a command it recognizes. In fact, it is not a command at all! It is part of a pin definition and it looks to be correct. Since the compiler is misunderstanding the purpose of the "lcdtx" entry there is very likely an error BEFORE that line. You may have an improperly defined FREQ statement. For 50MHz it should look like this:
    FREQ            50_000_000
    


    It is also possible that you might have accidentally typed an invalid character prior to the line that is reporting the error. I recommend re-downloading JonnyMac's demo program. I think you should be able to run it exactly as it is in Debug or Run modes with the SX-Key attached and without any resonator. If you want to use your 50MHz resonator then you will need to change the FREQ entry as I have described above.

    I hope this helps.

    - Sparks
  • JonnyMacJonnyMac Posts: 9,215
    edited 2007-06-21 21:46
    datacps said...
    jonny i can load and run any example file in the SX program test folder I have the LED flashing right now. but when I try to load the LCD code I get that error every time. my ide setting in the config setting just has default to sx/b and restore workspace checked if that is what you mean..what should I look for????or is somthing diff in you lcd test setting??

    What SX/B compiler version are you running? Look at the output of a file that will compiler (use Ctrl-L) and the compiler version will be listed at the top. I agree with Sparks: the problem is likely above the point where the IDE is pointing to -- that's why I'd like to "see" what you're seeing.
  • datacpsdatacps Posts: 139
    edited 2007-06-22 01:06
    Ok here is the laugh we all have been waiting for.. I got the PDB that came with a disc and on that disc is sx-key 3.1 . I can't believe Parallax would send me that instead of the latest.. So after posting and having you gentlemen help me out you guys led me in the right direction and I looked on the sx section and there it was sx-key 3.2 . when I cleared the tears from my eyes I could not believe what I went through. I am going to email Parallax and tell them to fix that ASAP. SO I downloaded the 3.2 and bingo it got past the first line and now I get this error
    but at least we all know now what we are dealing with. What new update do I have to download now to get this thing working...????
    READINC tmpW1, tmpB1
    error "unkown Command "readinc"
    Thank you all for your help .....
  • datacpsdatacps Posts: 139
    edited 2007-06-22 01:24
    I see Bean has all the updates posted I also see the one compliler version sxb 1.51 I downloaded that but I am looking at the readme now to see how I have to compile or use it........ Thanks again guys ..... I may just start to really have fun now with the SX Chip. The BS2 was a blast.......I hope to have more fun with the SX
  • PJMontyPJMonty Posts: 983
    edited 2007-06-22 16:41
    Datcps,

    It's not uncommon for manufacturers to send a product disc that does not contain the latest version of their software. Why? Simple. When they make the discs, they farm out the work to a disc duplicator and have hundreds, thousands, or more made all at once. This gives them a great price break. It also means that they may come out with new versions of the software before they finish using all the discs they had made that had the older software.

    It always pays to go to a company's website and see if they have a new version of the software whenever you have any problems. Annoying perhaps, but a simple fact of life.

    Thanks,
    PeterM
  • datacpsdatacps Posts: 139
    edited 2007-06-22 22:39
    You are right Peter. I have the latest version now 3.2.3lg .. Thanks to everyone who posted .. I just got way to excited when I got the board and the chip.. I think it may be a good idea to have the complete update sticky posted. I see Bean put up the update that we have to patch in.. It would be better to have it all completed with the installer put up too. I can finally have start to have fun. Thanks to everyone again... Charlie
Sign In or Register to comment.