When I toggle this pin and interupt in genertated ei0. I am using other interupts in my assembler so A. Can I disble these interupts or if not B. How do I service them, the manual is not to clear. Regards Brian
How do you service the interrupt, do you have to write to the EICR or is there a better / another way.
I am confused because the manual says:- Clearing an interrupt request is done by: – Writing “0� to the corresponding bit in the status register (Brian which status register) or – Access to the status register while the flag is set followed by a read or write of an associated register. (Brian again which registers) [ This message was edited by: BrianM on 11-08-2004 09:57 ][ This message was edited by: BrianM on 11-08-2004 10:02 ]
Actually you are confused between the peripheral interrupt and the External Interrupt. For a peripheral interrupt you have flags and Interrupt enable bit associated with that Interrupt and you have a particular sequence like the one you have mentioned below for clearing the flag. Like for example, you have the Input Capture Interrupt of Lite Timer. With this Interrupt you have the ICIE bit by which you can enable this interrupt and you have the ICF flag which shows the status. And now when you want to clear this flag a read operation to the LTICR register will clear this flag. But for External Interrupts you do not have such flags and interrupt enable bits. If you want to use an I/O as an interrupt. First of all it should be configured as pull-up Interrupt. Through the EICR register you can select the sensitivity of the Interrupt. And when the particular edge/ level occurs on that pin then the execution jumps to the ISR of that Interrupt. Now if you have a set of operations to be performed on the occurrence of a particular interrupt, it is in this ISR you can include that part of the code. I hope I have been able to answer you questions. If you still have any questions please do not hesitate to ask. Best Regards Ansh
''An external interrupt triggered on edge will be latched and the interrupt request automatically cleared upon entering the interrupt service routine.'' I am using PA bit 0 as an output and just toggling this pin. I am finding that this generates an interrupt and is not cleared. If I add the following: - .ext0_rt ld A,#$AA ld EICR,A iret Then my code works I feel I must be missing somthing simple
Once an Interrupt occurs it is not cleared. The request is cleared automatically upon entering the interrupt service routine.
The Interrupt service routine in your case is as below .ext0_rt ld A,#$AA ld EICR,A iret Without entering the ISR your interrupt request will not get cleared. You ISR could be .ext0_rt //any code whatever you want to perform// iret. You don't have to write to the EICR register to clear the Interrupt request.
That seems very surprising. Can you attach a sample of your code. Also did you check by including just simple NOP instruction in your ISR, is it working.
And by what do mean by doesn't seem to continue. Do you mean that it is juts stuck in that ISR.