[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-chat] Short duration pulses with AtMega16
From: |
Andreas Stemmer |
Subject: |
Re: [avr-chat] Short duration pulses with AtMega16 |
Date: |
Tue, 27 Nov 2007 15:32:48 +0100 |
Shashank Chintalagiri wrote:
> I'm trying to get a 2 microsecond pulse with an ATMega16 running at 8
> MHz. When using Timer0, with un-prescaled clock in CTC mode, I'm
> getting somewhat strange results. With OC0=0x10 I'm getting pulses of
> about 7usec, and with OC0=0x04 _also_ I'm getting pulses of about the
> same durations (7 usec). Can anyone tell me what the problem could be?
At 8 MHz, every instruction takes 0.125 usec, that's 16 instructions in
2 usec! Seems like your interrupts occur before the handling of the old
one was completed as it is just not enough time for the processor.
AS