View previous topic :: View next topic |
Author |
Message |
Calamar
Joined: 07 Sep 2003 Posts: 60 Location: Buenos Aires (Argentina)
|
implementing a lcd "watch dog" ?? |
Posted: Tue Aug 30, 2005 11:01 am |
|
|
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) |
|
![](templates/subSilver/images/spacer.gif) |
kender
Joined: 09 Aug 2004 Posts: 768 Location: Silicon Valley
|
$0.02 |
Posted: Tue Aug 30, 2005 12:19 pm |
|
|
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. |
|
![](templates/subSilver/images/spacer.gif) |
Calamar
Joined: 07 Sep 2003 Posts: 60 Location: Buenos Aires (Argentina)
|
Re: $0.02 |
Posted: Tue Aug 30, 2005 1:42 pm |
|
|
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) |
|
![](templates/subSilver/images/spacer.gif) |
kender
Joined: 09 Aug 2004 Posts: 768 Location: Silicon Valley
|
Re: $0.02 |
Posted: Tue Aug 30, 2005 1:52 pm |
|
|
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 ? |
|
![](templates/subSilver/images/spacer.gif) |
newguy
Joined: 24 Jun 2004 Posts: 1903
|
|
![](templates/subSilver/images/spacer.gif) |
|