Professional Documents
Culture Documents
Deepika Calendar2018
Deepika Calendar2018
// on zero crossing detection, counts are updated for both PWM channels
ch_count[1]=ch_duty_level[1];
PWM1=0; // the output is active low
int_10ms = 1; // 10msec flag is set
}
void timer_interrupt (void) interrupt 1
// The timer 0 is used for the duty cycle adjustement of two channel PWM
{
TL0 = 0XE2; //reset timer LSB
if(--ch_count[0]==0) PWM1 = 1;
// each time the timer interrupt occur the counts are decreased by one and on
reaching zero
}