diff options
Diffstat (limited to 'software/ttx')
-rw-r--r-- | software/ttx/ttx.asm | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/software/ttx/ttx.asm b/software/ttx/ttx.asm index a3a38ee..caaef8c 100644 --- a/software/ttx/ttx.asm +++ b/software/ttx/ttx.asm @@ -36,7 +36,9 @@ ;; ------------------------------------- ;; DEFINES - +BEACON_INT EQU .60 ; send a beacon every 60 seconds +SECCNT EQU H'0008' + ;; ------------------------------------- ;; OFFSET org 0 @@ -44,13 +46,15 @@ ;; ------------------------------------- ;; INIT init - ;; bsf CMCON0,NOT_COUTEN bcf CMCON0,CMPON movlw b'11110110' option movlw b'11111110' tris GPIO bsf GPIO,GP0 + clrf TMR0 + movlw BEACON_INT + movwf SECCNT ;; ------------------------------------- ;; MAINLOOP @@ -58,16 +62,23 @@ main movf TMR0,w btfss STATUS,Z goto main - - bcf GPIO,GP0 + ;; this gets called every second + decfsz SECCNT,f + goto waitfor0 + movlw BEACON_INT + movwf SECCNT + + ;; this gets called every BEACON_INT seconds + movlw b'00000001' + xorwf GPIO,f + + ;; is the timer above zero? waitfor0 movf TMR0,w btfsc STATUS,Z goto waitfor0 - bsf GPIO,GP0 - goto main ;; ------------------------------------- |