2004-08-12 05:01 AM
2004-08-10 02:40 AM
I am controling PA0 as an output.
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 Brian2004-08-10 04:36 AM
You cannot disable the external Interrupts. For each External Interrupt you have a separate vector mapped to that interrupt to service that interrupt
[ This message was edited by: Ansh on 10-08-2004 17:18 ]2004-08-10 09:22 PM
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 ]2004-08-10 09:30 PM
Please can you be more specific on which manual you are referring to.
2004-08-10 09:34 PM
Page 32 of the ST7LITE0 Manual / Data sheet
2004-08-10 09:45 PM
Actually it is better if you refer the datasheet of the device which you can find at the following url:
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 Ansh2004-08-10 10:00 PM
The data sheets states:-
''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 simple2004-08-10 11:49 PM
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.2004-08-11 12:15 AM
my code does not continue unless I use
ld A,#$AA ld EICR,A If I dont use the above my code does not seem to continue