Shop OBEX P1 Docs P2 Docs Learn Events
My LCD is high. — Parallax Forums

My LCD is high.

mreishmreish Posts: 4
edited 2006-05-07 21:41 in BASIC Stamp
I have a little app that prints a string out to a SEETRON 216 LCD. When I end the program I get very odd looking charactors that very slowly fill the screen. But, when I send the pin HIGH when the program ends it's okay.

I thought I read some place that you generally don't want to leave pins high if you don't have too.

Comments?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My project, the ElectricMotorcycle Dashboard: Em Dash

Post Edited (mreish) : 5/7/2006 8:42:52 PM GMT

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-05-07 21:09
    Use STOP instead of END.· What's happening is this, when the program ends, the effect is similar to SLEEP.

    If your application is driving loads (sourcing or sinking current through output-high or output-low pins) during SLEEP, current will be interrupted for about 18 ms when the BASIC Stamp wakes up every 2.3 seconds. The reason is that the watchdog-timer reset that awakens the BASIC Stamp also causes all of the pins to switch to input mode for approximately 18 ms. When the interpreter firmware regains control of the processor, it restores the I/O directions dictated by your program.


    In your case your LCD is perceiving that as some character being sent...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • allanlane5allanlane5 Posts: 3,815
    edited 2006-05-07 21:20
    Neat. Yes, in 'sleep' the BS2 'wakes up' every 2 seconds, and sets all pins as inputs briefly. Then the state they should have, input, output high, output low, is applied. Apparently, when you leave your pin high, this 'reset' does nothing. When you leave it low, the 'reset' looks to your LCD like it is 'bouncing' the pin high then back low -- a 'good' clock pulse, in other words.

    So, in this situation, leaving the pin output high is not a problem.

    The real problem is when you tie two outputs together, then try to make one output high, while the other outputs low. If you don't have a 220 ohm resistor between the two, the resulting wrestling match will burn out one or both of the pins.
  • mreishmreish Posts: 4
    edited 2006-05-07 21:41
    Sunnuvagun, I knew that because I read it earlier today! Grr...

    Well, thanks for both replies. Problem solved!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My project, the ElectricMotorcycle Dashboard: Em Dash
Sign In or Register to comment.