I have a simple sketch running on a BE Leonardo-compatible board.
It reads input from a potentiometer, and outputs to two RGB LEDs which change colour over time - in a different pattern if certain inputs are received.
Other than that, the only code is serial I/O for debug purposes. (It's disabled using a #define in the running version, to prevent serial buffer overflow when not connected.)
When the board is powered by USB, everything works.
When the board is powered by 9V battery, after about 4 minutes it hangs - the LEDs go off, and the L13 light on the board starts glowing at varying strength. (There is nothing connected to pin 13.) Even the reset button doesn't work.
If the board is then connected to the computer's USB port, after a few seconds the hang clears and the program resumes.
Can anyone offer a possible explanation for (and solution to) this fault?