Shoot-through current spikes will be large as both high-side and low-side devices are on simultaneously for a few microseconds or more on every transistion.You need to switch diagonally opposite devices together, not same-side devices together. You need to allow dead-time between switching one path off and the opposite path on.You can have separate drive to all 4 devices and arrange the software to provide deadtime. This is more flexible too.Two of your MOSFET symbols are upside down.
The problem with shoot-through is due to the extremely low on-resistances of power MOSFETs and the substantial time it takes to charge/discharge the gate capacitance with a weak drive (1k resistor here).12 volts across two 40 milliohm MOSFETs pulls 150A if its available. Typical symptoms are the 12V raildecoupling capacitors and the MOSFETs getting very hot and lots more power drain than you expected.However if you are not doing any PWM the transient spikes only happen on reversing/starting/stopping,which won't be as disastrous.
Gate drive is wrong.You need to find a diagram that drives the bottom-left fet and the top-right fet with one NPN transistor, and the bottom-right and top-left with another NPN transistor.Only then will you be able to code some dead-time between switching.Leo..
Its easier to build H-bridges using the chips purpose-designed for the job of course - one chip can drive all 4 MOSFETs of an H-bridge, enforce deadtime, provide bootstrapped gate drive, detect under voltage, etc etc.
No, because the gate of Q4 has to go HIGH when the gate of Q1 goes LOW.Could try the drive transistor between the gates of Q1 and Q4.Q5 emitter to gate Q1, Q5 collector to gate Q4.220ohm resistor from Q5 emitter to ground, 390ohm resistor from collector Q5 to 12volt.Usual 1k base resistor.Same for the other side (Q6).This will only work if the N-channel fets are logic level (not the IRF640).Maybe better to use a dedicated gate driver chip, with buildin protections.Designing a mosfet H-bridge is not a beginner's job.Leo..