No reason in particular, I might do that.
I simplified my code and changed the OSC to 4MHz:
Code:
program FlashingLED
main:
TRISB=%11111110
OSCCON=%1101100 'OSC 31.25
while (1)
'TESTING
PortB.0 = 1
delay_ms(500)
PortB.0 = 0
delay_ms(500)
WEnd
End.
I connect the battery and the LED flashes a few times and stays on. I then have to disconnect the battery and wait a few seconds before reconnecting, the longer I wait, the more flashes before it freezes.
I disconnected the programming wires completely this time to see if there was any effect, there wasn't.