CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

LCD and lost initialization

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Fabri



Joined: 22 Aug 2005
Posts: 275

View user's profile Send private message

LCD and lost initialization
PostPosted: Tue Feb 28, 2012 9:19 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Feb 28, 2012 12:12 pm     Reply with quote

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

View user's profile Send private message

That's correct
PostPosted: Tue Feb 28, 2012 1:54 pm     Reply with quote

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: 9245
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Tue Feb 28, 2012 6:09 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Feb 28, 2012 7:24 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Feb 29, 2012 1:08 am     Reply with quote

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: 19549

View user's profile Send private message

PostPosted: Wed Feb 29, 2012 3:40 am     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group