Whenever I turn on my desk lamp, my board crashes. Sometimes I get garbage out of the serial port, sometimes it resets.
I tried adding some extra bypass capacitors on my breadboard, but that made no difference.
(My desk lamp uses a 20W, 12V halogen bulb. It has a transformer in the base)
Can anyone offer suggestions as to why this might happen and how I can stop it?
Here are two of the boards - they were USB dongles, but are both now powered from a single wall-wart via a 3.3V voltage regulator.
Watching on a scope, when I flick the light switch I see a spike on both 3V3 and wall wart lines.
Edit:
Here are traces of the input and output of the 3V3 regulator when turning the light on and off respectively.
5V is on the top, 3V3 on the bottom
The regulator is a ZSR330.
Edit:
Some careful reading of the datasheet threw this up:
The RESET_N pin is sensitive to noise and can cause unintended reset of the chip. For a long reset line add an external RC filter with values 1 nF and 2.7 kΩ close to the RESET_N pin.
My programming cable connects a long wire via a breadboard to the reset pin. I suspect that this was the problem.