To try and fault find i have stuck leds on my outputs porta 0 1 2. And wrote a program to light them one at a time with a 1sec delay. Even this doesnt work. One of the leds doesnt light one stays on at half brightness and the other led does what it should. Can anyone see why this program isnt working.
@ DEVICE pic16F628A, INTRC_OSC_NOCLKOUT
' System Clock Options
@ DEVICE pic16F628A, WDT_ON
' Watchdog Timer
@ DEVICE pic16F628A, PWRT_ON
' Power-On Timer
@ DEVICE pic16F628A, MCLR_OFF
' Master Clear Options (Internal)
@ DEVICE pic16F628A, BOD_ON
' Brown-Out Detect
@ DEVICE pic16F628A, LVP_OFF
' Low-Voltage Programming
@ DEVICE pic16F628A, CPD_ON
' Data Memory Code Protect
@ DEVICE pic16F628A, PROTECT_ON
' Program Code Protection
cmcon = 7
DEFINE OSC 4
TRISB= 00000000 'PORTB=OUTPUT
TRISA= 00000000 'PORTA=output
main:
PORTA.0 = 1
Pause 1000
PORTA.0 = 0
PORTA.1 = 1
Pause 1000
PORTA.1 = 0
PORTA.2 = 1
Pause 1000
PORTA.2 = 0
GoTo main
End
Bookmarks