I am using dsPIC30F3011 mcu for my project. Now I want the Output Compare pins (eg. OC3 and OC4) to work just like an external interrupt (like INT1, INT2). And the OC ISR will act like INT ISR and respond in negative or positive edge. How can I do that? It would be great if you please provide some Code samples for initialization and ISR of OC.
[Actually I have used all the provided external interrupts but I need some more and the only option I have is, to use the OC3 and OC4 pins as normal external interrupt as per the pre-built circuit board I am working with. I also have already used all the input capture pins]
Check Page 43 and 48 of datasheet. I never used this chip or anything close to it really. This hopefully will help tho.
On page 43:
IEC0<15:0>, IEC1<15:0>, IEC2<15:0>
All interrupt enable control bits are maintained in
these three registers. These control bits are used
to individually enable interrupts from the
peripherals or external signals.
IPC0<15:0>... IPC11<7:0>
The user-assignable priority level associated with
each of these interrupts is held centrally in these
twelve registers.
I would like to add some more information on my problem
I am working with a circuit board designed by some other person. The only way I have before me is, to work with this pre-designed board. Now the circuit board is designed in such a way that, I have to detect two external sensors signal with pin 41 and 38 of dsPIC30F3011 which are Output Compare OC3 and OC4. And I would like to detect the positive edge in the ISR.
Please suggest me what I can do in this situation.