Since I am controlling 220V, I want to minimize the possibility of outputting anything but 50hz or off.
My interpretation of what you need is two PWM signals, which are synchronized. You only want to drive each one of them in the 0-50% range *snip*
I want to supply full 50hz power cycles but suppress cycles for 5 different power levels. For example, 20% power would be 5 cycles on followed by 20 cycles off and 60% would be 15 cycles on and 10 cycles off.
Consider just inverting the signal before sending to the other mosfet. Problem solved.Paul
Getting a simple 50hz output seems easy to do but I don't know if it's possible to have a second output with phase locked opposite polarity without resorting to interrupts and programming. Getting a second timer at 2hz to directly interact with the 50hz timer seems impossible and I was just hoping I could be proved wrong there.
I always feel that there will come some point when my program will get lost and 220v will go 100% and fry the coils.
If your program 'got lost' there's no guarantee that the software-controlled timer(s) would continue to work uninterrupted. Neither would timers guard against resetting the device or in a 'brown-out' condition.So, I say again:I would suggest you AC couple the drive to the mosfets to give you some hardware 'insurance' against leaving one or both on all the time.Yours, TonyWilk
It should also be protected with a fuse.