Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; ---- main
- ORG 0x0000
- CALL Init
- LoopDeLoop
- ; ---- loop with 1
- BSF PORTD, 0 ; set D0
- CALL ResTimerTenMs ; reset & init timer
- BSF T1CON, 0 ; start timer
- LoopHurr
- BTFSS PIR1, 0 ; wait for interruptflag
- GOTO LoopHurr
- ; ---- loop with 0
- BCF PORTD, 0 ; clear D0
- CALL ResTimerTenMs ; reset & init timer
- BSF T1CON, 0 ; start timer
- LoopDurr
- BTFSS PIR1, 0 ; wait for interruptflag
- GOTO LoopDurr
- GOTO LoopDeLoop ; go to start
- ; --- timer init and reset subroutine
- ResTimerTenMs
- BCF T1CON, 0 ; stop timer
- BCF PIR1, 0 ; reset interruptflag
- MOVWF 0xD8 ; set timer to 0xFFFF-D'10000'
- MOVLW TMR1H
- MOVWF 0xEF
- MOVLW TMR1L
- RETURN
- ; --- Initialization subroutine
- Init
- BANKSEL TRISD
- MOVLW B'11111110'
- MOVWF TRISD
- BANKSEL T1CON
- ;MOVLW B'00000000'
- ;MOVWF T1CON
- RETURN
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement