View previous topic :: View next topic |
Author |
Message |
Fabri
Joined: 22 Aug 2005 Posts: 275
|
LCD and lost initialization |
Posted: Tue Feb 28, 2012 9:19 am |
|
|
Dear All,
How I can check if LCD 16x2 lost it's initialization ?
I don't want init it every time I write in.
Thanks for suggestion, |
|
|
Humberto
Joined: 08 Sep 2003 Posts: 1215 Location: Buenos Aires, La Reina del Plata
|
|
Posted: Tue Feb 28, 2012 12:12 pm |
|
|
You can watch BF (busy flag) after the initialization end. Remember that BF cannot be checked before the instruction function set.
At power up, the LCD controller make its internal reset and then we start the initializaton procedure in order to setup our hardware in a well known working state.
As long as you keep the LCD powered, it should keep its state. If you are using cheap LCD devices, you would need an extra time (>15ms) to enable it to init properly.
Quote: |
I don't want init it every time I write in.
|
I do not know what do you mean. LCD_init() is only need once in your code.
Humberto |
|
|
rubenskc
Joined: 28 Sep 2011 Posts: 12
|
That's correct |
Posted: Tue Feb 28, 2012 1:54 pm |
|
|
In my case, a JHD162A (16x2) needs 21ms.... the standard 10-15ms was the cause of my problems - for 3 long days lol ! _________________ Rubs |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9221 Location: Greensville,Ontario
|
|
Posted: Tue Feb 28, 2012 6:09 pm |
|
|
As you've found out, the hard way, there is no such thinga s a 'standard'!
That's why it's really,really important to read those dreary datasheets, page by page, instead of just skimming over them and 'thinking' the part is 'standard'...
you're not alone !! |
|
|
gpsmikey
Joined: 16 Nov 2010 Posts: 588 Location: Kirkland, WA
|
|
Posted: Tue Feb 28, 2012 7:24 pm |
|
|
Also important to understand that "Typical" means just that - use the Max listed (or in a non-critical timing application, even more). As soon as you use the "typical" value, you will find higher than expected failure rates in boards you design. (cheap parts are notorious for being either on the edge or even over the edge of the specs). Murphy watches over these things very carefully :-)
mikey _________________ mikey
-- you can't have too many gadgets or too much disk space !
old engineering saying: 1+1 = 3 for sufficiently large values of 1 or small values of 3 |
|
|
Fabri
Joined: 22 Aug 2005 Posts: 275
|
|
Posted: Wed Feb 29, 2012 1:08 am |
|
|
Thanks for reply,
I know I need to init display just one time in the application but sometimes, after external noise, the lcd reset by iself and lost inizalization. To solve the problem I init lcd every one minute to avoid lost lcd for a long time. I'm thinking to check display more often and control it status.
Can I read inizialization location and verify it ? |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19498
|
|
Posted: Wed Feb 29, 2012 3:40 am |
|
|
Generally I don't think you can.
However the initialisation being lost would normally only happen if the display has actually suffered a brownout, or with massive interference on the data connection. In which case other stuff (like the display RAM contents), will have also been lost. I'd suggest you really need to look carefully at the environment, and correct the fundamental problem first....
Then though, if you want to check that the display hasn't lost things, keep a record of what has been written to one cell (say the top left corner location), and read this. If what is there does not agree with what you have sent, assume the configuration has been lost, and re-initialise.
On many displays there is more DDRAM, than the display size, so you could potentially write a 'known' value like 0xAA to a byte 'off screen', and use this as a marker for 'display OK'.
Best Wishes |
|
|
|