2004-02-15 11:40 PM
2004-02-13 11:09 PM
dear sir,
i am working on a Application where i am counting a pulse in st72f264 microcontroller.This pulse is coming from another device to micro i/o pin.I am considering this pulse as an External Interrupt to micro.I am managing this thro MISCR register (i mean rising edge or falling edge). I have build another application named RTC using 16 bit timer output compare interrupt.Now i want to use these two types of interrupts in the same application.It should work like this.... 1) Whenever an external interrupt(PB3/OCMP2_A) comes i will increment a register and at the sametime a real time clock should be managed thro output campare interrupt option.I could not understand how these two interrupts can be managed at the same time?Because i have to check the Pulse count register after some amount of time based on RTC register(managed by outputcompare interrupt). 2) Is it possible to use same pin as external interrupt pin and ouput compare pin pls can u explain it . help. Thanks & Regards, Arup2004-02-15 11:40 PM
1/ First of all, these two interrupts have different interrupt vector addresses so there is no issue to handle them simultanously. You have to declare your pulse count register as volatile because you are modifying it inside the external interrupt service routine.
2/ If the alternate function for the output compare pin is disabled by OCiE bit in the CR2 register you can use this pin as normal I/O pin. Please refer datasheet (Note#2 page 62/171).