Yahoo Groups archive

AVR-Chat

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

Message

delay time is not reliable

2012-08-31 by englsprogeny1

I'm doing a simple routine here.

Output goes high
output goes low for 5 ms 
output goes back to high.


Problem is that when I scope the signal it is not low for exactly 5ms.


It's 1.925 or 1.426 or 1.003ms  (approximate times)(always less than 5 ms)


Details:
ATMeg16
JTAG interface to AVR Studio 4.18
GCC coded
delay.h


I've read about this and verified that I am good with the following:

1.  I am optimized correctly in the makefile
        CPFLAGS	= -g -Os -Wall -Wstrict-prototypes-I$(AVRLIB)               -Wa,-ahlms=$(<:.c=.lst)





2.  F_CPU is set correctly
#define F_CPU          7372800

3.  Fuse Settings are set correctly (External Crystal/ Res; High Freq)
				Stertup Time 16K CK+64ms

4.  All interrupts are disabled

// disable interrupts
	cli();



Any other ideas?

Many thanks guys!

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.