;
;dummy program
list p=16F690 ; list directive to define processor
#include <p16F690.inc> ; processor specific variable definitions
errorlevel -302, -207
;define registers
WAITL equ 0x20
CNTR0 equ 0x21
CNTR1 equ 0x22
;Define the macro
;delay loop 1 to 255 msec
LOOPMS macro MSEC
movlw MSEC
movwf WAITL
call LOOP_WAIT
endm
org 0x0000
goto start
org 0x0004
start:
LOOPMS .1 ; this loads the macro with 1mSec count
nop
goto start
;usage called from macro loopms .nnn
LOOP_WAIT:
call DEL1MS
decfsz WAITL,F
goto LOOP_WAIT
return
DEL1MS: ; 1ms delay loop
movlw 0X64 ;100*10US=1MS
movwf CNTR0
DL2:
nop
nop
nop
nop
nop
nop
nop
decfsz CNTR0, F
goto DL2 ;
return
end