Shop OBEX P1 Docs P2 Docs Learn Events
Are there any LCD Programs using the BS2sx? — Parallax Forums

Are there any LCD Programs using the BS2sx?

1234ekna1234ekna Posts: 9
edited 2013-01-22 10:00 in BASIC Stamp
Are there any programs for the BS2x available to use LCDs in general and the Parallax "LCD Terminal AppMod" in particular? (This accessory was at one time sold by Parallax) I searched the Forum for any LCD programs, and came up with nothing.
I like to use one of the inexpensive serial LCDs available on the net. ( KTM-S1201 @ $0.95 each)
Any suggestions or comments are appreciated.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2013-01-20 09:33
    Which do you want to use? The AppMod or a generic serial LCD? The LCD AppMod is a parallel LCD and the sample code will work on any Stamp model except the BS2px without modification. Generic serial LCDs only require a SEROUT statement to provide the serial data. You need to use the appropriate Baud constant and these are provided in the BASIC Stamp Syntax and Reference Manual in the chapter on the SEROUT statement. The control characters that the LCD will respond to vary somewhat from manufacturer to manufacturer, so you'll have to rely on the manufacturer's datasheet. You can always use Parallax's serial LCD documentation as a starting point, but don't be surprised if there are some differences.
  • 1234ekna1234ekna Posts: 9
    edited 2013-01-20 11:35
    Thanks Mike.
    The sample code you referred to was exactly what I was looking for, I have that setup with a BS2sx.
    But in general, I was looking for samples of code using the Hitachi HD4480 or the NEC D7225 LCD Driver chips. As you may be aware, The HD4480 type controller is the de-facto standard for LCD displays, and is used in many types of LCDs by different manufacturers. The NEC chip is used in the $0.95 Serial LCD display.
    I am somewhat surprised that not more users have written programs to use LCDs in general; like I mentioned before, a search on that subject did not bring any results.
    BTW I have never used a STAMP before and obtained the parts a few years ago in anticipation of working with it some day when I had more time. That day has now come and I like to start doing something with it.
    I am in the process now of finding out what kind of information and sample programs are available to help me to learn how to program these devices.
  • Mike GreenMike Green Posts: 23,101
    edited 2013-01-20 12:50
    There's all kinds of information and sample code available. From the main Parallax webpage, click on either the Resources tab or the Downloads button. Under Resources, I find the Nuts & Volts Columns the most useful. At least browse through the index. Under Downloads, click on the Basic Stamp Software, Basic Stamp Documentation, and Educational Tutorials buttons at the very least. The "BASIC Stamp Syntax and Reference Manual" and the "What's a Microcontroller?" tutorial are the two most important references. Parallax products always have links on the webstore page for the product to documentation and code examples.
  • 1234ekna1234ekna Posts: 9
    edited 2013-01-21 06:08
    Thanks. I will look at the pages you mentioned.
    In the mean time I am running in a syntax problem I don't understand and can not find any reference to. It occurs in any program I download from the web site. (and I obviously did not write myself.) As an example, here is an offending line in a program I found describing the use of the BS1 with an LCD.

    SYMBOL DATA_n = 7 ' Bits are shifted out this pin # to 7219.

    The bold letters are put on a black background and the following window appears

    Error
    Expected ":" or end of line

    What does that mean? What does the symbol ":" represent? Like I said, it happens all the time in any program I load in and I can not find a way to avoid this error statement.
  • Mike GreenMike Green Posts: 23,101
    edited 2013-01-21 07:42
    The BS1 uses a different version of PBasic than the various BS2 models. The BASIC Stamp Syntax and Reference Manual discusses the two forms. For example, to define a named constant, you write this for the BS1

    SYMBOL <name> = <constant>

    And you write this for the BS2 models

    <name> CON <constant>

    Unfortunately, the Stamp Editor doesn't give you a helpful message about this. It just doesn't understand the other form. There was a document on converting BS1 programs to BS2 syntax, but I don't happen to have a link to it. You might be able to find it by browsing through the titles of the documentation in the Downloads section under Stamp Documentation.
  • 1234ekna1234ekna Posts: 9
    edited 2013-01-21 11:21
    Thanks Mike. That explains the error message. I will try to correct the program and make sure that the syntax is correct for the BS1 Basic version.
    BTW - Too bad that there is no place where you can look up what error messages are trying to tell you, most versions of BASIC do have them.
  • 1234ekna1234ekna Posts: 9
    edited 2013-01-22 07:48
    Problems again.
    I loaded in the sample program for the BS2sx and the LCD Terminal AppMod. using the BASIC STAMP Editor. After checking for Syntax Errors and finding everything OK, I checked "Run" , the program gets downloaded into the chip, the Editor prints that it has succesfully tokenized the program, but nothing happens. What do I suppose to see after the program is downloaded? Doesn't the uP start executing the BASIC program? Or do I have to do something else to have it doing so?
    (I use a USB to RS232 adapter, and a Window appears showing that there is a connection and a moving green bar indicating data is being transfered successfully)
  • Mike GreenMike Green Posts: 23,101
    edited 2013-01-22 07:52
    Did you specify that you're using a BS2sx? There's a menu item for the Stamp Editor that tells it what kind of Stamp you're using and this can also be specified with a compiler directive in the source file. Usually the example programs come specified for the BS2 and you have to change that source line for other models.
  • 1234ekna1234ekna Posts: 9
    edited 2013-01-22 09:03
    Yes Mike, the first two lines are

    ' {$STAMP BS2sx}
    ' {$PBASIC 2.5}

    Those two lines were prompted in by the Editor as it inquired what STAMP I wanted to use and which version of Basic it was written for. The program itself claims that the program has been written in such a way that any stamp can be used, and you will be prompted which one you like to use. That apparently did not work as intended.
  • playinmyblues_nsccplayinmyblues_nscc Posts: 38
    edited 2013-01-22 10:00
    It always surprises me that the StampWorks book gets left out of mentions.
Sign In or Register to comment.