Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Delay issue

2008-09-05 by englsprogeny

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.

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.