Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Tools
Old 13th January 2009, 12:14 PM   #1
Question Output Compare Pin as External Interrup

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
faysal_002299 is offline  
Old 13th January 2009, 12:30 PM   #2
Default

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:
Quote:
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.
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 by AtomSoft; 13th January 2009 at 12:30 PM.
AtomSoft is online now  
Old 14th January 2009, 08:49 AM   #3
Default

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
faysal_002299 is offline  
Old 14th January 2009, 12:12 PM   #4
Default

not sure if this help but on page 47 "5.7 External Interrupt Requests" should show you some info.
AtomSoft is online now  
Reply

Tags
compare, external, interrup, output, pin

Thread Tools
Display Modes


Similar
Title Starter Forum Replies Latest
Help: external siren/output from radar detector? mnapuran Electronic Projects Design/Ideas/Reviews 5 10th March 2008 11:35 AM
CCP (compare mode) crys Robotics Chat 3 17th February 2008 12:33 PM
Using PicBasic with Output compare for sounds mduong77 Micro Controllers 7 29th March 2007 03:29 AM
compare a value to a table pouchito Micro Controllers 8 7th January 2007 02:50 PM
How to compare values? Lac Micro Controllers 7 26th January 2005 03:45 PM



All times are GMT. The time now is 12:46 AM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker