summaryrefslogtreecommitdiff
path: root/software
diff options
context:
space:
mode:
authorChristian Pointner <equinox@mur.at>2011-05-02 17:24:04 +0000
committerChristian Pointner <equinox@mur.at>2011-05-02 17:24:04 +0000
commit8b4317140cd45a4c155ef83325664fc8e55cedf6 (patch)
tree4b090d338a260db751b88f5586f2a3b95fa52412 /software
parentttx: use external 32,768 kHz clock for timer (diff)
ttx: beacon interval
git-svn-id: https://svn.spreadspace.org/mur.sat@5 7de4ea59-55d0-425e-a1af-a3118ea81d4c
Diffstat (limited to 'software')
-rw-r--r--software/ttx/ttx.asm23
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
;; -------------------------------------