Shop OBEX P1 Docs P2 Docs Learn Events
Serial LCD resetting — Parallax Forums

Serial LCD resetting

J LudwigJ Ludwig Posts: 19
edited 2010-08-22 21:48 in Propeller 1
I have a Parallax 2-line LCD monitoring a single axis of a 5DOF IMU via an MCP3208 A/D. I have a micro RC servo connected to the prop that responds to the changing position of the IMU. It works well for a while then the Lcd backlight goes out and the text disappears from the screen. The values continue to be displayed and the servo continues to work. I have used this setup with a VGA monitor instead of the LCD and there are no issues. If I let it set without moving the display remains OK but when tilting back and forth it the problem will appear, never the same amount of time or direction of tilt. I have installed 100mf caps across the supply to the LCD and the servo with no change.

If I comment out the line that starts the servo ASM routine the display has no problems, it's as if something is causing the LCD to reset.

I have used this same servo and LCD with a quadrature encoder to control the servo position and had the same problem.

Any ideas about where to look? Spin file attached.

Comments

  • John AbshierJohn Abshier Posts: 1,116
    edited 2010-08-22 17:49
    It sounds like a power problem. Are both the servo and LCD unsing 5 volt power? What is you power supply? Does it work if you turn backlighting off? At the beginning of your program before lcd.init you could blink and led. While running you program if the led blinks that would indicate the power got too low and the program reset.

    John Abshier
  • T ChapT Chap Posts: 4,223
    edited 2010-08-22 18:28
    I use that LCD a lot, and have experienced times when sending certain values, you can turn it off accidentally and it stops working, requiring power off. Try replacing the values that are constantly changing, maybe lcd.dec(x), to a static value like lcd.dec(3) and see if the issue continues. If the issue stops by making the position become static, then perhaps you are sending out a value on occasion that is the same values that would reset the LCD. See the LCD command set at the parallax site, under store > LCD 2x16 backlit. lcd.dec should not normally send out a value that would be confusing, but it does happen, like sending out instructions too fast can be misread as other values, and the LCD could be interpreting a value as :
    DEC    HEX
    17     11 Turn backlight on (only on models 27977, 27979) 
    18     12 Turn backlight off (Default) 
    21     15 Turn the display off 
    
  • J LudwigJ Ludwig Posts: 19
    edited 2010-08-22 21:48
    John,
    You are correct, it was a power problem. I was powering both LCD and servo from the same 5v regulator. I have done that successfully many times before but never with a sensor that made the servo move so actively. I set up another 5v regulator for the servo and that did the trick. Apparently the 5v would dip enough to affect the LCD but not enough to drop out the 3.3v prop supply. My main source of power is a 12v 12 AH gel cell which gives me a clean source with ample capacity.

    Later I put an ammeter in the servo supply and discovered it was drawing 300 ma when working rapidly.

    Thank you,
    Jim

    T Chap,
    Thanks for that tip, I was thinking along software lines as well. That's a good thing to remember for future troubleshooting.
Sign In or Register to comment.