I want to control a H-bridge using an ATMega2560. The goal is to produce output with +-18V for driving a Merklin H0 digital train set.
Given the voltage and current needed for the trains it is crucial that the H-bridge never ever goes into a shortcut state. And since software is always buggy I don't want to rely on the ATMega to switch the pins correctly. Instead I want to add some hardware between the ATMega and the H-bridge that does the following:
- turn the H-bridge off on illegal inputs
- when transitioning from one state to another ensure that the H-bridge first gets an off signal before an on signal for the opposite switch.
I have a lot of 74HTCxx chips around so I can implement logic functions with them.
My question now is: How do I make the H-bridge foolproof? How do I ensure the off-before-on transition for the output signals? Can I use gate switch times to delay on signals sufficiently? Or do I need a clock signal and flip-flops to implement discrete transitions from one state to another?