Shop OBEX P1 Docs P2 Docs Learn Events
Strings and programming Serial vs. parallel LCD with BS2? — Parallax Forums

Strings and programming Serial vs. parallel LCD with BS2?

CatspawCatspaw Posts: 49
edited 2012-02-07 03:54 in BASIC Stamp
I have 2 x 16 parallel LCD displays (surplus). I'm just now learning to use them. At this initial stage, I'm using Pins 0 - 7 for data and Pins 8 - 10 for control signals. It would appear that I have to hardcode each character into an array, as in the following:

display(0) = "A"
display(1) = "B"
display(2) = "C"

Then FOR...NEXT it to the display.

If I were to use SEROUT, I could just type the whole message in one string and build a hardware interface. Except I would have to account for a delay between each character and synch the control signals to fire during that delay. Not particulary where I would like to go.

Programatically, are there ways to manipulate strings and arrays in PBasic that I'm missing or is this just a fact of life considering they are parallel displays and I'm using a BS2?

32 instructions for each message [if I used every location for each message] could get expensive in terms of instruction count.

Or maybe store the messages in EPROM and pull them out with a single routine and a message index?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2012-02-06 06:04
    Typically, you'd use a subroutine to output a single character to the display. You could store fixed messages in the EEPROM and have another subroutine that would display an EEPROM message given its starting location. This is just the way you have to handle a parallel LCD with a BS2. The BS2p/pe/px Stamps have it so much easier with their built-in parallel LCD support.
  • CatspawCatspaw Posts: 49
    edited 2012-02-07 03:54
    Thanks. As I suspected. Now then, the WRITE and READ are instructions, so to initialize, I should be using DATA [using multiple bytes at a time] to set the messages in EEPROM to conserve on my instruction count. Then READ as output is needed.

    This is acceptable and easy enough for my purposes [until I move on and upgrade to bigger, badder BS's].
Sign In or Register to comment.