parallax LCD cursor off mode not working
DRMorrison
Posts: 81
in Propeller 1
Does anyone have any experience with the Parallax LCDs having this issue? Sending Dec 22 is suppose to
"Turn the display on, with cursor off and no blink." The funny thing is, this used to work.
I've just tested this again, and all of the commands 21 thru 25 do not work. All other commands work as
expected. I've purchased a new LCD thinking that I fried mine, but it does the same thing. Also, another
propeller with the same code mimics the behavior. ????
I don't know why. Like this:
Does anyone know of the cause of this odd behavior?
Thanks, Daniel
"Turn the display on, with cursor off and no blink." The funny thing is, this used to work.
I've just tested this again, and all of the commands 21 thru 25 do not work. All other commands work as
expected. I've purchased a new LCD thinking that I fried mine, but it does the same thing. Also, another
propeller with the same code mimics the behavior. ????
CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 Baud = 19_200 ' baud rate for LCD comm. LCD = 0 PUB Main | i dira[LCD] ~~ tx(22) ' LCD ON, cursor OFF & NO Blink tx(12) ' Form Feed waitcnt(clkfreq/10 + cnt) ' Must wait after a Form Feed tx(128) str(string("Hellooo")) PUB Tx(Tx_byte) | t Tx_byte := (Tx_byte | $100) << 1 t := clkfreq / Baud + cnt repeat 10 waitcnt (t += clkfreq / Baud) outa[LCD] := Tx_byte & 1 Tx_byte := Tx_byte >> 1I've done some more testing, and I find that if I place a tx(12) above the first send to the LCD, it works. But
I don't know why. Like this:
PUB Main | i dira[18] ~~ outa[18] ~ dira[LCD] ~~ tx(12) ' EXTRA CODE INSERTED TO FIX? ERRROR tx(22) ' LCD ON, cursor OFF & NO Blink tx(12) ' Form Feed tx(17) waitcnt(clkfreq/10 + cnt) ' Must wait 5ms after a Form Feed
Does anyone know of the cause of this odd behavior?
Thanks, Daniel
Comments
before the to fix it
for many years the other way, as in the code above, without issue. So the problem is solved, but the mystery remains.
Thanks, Daniel
The OUTA is first so the serial line starts up in the 1 state when the DIRA is executed. Often serial receivers have 3 states: open or unknown, 0, and 1. Until you execute the DIRA, the I/O pin is in input mode (open)
I don't know why it had worked for so long up until now, but I will implement the LCD properly from
here on out.
Daniel
Mike
No, I've always connected the data line of the LCD directly to the Prop pin. I like using the LCD as a debug device.
Daniel
It has been my experience that the actual state of a floating (tristated) I/O is unpredictable. I have seen identical boards where some will be consistently high, others consistently low, and some where it oscillates between the two. No apparent reason for the different behaviors, although I suspect it may be due to the normal variations of chip and board manufacturing. Best to avoid potential problems by making sure the signal is always in a known state via code or pull up/down resistors.