I am setting 2 outputs high (n milliseconds apart)
Problem is that when I look at them with my logic analyzer, the
distance between them going high isn't always what I've coded.
My configuration is:
Compiling with WinAVR
ATMega8
External clock (8Mhz crystal)
My Fuses are set correctly
-------------------------------
I've modified the makefile to have:
F_CPU = 8000000
-------------------------------
C Source:
#include <avr\io.h>
#include <avr\delay.h>
int main(void)
{
//set port c as all output
DDRC = 0xff;
PORTC = 0x20;
_delay_ms(37);
PORTC |= 0x10;
}
At 30 ms the timing is correct. Anything above or below 30ms, the
timing moves in the right direction but not in correct proportion.
Maybe it's my [PC based] logic analyzer.
Thanks for your suggestions.Message
Delay issue
2008-09-05 by englsprogeny
Attachments
- No local attachments were found for this message.