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 support@ccsinfo.com

implementing a lcd "watch dog" ??

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



Joined: 07 Sep 2003
Posts: 60
Location: Buenos Aires (Argentina)

View user's profile Send private message Send e-mail MSN Messenger

implementing a lcd "watch dog" ??
PostPosted: Tue Aug 30, 2005 11:01 am     Reply with quote

In my projects with lcd characters
modules, usualy write a character,
out of viewing pages, and them read
it to verify with the before written, if
itsn`t match so it ejecute a lcd_init()

It is efficient ??
I'm affraid about a bad code was written
in the lcd module and the program keep
ejecuting without detect it.
_________________
Best Regards
Daniel H. Sagarra
La Plata (Argentina)
kender



Joined: 09 Aug 2004
Posts: 768
Location: Silicon Valley

View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger

$0.02
PostPosted: Tue Aug 30, 2005 12:19 pm     Reply with quote

I guess, it depends on your LCD refresh rate. If the refresh rate has to be low, then you approach might be efficient. If the refresh rate is high (say, greater then 70Hz), then user will not notice a single wrong/corrupt character. Typically, when I have an LCD, I update it as often as possible - whn PIC is not busy, it's updating the LCD all the time.

It also depends on whether or not you are using an OS.
Calamar



Joined: 07 Sep 2003
Posts: 60
Location: Buenos Aires (Argentina)

View user's profile Send private message Send e-mail MSN Messenger

Re: $0.02
PostPosted: Tue Aug 30, 2005 1:42 pm     Reply with quote

kender wrote:
I guess, it depends on your LCD refresh rate. If the refresh rate has to be low, then you approach might be efficient. If the refresh rate is high (say, greater then 70Hz), then user will not notice a single wrong/corrupt character. Typically, when I have an LCD, I update it as often as possible - whn PIC is not busy, it's updating the LCD all the time.

It also depends on whether or not you are using an OS.



I did the next:
unplug the lcd module with the microcontroler ON
then plug the lcd module, every with MC ON,
so the code MC keep writting code to lcd but garbage characters
and the only way to back to normaly was with
a lcd_init();
_________________
Best Regards
Daniel H. Sagarra
La Plata (Argentina)
kender



Joined: 09 Aug 2004
Posts: 768
Location: Silicon Valley

View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger

Re: $0.02
PostPosted: Tue Aug 30, 2005 1:52 pm     Reply with quote

Calamar wrote:
unplug the lcd module with the microcontroler ON
then plug the lcd module, every with MC ON,
so the code MC keep writting code to lcd but garbage characters
and the only way to back to normaly was with
a lcd_init();


Unfortunately, I don't know what type of LCD module or chip you are using. But ususualy, when all of the characters you are sending are garbage, the receiving baud rate of the LCD doesn't match the sending baud rate of the PIC.

The following is just a hypothesis. When you unplug the LCD, it powers down and it's volatile memory is lost. When you plug it back, it powers up, and initializes itself to some default baud rate, which doesn't match the PIC's baud rate. When you call your lcd_init(); you might be synchronizing the baud rates.

Could you post the lcd_init() code ?
newguy



Joined: 24 Jun 2004
Posts: 1903

View user's profile Send private message

PostPosted: Tue Aug 30, 2005 3:01 pm     Reply with quote

http://www.ccsinfo.com/forum/viewtopic.php?t=19288&highlight=lcd+timeout+init

Look for the posts by C-H Wu and djpark. They have great ideas on how to reinitialize an lcd module and how to not "hang" if one is not present.
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