On Feb 24, 2006, at 9:46 PM, kishor lalu bande wrote:
> i have written following programm
> for delay why it is not working.
> my clock speed is 4Mz and and want use it for LCD display delays
>
> void waitMS(unsigned long ulMS)
> {
> CLI(); // disable all interrupts
> ulTick = ulMS;
> SEI(); // re-enable interrupts
> while (ulTick>0);
> }
You don't show the definition of ulTick. It must be volatile.
As for timing I/O to LCD's, don't. Poll the LCD for its busy bit,
while using a timer (such as your ulTick) to prevent an infinite loop
if the LCD does not respond.
--
David Kelly N4HHE, dkelly@HiWAAY.net
========================================================================
Whom computers would destroy, they must first drive mad.Message
Re: [AVR-Chat] Help needed on ATMEGA128 AND TIMER0
2006-02-25 by David Kelly
Attachments
- No local attachments were found for this message.