Shop OBEX P1 Docs P2 Docs Learn Events
Getting to grips with a BS2 and 4x20 serial LCD — Parallax Forums

Getting to grips with a BS2 and 4x20 serial LCD

BottleBottle Posts: 15
edited 2006-09-04 15:06 in BASIC Stamp
Hello fellow Stampers

Got myself hooked up with a BS2, BoE, a PINK module, and a 4x20 LCD for experimenting with......smile.gif

Very happy with the Stamp and the PINK module - got the sample code in the documentation working.

Also got the 4x20 LCD working (with a serial backpack module).

What I'm currently working on is a way of getting the PINK to work with the LCD - results have been less-than-spectacular (pls see the attached code)

Can get the LCD to display the start-up message, have also created a web browser POST page that updates the correct RAM location on the PINK. This is pretty much the same as the examples in the documentation. The Stamp can access the register, and extract the message, which is then sent to the LCD.

Here's the funny bit - after displaying the message for maybe half-a-second, the display blanks, and then displays the start-up message again. Updating the PINK via the POST page doesn't seem to work, and a hard reset is required.

Any thoughts?

Apologies if this sorta thing's been posted before - I've done a quick 'n' dirty search for similar topics on this forum, but didn't come up with anything relevant.

Ta muchly, Bottle

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
B.·· ;-)


There are 10 types of people in the world - those who can count in binary, and those who can't...

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-09-03 17:20
    Bottle _

    I honestly didn't even look at your program, so this is a bit of a shot in the dark, but it may hold some promise. At the very beginning of your program place the following line of code:

    DEBUG "Starting"

    If during any single iteration of the program you see "Starting" appear MORE than once, something is causing your Stamp to RESET!

    Regards,

    Bruce Bates

    Post Edited (Bruce Bates) : 9/3/2006 5:28:35 PM GMT
  • BottleBottle Posts: 15
    edited 2006-09-03 19:57
    Bruce

    Yep, had tried something along the same lines - basically I have a couple commands at the start to output a string to the LCD.

    After receiving a string from the PINK module, the LCD displays the string correctly, then appears to reset, since it re-displays the start-up message.

    I did check the supply voltage as well, making sure it was spot-on 5v, as well as the supply draw. I was thinking along the lines of a dip in the 5v rail, but I don't think so.
    I've got a 9v 600mA 'wall-wart' PSU feeding the BoE, so should have bags of headroom for the PINK module as well as the LCD.

    I figured it's probably the way I've structured the program, since I'm new to PBasic, but I've used VB & QB in the past, so the syntax is fairly familiar.

    Anyway, I've got a few more things to try, and I'll report back with anything else I can think of!

    TTFN Bottle

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    B.·· ;-)


    There are 10 types of people in the world - those who can count in binary, and those who can't...
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-09-03 20:56
    Bottle -

    You can do as I asked you to do, and I'll be happy to help you troubleshoot your problem, which I thought was the purpose of your message, If, for instance, nothing came out of your LCD, in terms of debugging information, as you expected it to, was it a NO ERROR condition, or a possibly a failure of not waiting for the initialization to complete?

    I hate to sound pedantic or strident but some of us non-Parallax employees can drag you out of the swamp water too. All we need is a small bit of cooperation. FWIW, I've been offering troubleshooting advice on the is for over 10 years, and I've not heard too many complaints!

    I'll be happy to review your program stem-to-stern, and offer constructive criticism, just
    help me to help you, at the moment smile.gif

    Regards,

    Bruce Bates

    Post Edited (Bruce Bates) : 9/3/2006 9:18:43 PM GMT
  • BottleBottle Posts: 15
    edited 2006-09-03 21:47
    Bruce

    Thanks for your help so far - it's given me plenty of food for thought

    I've disassembled the BoE for the evening (it's gone 10pm here, so I'm off to bed!). I'll have the same config set up at work tomorow, with a few extra tools set up to help me decipher the PINK to Stamp to LCD interactions. I've taken on board your suggestion of some extra DEBUG statements, so I can see where my program is getting stuck.

    I've also found the telnet debugging facility useful, as I can see the program continually interrogating the PINK module for any updates to the register. This portion at least seems to work, as I can see the Stamp extracting the string, and it also appears in the DEBUG window.

    Anyway, I'll know more tomorrow

    Happy Stamping

    Bottle

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    B.·· ;-)


    There are 10 types of people in the world - those who can count in binary, and those who can't...
  • BottleBottle Posts: 15
    edited 2006-09-04 15:06
    Howdy eveyone

    Big thanks to Bruce. Added the extra debug line at the start, and guess what, yep, the Stamp was resetting itself after every sucessful LCD update.

    Wondered what it could be until one of my collegues sat looking over my shoulder, and pointed to the obvious error - I'd put a GOTO, instead of a GOSUB.

    D'Oh!!!!!

    Works a treat now

    UPDATE: I've also added a line to clear the LCD before writing any updated strings to it, otherwise, the characters will remain displayed if not over-written.

    Anyway, Thanks to Bruce for the comments. I'll upload the source code once I've tweaked and tidied a few things

    Ta, Bottle

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    B.·· ;-)


    There are 10 types of people in the world - those who can count in binary, and those who can't...
Sign In or Register to comment.