Hi!
I want to build a pic controlled dimmer. I need to sinhronize pic microcontroller to AC power line. I measure the period with timer1 in the external interrupt subrutine. The problem is that the bulb still blinging sometimes. How to eliminate this?
Thanks
I have thought about this a few months ago. I did not solve it yet, but I do have an idea.
I plan to use a PIC with PWM hardware, and I would trigger an interrupt at (just after) each zero crossing and reset the PWM counter. I have not looked into this deeply, so it may generate glitches.
The crystal frequency I chose for this is 1M8432, to allow for the prescaler to bring the period down to an 8 bit value. Happy coding.