View previous topic :: View next topic |
Author |
Message |
Fabri
Joined: 22 Aug 2005 Posts: 275
|
LCD 16x2 reset and strange problem |
Posted: Thu Oct 03, 2013 2:29 am |
|
|
Hi to all,
I use from a long time "lcd.c" driver for LCD 16x2 without any problem.
Now I have some cases where seems LCD lost it's synchronism and display message doesn't start from 0,0 position. May be flat flat cable problem. I simulated it pulling RS signal to GND for a short time. When happen I must to turn off and on power supply to restart LCD. "lcd_init()" function doesn't reset LCD. Is there any way to reset LCD and restart by software ?
Thanks for your help,
Regards,
Fabri |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah
Joined: 11 Mar 2010 Posts: 19384
|
|
Posted: Thu Oct 03, 2013 4:13 am |
|
|
I have seen that with some makes of LCD, with long cables to an instrument door, and a somewhat harsh electrical environment.
Different makes were more/less prone to problems.
Adding a shield to the cable, and ferrite rings at each end got rid of the problem.
However found you could actually tell the display had got into problems from the data 'read back' if you implemented this. Are you reading back, or just using timings?. With the read back, the 'ready' didn't clear. I added a software control to the supply line, as well as the cable fixes, and in the code, if ready didn't clear, powered the LCD down/up.
Best Wishes |
|
![](templates/subSilver/images/spacer.gif) |
Fabri
Joined: 22 Aug 2005 Posts: 275
|
|
Posted: Thu Oct 03, 2013 9:46 am |
|
|
I did alot of EMC test and I haven't any problem also with flat 2 mt long. I don't use shield and ferrite rings from a long time.
I'm using only timing and I can't turn off LCD from my application.
Every 30 second I init display so in case of problem it restart. This case is really strange and affect only RS line of display.
In any case thanks to try to help me.
Regards,Fabri |
|
![](templates/subSilver/images/spacer.gif) |
temtronic
Joined: 01 Jul 2010 Posts: 9178 Location: Greensville,Ontario
|
|
Posted: Thu Oct 03, 2013 2:48 pm |
|
|
What kind of hardware?
Which PIC type and what's the I/O configuration?
Any chance some internal peripheral is allowed to access the 'RS' pin?
How about some device attached to the same power supply that draws some power, Vdd dips....oops..no LCD ???
Can you eliminate 99% of the code and still have the problem ??
hth
jay |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah
Joined: 11 Mar 2010 Posts: 19384
|
|
Posted: Thu Oct 03, 2013 11:47 pm |
|
|
I must admit, the problems I had, _only_ happened with one make of LCD. Problem was they just happened to be the one the customer wanted (particular colour, size etc..). The same cabling had worked fine on many other LCD's.
As a further comment, one thing I have never 'liked' seeing done, is the DB0 to DB3 lines being included in the cable. These lines, are unused on the standard 4bit interface, and have tiny MOSFET pull-ups, only delivering 50uA in some cases. Attach a wire to these, and you have an aerial, just waiting to use the internal MOSFET diode as a rectifier, and induce unwanted voltages inside the chip. If these lines are included in the cable, try cutting them.
Best Wishes |
|
![](templates/subSilver/images/spacer.gif) |
Fabri
Joined: 22 Aug 2005 Posts: 275
|
|
Posted: Tue Oct 08, 2013 2:02 pm |
|
|
Thanks for your help,
In my case I use same lcd from a long time. Also in my opinion display enter in latch mode so the only way to exit is turn off LCD. Tomorrow I'll study better hardware. In any case D0-D3 are connected to GND and aren't included in flat. GND use 6 wire of flat connected to main board. As I told you I did many EMC test and I haven't any case of problem.
Regards,
Fabri |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah
Joined: 11 Mar 2010 Posts: 19384
|
|
Posted: Wed Oct 09, 2013 12:51 am |
|
|
The internal MOSFET's, pull D0 to D3 _up_. So you are wasting a little power by pulling them down... Not terribly important, but worth bearing in mind.
Have you tried adding extra decoupling at the display?. Something good at blocking HF (ceramic capacitor for example) across the supply pins.
What about the design of the cable itself?. 'Twist and flat' cable, with a ground on every alternate pin, can be very effective at reducing the tendency for pick-up on the data lines.
It does sound like FET latch-up. A positive spike on one of the data lines, effectively triggering the FET to start behaving like a thyristor, and therefore staying permanently stuck 'on', till power is removed. This is the problem on using the internal FET diode structure as protection. Could you add external trap diodes at the display?.
Best Wishes |
|
![](templates/subSilver/images/spacer.gif) |
Fabri
Joined: 22 Aug 2005 Posts: 275
|
|
Posted: Wed Oct 09, 2013 1:33 am |
|
|
Flat is standard flat. There's decouple capacitors on power supply and some resistor 100ohm on display's signal. I use this configuration from 2010 without any problem.
I write on display every 100ms and, before write string of characters, I send "light" inizialization. Every 30 seconds I inizalize completly display. I can't change display hardware now. I can reproduce problem I pulling down to gnd RS signal for a short time. I'm trying to solve problem by software. |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah
Joined: 11 Mar 2010 Posts: 19384
|
|
Posted: Wed Oct 09, 2013 1:53 am |
|
|
If it is a MOSFET latch-up, you can't. Once they transition into this behaviour, _only_ removing the supply will clear it.
Remember you could (for instance) add a pass-through plug with protection on it, but changing the cable should be 'do-able' without having to change PCB's etc., which is why I suggested this.
You might want to work out what has induced the problem now?. Something new introducing noise?.
Best Wishes |
|
![](templates/subSilver/images/spacer.gif) |
Fabri
Joined: 22 Aug 2005 Posts: 275
|
|
Posted: Wed Oct 09, 2013 12:30 pm |
|
|
Last year I did a new PCB release thinking to use one line of flat as analog input. Actually I don't use this line and it is closed to GND on display side but Hi impedence on main board side. I did again Burst test and display latch-up. I solve problem pulling to gnd main board side of analog input line flat.
Thanks Ttelmah to help me to solve problem.
Regards,
Fabri |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah
Joined: 11 Mar 2010 Posts: 19384
|
|
Posted: Thu Oct 10, 2013 12:39 am |
|
|
It is always interesting how a piece of wire acting as an aerial can give the most unexpected results!....
Glad you have found it.
Best Wishes |
|
![](templates/subSilver/images/spacer.gif) |
|