USB and battery power
Distinguish programming connections from portable power.
Build or compare
Use a data-capable USB cable to transfer a program. For portable use, follow the board and battery-holder instructions.
Test the result
If the program runs on USB but fails on battery, test the board by itself and inspect the holder connection.