Hello,
I want to control the trigger angle of a triac connected to AC power (60Hz). My guess is that I can do it by changing the duty cycle of a 120Hz pwm generated by the PIC.
I have a zero crossing detector circuit that generates a pulse on every semicycle start, but I can't figure how am I supposed to synchronize it with the pwm. Since I can't generate exactly 120Hz (closest I got was 122Hz), I have to reset (restart) the PWM period everytime I receive the zerocrossing pulse, but I don't really get how to do it.. Any help would be appreciated.
I'm using PIC18f4550 with XC8 compiler on MPLAB IDE.
Thanks!
I want to control the trigger angle of a triac connected to AC power (60Hz). My guess is that I can do it by changing the duty cycle of a 120Hz pwm generated by the PIC.
I have a zero crossing detector circuit that generates a pulse on every semicycle start, but I can't figure how am I supposed to synchronize it with the pwm. Since I can't generate exactly 120Hz (closest I got was 122Hz), I have to reset (restart) the PWM period everytime I receive the zerocrossing pulse, but I don't really get how to do it.. Any help would be appreciated.
I'm using PIC18f4550 with XC8 compiler on MPLAB IDE.
Thanks!