I've made codes of different sequences of lights but somehow this one does not work when I remove the PICkit 3, as long as the PICkit is on the circuit works.
I am supplying my circuit with a 5V-3A power supply and I am using a PIC16F877A
When I press a button situated in RC0, the following sequence of lights happens:
DEFINE OSC 4
TRISC=%00000001
TRISD=%00000000
START:
PORTC=0
PORTD=0
IF PORTC.0=1 THEN
PORTD=%11111111
PAUSE 4000
PORTD=%00000000
PAUSE 500
PORTD=%11111111
PAUSE 500
PORTD=%00000000
PAUSE 500
PORTD=%11111111
PAUSE 500
PORTD=%00000000
PAUSE 500
PORTD=%11111111
PAUSE 500
PORTD=%00000000
PAUSE 500
PORTD=%11111111
PAUSE 500
PORTD=%00000000
PAUSE 500
PORTD=%00000011
PAUSE 500
PORTD=%00000000
PAUSE 500
PORTD=%00001100
PAUSE 500
PORTD=%00000000
PAUSE 500
PORTD=%00110000
PAUSE 500
PORTD=%00000000
PAUSE 500
PORTD=%11000000
PAUSE 500
PORTD=%00000000
PAUSE 500
PORTD=%01010101
PAUSE 500
PORTD=%00000000
PAUSE 500
PORTD=%01010101
PAUSE 500
PORTD=%00000000
PAUSE 500
PORTD=%00110011
PAUSE 500
PORTD=%00000000
PAUSE 500
PORTD=%00110011
PAUSE 500
PORTD=%00000000
PAUSE 500
PORTD=%00110011
PAUSE 500
PORTD=%00000000
PAUSE 500
PORTD=%11000111
PAUSE 500
PORTD=%00000000
PAUSE 500
PORTD=%01010101
PAUSE 100
PORTD=%00000000
PAUSE 100
PORTD=%01010101
PAUSE 100
PORTD=%00000000
PAUSE 100
PORTD=%01010101
PAUSE 100
PORTD=%00000000
PAUSE 100
PORTD=%01010101
PAUSE 100
PORTD=%00000000
PAUSE 100
PORTD=%01010101
PAUSE 100
PORTD=%00000000
PAUSE 100
PORTD=%01010101
PAUSE 100
PORTD=%00000000
PAUSE 100
PORTD=%01010101
PAUSE 100
PORTD=%00000000
PAUSE 100
PORTD=%01010101
PAUSE 100
PORTD=%00000000
PAUSE 100
ENDIF
GOTO START
END
Here is the schematic of the circuit:
I have already uploaded other sequences into the PIC and they work just fine with the external power supply, I am not really sure why this one does not work without the PICkit 3