I have an Atmega4809 (Arduino Nano Every) connected via UART (Rx,Tx,5V,GND) to a BLDC controller. Then I have connected a little display (Rx,Tx without GND.)
When it is connected everything works fine. When I follow the connection, disconnection steps, nothing gets damaged.
The BLDC controller and display are connected to a DC source of 42V and GND separately
When I disconnect the BLDC controller and reconnect it, it gives a spark because the capacitors are charging. The display remains attached.
When this happens it destroys my Atmega4809. It gets very hot and it is irreparably damaged.
Could it be that some current flows through from the BLDC Controller to the Atmega4809 to the fisplay to GND and not over the connector when it sparks?
Can this fixed by an electrical circuit or component?