doubt regarding Interrupt function (PIC16 f Mplab x8 )

Status
Not open for further replies.

thannara123

Advanced Member level 5
Joined
Jan 7, 2010
Messages
1,601
Helped
122
Reputation
244
Reaction score
116
Trophy points
1,353
Activity points
10,611
I have two interrupt fucntion one for generation of PWM signal for sinewave generation and the other is for (pwm) generating signal to battery charger .
Whenevr the supply is available the Battery charger PWM interrupt function should work and the sinewave geration pwm must be turnerd off and viceversa.

I am using only one CCP Pin for the both funtion How to manage it ,Can i use software logic [A condiotins if()] for each function to run


void interrupt timer_isr()
{
if(TMR2IF==1) // first interrupt function for sinewave // Function A
{
// contents
TMR2IF = 0;
}


if() // second interrupt function for Battery charging // Function B
{


}
}

what is the technique to run only one of the function as said above .
Here the TIMER2 MODULE is using for the two operations ie , the function A and B .
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…