From aed709114c29f7395d8bf17049301ddc61811eb6 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Mon, 2 May 2011 17:07:07 +0000 Subject: ttx: use external 32,768 kHz clock for timer git-svn-id: https://svn.spreadspace.org/mur.sat@4 7de4ea59-55d0-425e-a1af-a3118ea81d4c --- software/ttx/ttx.asm | 39 ++++++++++++++++----------------------- 1 file changed, 16 insertions(+), 23 deletions(-) (limited to 'software/ttx/ttx.asm') 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 ;; ------------------------------------- -- cgit v1.2.3