homeymoore
New Member
i finally got my pic lighting up LEDs, but now i cant get a delay working. i tried using lots of methods, this one is from a program that generates delay loops (pic delay loop calculator).
Code:
list P=16F84A
#include "p16f84A.inc"
__CONFIG _CP_OFF & _WDT_OFF & _PWRTE_OFF & _HS_OSC
errorlevel -302
CounterA equ 0x0C
CounterB equ 0x0D
CounterC equ 0x0E
bsf STATUS,RP0
movlw b'00000000'
movwf TRISB
bcf STATUS,RP0
Main
movlw b'10111111'
movwf PORTB
call Delay
movlw b'01000000'
movwf PORTB
call Delay
goto Main
Delay
movlw D'26'
movwf CounterC
movlw D'119'
movwf CounterB
movlw D'85'
movwf CounterA
loop decfsz CounterA,1
goto loop
decfsz CounterB,1
goto loop
decfsz CounterC,1
goto loop
return
end