The shoebox dimmer (http://www.dovesystems.com/BuildPage.php?page=shoebox)
is 18f452 based. It's similar to what you propose. Four channels are
dimmed using the capture/compare register (in compare mode). At zero
cross, all triacs are turned off unless a channel is on full. The timer is
reset. The brightest channel is determined and its timer click number is
put in the compare register. When the compare register generates an
interrupt, that output plus any output whose click count is within 256
counts of the current count are turned on. This provision keeps us from
missing channels where the brightnesses are nearly equal. This results in
a very slight interaction between channels that are nearly equal in level.
You can see it on a scope as channels are adjusted, but it cannot be seen
on the lights.
I leave the opto on for the remainder of the half cycle once it is fired
instead of hitting it with a short pulse.
In this particular product, the outputs driving the optos are active low.
The board has a header that can drive a standard quad solid state relay.
Those generally have the high side of the control input tied together
making the control inputs active low. Other than this consideration, I do
not believe it makes any difference as to whether the drive to your optos
are active high or active low.
Good luck!
Harold
Engineering - Dove Systems
{Quote hidden}> hi guys,
>
> I'm integrating light dimmer into my project. I wanted to ask you if
> there is any difference (active low/high) how to control optoisolator in
> front of triac?
>
> My current algo is (using active HIGH):
>
> * detect zero-cross in INTF.
> * on zero-cross, turn off optoisolator led.
> * after zero-cross, in timer interrupt, turn optoisolator led back on
> during 10ms (50hz AC). this fires triac.
>
> When I fire triac after 9ms (low light) then there is some annoying lamp
> flickering goin on. What could cause this??
>
> Yet another question - is it better to drive optoisolator with single
> pulse (say 10us) instead of holding it high until next zero-cross?
>
> thanks!
>
> _______________________________________________
>
http://www.piclist.com
> View/change your membership options at
>
http://mailman.mit.edu/mailman/listinfo/piclist
>
--
FCC Rules Online at http://www.hallikainen.com
_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist