avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [avr-gcc-list] (Newbie)2.Delay function not working as required


From: Jahagirdar Gopal-AGJ005
Subject: RE: [avr-gcc-list] (Newbie)2.Delay function not working as required
Date: Thu, 8 Dec 2005 20:53:47 +0800

Hi,

The unexpected delays are basically because of some ISR running in between, Is you delay function is just a loop based or interrupt based? I think it is not interrupt based. Just try disabling interrupts just before calling the delay function and enabling after the function call. If it works better then I suggest you to write a good interrupt based delay routine. Note that the interrupt I was talking about is timer interrupt raised by internal timer of AVR.

-Gopal


From: address@hidden [mailto:address@hidden On Behalf Of Sumeet Pal Singh
Sent: Thursday, December 08, 2005 6:23 AM
To: address@hidden
Subject: [avr-gcc-list] (Newbie)2.Delay function not working as required

 

Hi
We tried to put delay in our program but it is not that reliable,
When we do
for(char i=0x00;i<100;i++)
delayms(100);

The output which we get is not 100*100ms but something unexpected. The variable i is not used anywhere else in program. Is it that the optimisation is causing problem, if yes please tell how to remive it.

Thanks
Sumeet


reply via email to

[Prev in Thread] Current Thread [Next in Thread]