Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;****************************************************************
- list p=16F628, r=dec, w=-302
- include <P16F628.INC>
- __config _LVP_OFF & _BOREN_OFF & _PWRTE_ON & _WDT_OFF & _FOSC_INTOSCIO
- ;****************************************************************
- cblock 0x70
- COUNT1
- COUNT2
- COUNT3
- endc
- ;****************************************************************
- org 0x00
- goto init
- org 0x0100
- ;****************************************************************
- init
- clrf PORTA ;clear PORTA output latch
- clrf PORTB ;clear PORTB output latch
- movlw 0x07 ;Turn comparators OFF and enable pins for I/O
- movwf CMCON
- banksel TRISA ;bank 1
- clrf TRISA
- clrf TRISB
- banksel PORTA ;bank 0
- ;****************************************************************
- bsf STATUS,C ;set carry bit
- rlf PORTB,F ;shift left
- movlw 4 ;786mS delay
- call DelayVar
- goto $-3 ;loop forever
- ;****************************************************************
- DelayMain movlw 256
- movwf COUNT1
- movwf COUNT2
- decfsz COUNT1,F
- goto $-1
- decfsz COUNT2,F
- goto $-3
- return
- DelayVar movwf COUNT3
- call DELAY
- decfsz COUNT3,F
- goto $-2
- return
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement