I hope I'm mistaken, but I recall that the older mega's lacked the "pin change" interrupt capability. This has a register where you enable interrupts for a change in state on a given pin. Look at the PCICR register explanation for the mega168. I don't think the mega16 has that. --- In AVR-Chat@yahoogroups.com, "Brian" <blue_eagle74@...> wrote: > > I have asked this on the codevision site also but wondering if anyone here could help. > > I am using a mega16 Int 0 with an encoder, no sleep, WDT or other special items. > For each detent of the encoder the input to the int 0 goes from 5 - 0.5 - 5 - > 0.5 and so on, like it is designed to do. I have set the MCUCR to 0x01 for any > change, but it only responds to a negative change, so I only get an interrupt > every 2 detents of the encoder, 5 to 0.5 change. Other than this the whole > program works. I have even tried another chip. I have even tried disabling > intrupts upon entering the intrupt and enabling it with exiting. > > Why am I only getting a negative change interrupt? > Is there anything that would interfer with the MCUCR to change the level change > interrupt settings to only negative change? > > If someone could help off forum would be great! (my code is kinda messy since I > am a biginner) > > Brian >
Message
Re: int 0 problem
2009-03-30 by stevech11
Attachments
- No local attachments were found for this message.