Input capture interrupt

General discussion on mikroC for dsPIC30/33 and PIC24.
Post Reply
Author
Message
eeeboy
Posts: 4
Joined: 05 Feb 2010 07:30

Input capture interrupt

#1 Post by eeeboy » 05 Feb 2010 08:03

Hi,
I'm doing the project about motor control. I need to read the number of pulses from the encoder. I try to use Input capture to get the pulse. I put the output from the decoder into the input capture pin (I'm using pic30f6010 with 8 input capture channels). I setup the interrupt at every capture event (at rising edge). But it keeps making interrupt even there is no pulse coming. I setup the input capture 5 and the timer 3 as below:
//Input capture 5---------------
IC5CON=0x0000;
IC5CON=0x001A;
IFS1bits.IC5IF=0;
IEC1bits.IC5IE=1;

//Timer 3-----------
TMR3 = 0;
T3CONbits.TCS =0;
T3CONbits.TCKPS =0;
T3CONbits.TSIDL =0;
T3CONbits.TON =1;

Anyone has faced this problem before?
Thank you.

Post Reply

Return to “mikroC for dsPIC30/33 and PIC24 General”