dirknerkle wrote:I'm thinking that in your implementation with TIMER1, the electrical ZC can easily be in a completely different phase than the TIMER1 counter, and that's why it's not working. If TIMER1 were initially synced to the electrical ZC so they coincided, I'd think it would likely work. Just my .03 (inflation...)
Oh, I guess I forgot to mention. I am no longer using timer 1 to create the delays. I am using Phil's idea for counting the Zero Crosses(or timer1 overflows for DC). So, in theory, timer1 should still be getting synced to the AC line immediately before it enter the mainloop.
Is it possible that the zc pulse from the H11aa1 is long enough that it could span multiple calls to the Interrupt? If so that would mean the way I have it I am increasing my counter multiple times for each cross. I can't seem to find the information on the length of the pulse on the interwebs.
I'm looking at a ZC here and my scope.. 8.36ms between pulses which calculates out right,
and the pulse itself looks like about 400us
dirknerkle wrote:I'm looking at a ZC here and my scope.. 8.36ms between pulses which calculates out right,
and the pulse itself looks like about 400us
Thanks. That might be my problem then. If my calculations are right, the Interrupt gets called about every 33 us.
And I just remembered, Phil has a note that they are 30us pulses.
At least I know where the problem is now.
