AVR only runs when connected to ISP
Try adding one or more bypass capacitors to your atmega. And maybe every other IC.

Clocked logic ICs (like a microcontroller) don't use power continuously, they draw very high currents in very brief pulses, usually once for every clock tick. Combined with parasitic capacitance and (especially) parasitic inductance in the power supply traces, these current peaks can cause the voltage at the microcontroller to sag to unacceptable levels. Additionally, these current peaks can cause significant noise on the power supply traces which can disturb other chips as well.

Adding a small capacitor as close as you can to the logic IC helps satisfy these currents, bypassing the power supply (hence the name bypass capacitor), and decoupling these current peaks from other parts of your circuit (hence the alternative name decoupling capacitor).

Getting the correct value of bypass cap(s) is fairly complicated and hard to do right, but for low-medium frequency circuits, the value isn't too critical, and a 100nF ceramic usually gives acceptable results. To be sure, you could try a 100nF ceramic in parallel with a 10µF electrolytic, right next to the atmega.

As your other chips are also digital chips (clocked by shifting in data from the atmega, I assume?), they might also benefit from bypass caps. Especially if they are sinking or sourcing current.

If this doesn't help, try determining if the atmega starts at all or if it resets, by having its start-up routine pulsing a led for say, 100ms. When switching currents, it can be easy to generate EMI that is picked up somewhere in your circuit, causing your atmega to trip and reset. 

You mention driving electromagnets, which are inductors. Stopping a current through an inductor can cause large voltage spikes that you have to deal with properly, e.g. using flyback diodes or some other sort of snubber.