pixelpunch
New Member
Just to give a little background, I am trying to flash all the leds on and off at a certain interval on port d. Each led is wired to the pic so that each pin sinks the current and a resistor controls the amount of current.
For some reason, the leds just stay on and do not flash.
Here is my code below:
Thanks
For some reason, the leds just stay on and do not flash.
Here is my code below:
Code:
; initialization stuff
list p=16f874A ; set the pic type
__config B'11111110111001' ; set configuration bits
include "p16f874A.inc"
;Using general purpose registers
cblock 0x20
temp
temp2
temp3
endc
org 0x0000
bsf STATUS,RP0 ;select bank 1
movlw 0x00
movwf TRISD
bcf STATUS,RP0 ; back to Register Page 0
Loop
call Setup
call Delay
movlw 0xFF
movwf PORTD
call Setup
call Delay
movlw 0x00
movwf PORTD
goto Loop
Setup
movlw 0xFF
movwf temp
movwf temp2
movwf temp3
return
Delay
decfsz temp, 1
goto $+2
decfsz temp2, 1
goto $+2
decfsz temp3, 1
goto Delay
return
end
Thanks