Help discovering why my ATMEGA328P based project died

I've been designed my own PCB's with the ATMEGA328P for a while, and recently my bike light project ended in tears :frowning:

I made a PCB which has a switch input, two MOSFET 12V LED outputs (front and rear) and a 12V input. The 12V is stepped down to 3.3V.

The MOSFET outputs connect to standard waterproof LED strips. When turned on, the rear output is pulsed - 100ms on, 100ms off - and the front output is always on. There are two on modes, full power, or 50% power where the front and rear outputs switch a digitalWrite for an analogWrite(x, 100).

This is the schematic (very rough as I only made it to designed the board), and the PCB itself:


PCB front and back

On my way to work this morning, the lights were happily flashing away, and then just suddenly stopped. I disconnected the battery and continued on my way. When I got a chance to check out what happened, there was no discernible damage to the components, so no burn marks.

Once I got back to my bench, I hooked up an FTDI adapter to the serial header, and it would just keep sending null characters, along with occasional garbage to the serial console. I tried every baud rate, even though I know the board is setup to use 115200. Choosing lower baud rates just slowed the rate of incoming garbage. I tested the voltage regulator and it was outputting a constant 3.3V as expected.

Shorting the 'switch' connector would cause the garbage to stop, which implies that the interrupt routine is still running. I tried uploading a sketch, but my programmer cannot talk to it (says out of sync, I tested the programmer on another board and it works fine).

The garbage appeared to be a crystal issue, so I replaced the crystal and the caps; still nothing. I reflowed every component and tested their values, and everything appears correct. When I replaced the crystal, it would output less garbage, but still nothing readable.

The only odd thing that I noticed was that measuring from switch to ground had a resistance of 5-6 kΩ.

The board was conformal coated with ambersil acrylic conformal coating, and was in a waterproof container. There was no noticeable sign of water ingress on the PCB or connectors. The pot is dividing the voltage correctly.

Here is a picture of the board with the frankenstein repair attempt:

Does anyone have any idea what could have happened? Its easy enough to solder up a replacement, but I don't want to have to do this every 3 months if I've made a fundamental mistake with the design.