Output Compare Pin as External Interrup

Status
Not open for further replies.

faysal_002299

New Member
Hello all,

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]

thanks in advance
 
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:

So we goto page 48 and look for the bits to enable interrupt for them in one of the IECx registers.

Its Bits 4 and 3 of "IEC1" for OC4 and OC3

Now we can go to page 44 for priority information:
"TABLE 5-1: INTERRUPT VECTOR TABLE"

Hope that helps
 
Last edited:
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.

thanks in advance
 
not sure if this help but on page 47 "5.7 External Interrupt Requests" should show you some info.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…