diff options
author | Christian Pointner <equinox@mur.at> | 2012-05-05 20:02:38 +0000 |
---|---|---|
committer | Christian Pointner <equinox@mur.at> | 2012-05-05 20:02:38 +0000 |
commit | 9a8009b77d426743bbaa8ebd6612f77d164f6b35 (patch) | |
tree | d626fa509dbb6164064de5ee513a68a23441815d | |
parent | cleanup for exhibition plots (diff) |
added simple timeout for DTMF decoder
git-svn-id: https://svn.spreadspace.org/mur.sat@397 7de4ea59-55d0-425e-a1af-a3118ea81d4c
-rw-r--r-- | software/ihu/ihu.asm | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/software/ihu/ihu.asm b/software/ihu/ihu.asm index 452c0d1..487d8e0 100644 --- a/software/ihu/ihu.asm +++ b/software/ihu/ihu.asm @@ -95,7 +95,8 @@ DTMF_BUF EQU H'0030' ; 5Bytes for incoming DTMF commands DTMF_BUF_END EQU H'0034' DTMF_BUF_PTR EQU H'0035' DTMF_CS EQU H'0036' - +DTMF_TIMEOUT EQU H'0037' + RTC_TOD0 EQU H'003A' RTC_TOD1 EQU H'003B' RTC_TOD2 EQU H'003C' @@ -179,6 +180,8 @@ STATUS_TEMP EQU H'007F' goto int_rtc btfsc PIR1,RCIF goto int_uart_rx + btfsc PIR1,TMR1IF + goto int_tmr1 goto interrupt_end int_dtmf movf DTMF_BUF_PTR,w @@ -200,9 +203,28 @@ int_dtmf movwf TMP int_dtmf_end + bcf T1CON,TMR1ON + clrf TMR1L + clrf TMR1H + movlw .6 + movwf DTMF_TIMEOUT + bsf T1CON,TMR1ON bcf INTCON,INTF goto interrupt_end +int_tmr1 + decfsz DTMF_TIMEOUT,f + goto int_tmr1_end + bsf PORTD,DTMF_PWRDWN + bcf T1CON,TMR1ON + movlw DTMF_BUF + movwf DTMF_BUF_PTR + clrf DTMF_CS + bcf PORTD,DTMF_PWRDWN + +int_tmr1_end + bcf PIR1,TMR1IF + goto interrupt_end int_rtc btfsc PORTB,RTC_RST @@ -278,7 +300,7 @@ init movlw .12 movwf SPBRG clrf SPBRGH - movlw b'00100000' + movlw b'00100001' movwf PIE1 clrf PIE2 @@ -298,7 +320,11 @@ init movlw DTMF_BUF movwf DTMF_BUF_PTR clrf DTMF_CS - + clrf TMR1L + clrf TMR1H + movlw b'00110000' + movwf T1CON + bcf PORTD,TTX_SCL bcf PORTD,TTX_SDA nop |