diff options
author | Christian Pointner <equinox@mur.at> | 2011-05-02 17:07:07 +0000 |
---|---|---|
committer | Christian Pointner <equinox@mur.at> | 2011-05-02 17:07:07 +0000 |
commit | aed709114c29f7395d8bf17049301ddc61811eb6 (patch) | |
tree | 8302d692a7c99b7eaf0a931f251cdefef4ecc92e /software/ttx/ttx.asm | |
parent | added inital ttx code (diff) |
ttx: use external 32,768 kHz clock for timer
git-svn-id: https://svn.spreadspace.org/mur.sat@4 7de4ea59-55d0-425e-a1af-a3118ea81d4c
Diffstat (limited to 'software/ttx/ttx.asm')
-rw-r--r-- | software/ttx/ttx.asm | 39 |
1 files changed, 16 insertions, 23 deletions
diff --git a/software/ttx/ttx.asm b/software/ttx/ttx.asm index 316ce46..a3a38ee 100644 --- a/software/ttx/ttx.asm +++ b/software/ttx/ttx.asm @@ -37,9 +37,6 @@ ;; ------------------------------------- ;; DEFINES -CNT0 EQU H'0008' -CNT1 EQU H'0009' - ;; ------------------------------------- ;; OFFSET org 0 @@ -47,34 +44,30 @@ CNT1 EQU H'0009' ;; ------------------------------------- ;; INIT init - bsf CMCON0,NOT_COUTEN + ;; bsf CMCON0,NOT_COUTEN bcf CMCON0,CMPON - movlw b'11000110' + movlw b'11110110' option - movlw b'11111011' + movlw b'11111110' tris GPIO - bcf GPIO,GP2 - + bsf GPIO,GP0 + ;; ------------------------------------- ;; MAINLOOP main - movlw .255 - movwf CNT0 - -outer - movlw .255 - movwf CNT1 - -inner - decfsz CNT1,f - goto inner - - decfsz CNT0,f - goto outer + movf TMR0,w + btfss STATUS,Z + goto main + + bcf GPIO,GP0 - movlw b'00000100' - xorwf GPIO,f +waitfor0 + movf TMR0,w + btfsc STATUS,Z + goto waitfor0 + bsf GPIO,GP0 + goto main ;; ------------------------------------- |