On Sep 29, 2005, at 9:29 PM, Aaron wrote: > On a mega48, I am trying to generate a external interrupt in the > software by writing: > sbi EIFR, INTF0 ; simulate a step in test mode by setting INT0 > flag (step input) > > But this doesn't seem to work -- neither in the simulator nor on real > hardware. > > I am 99% sure INT0 is set up properly because the interrupt vector > executes if a falling edge is applied to the pin. > > Is my method of generating an external interrupt in software valid, or > am I missing something? On the AVR one *writes* a 1 to the flag register to *clear* the flag. There is no way to set the flag without tickling the external INT0 pin. IIRC you can't write to the INT0 port pin to trigger the IRQ because the act of enabling the IRQ disables it as an output. Only way I can think to do what you ask is to wire another output port pin to your INT0 input. -- David Kelly N4HHE, dkelly@HiWAAY.net ======================================================================== Whom computers would destroy, they must first drive mad.
Message
Re: [AVR-Chat] generating external interrup in SW
2005-09-30 by David Kelly
Attachments
- No local attachments were found for this message.