>> So I have this Mega32 running at 4 MHz (yes, 4 MHz, I checked the fuses) >> >> I'm trying to measure two pulse widths, on INT0 and INT1 using T1 with >> a divisor of 1. >> The pulses have a minimum period of 5uS, nominal period of 14uS, and >> max of 23uS. >> I can't adjust those values. >> >> I enable INT0 for a rising edge int. >> When the int happens, I zero T1, and exit the ISR. >> When the int happens again, I read T1 and store it. >> >> Then I disable INT0, enable INT1, and do the same thing for the pulse >> on that input. >> >> >> My problem is that the system seems to be running much slower than I >> would expect. >> The interrupt latency is measuring out more than 5uS! >> >> I don't have any other ints enabled, other than a very simple T0 ISR >> (see previous post) >> >> There's no point where I have ints disabled, at least not in the code >> that I wrote. >> >> Do I really have to run the machine faster than this? >> I wouldn't expect to have to in Asm.. >> >> >> >> >> -- >> >> "The very powerful and the very stupid have one thing in common. Instead >> of >> altering their views to fit the facts, they alter the facts to fit their >> views... which can be very uncomfortable if you happen to be one of the >> facts that needs altering." Doctor Who, Face of Evil >> > > Well, interrupts are disabled inside ISRs! > > Jim Wagner > > > > There is a current thread on AVRFreaks that sounds VERY similar to your problems: Interrupt problem (timer1 timing + 'interference') http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=75366 Jim
Message
Re: [AVR-Chat] Speed of execution
2009-02-24 by wagnerj@proaxis.com
Attachments
- No local attachments were found for this message.