I learn a lot from my own mistakes and the mistakes of others LOL.
This forum has probably the best people who pass on thier own experiences and skills.
I am still a noob in so many respects.
Disconnecting the motor while the chip is powered will instantly destroy the chip. Make sure that the connections are cleanly soldered, and don't change wiring while powered up.
Also, breadboards should never be used for motor connections, as the high current will burn the tracks, leading to the same problem.
So, I should always disconnect the 5v chip connection first then, right?
Do not do that while uploading code.
While up loading your I/O pins change state, this could have caused the controller H-Bridge to turn ALL MOSFETs fully ON and fault currents to flow through the control chip.
When you disconnect, disconnect the positive of the supply.
Use a switch, not two bits of wire twisted together.
DO NOT switch or modify your circuit while uploading.
Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
This is exacly how my connections are minus capacitor. I don't have a capacitor. But the 24v power supply is of high quality.