summaryrefslogtreecommitdiff
path: root/software/ihu/ihu.asm
diff options
context:
space:
mode:
authorChristian Pointner <equinox@mur.at>2011-11-08 18:29:12 +0000
committerChristian Pointner <equinox@mur.at>2011-11-08 18:29:12 +0000
commit4d744d2a68b23de7f98e843f57bf764ec7901c45 (patch)
treeb3d2584d3e564c8b757f1377f502636ad5f4cd4c /software/ihu/ihu.asm
parentunabsichtlich eingechecked (diff)
incoming dtmf commands
git-svn-id: https://svn.spreadspace.org/mur.sat@183 7de4ea59-55d0-425e-a1af-a3118ea81d4c
Diffstat (limited to 'software/ihu/ihu.asm')
-rw-r--r--software/ihu/ihu.asm75
1 files changed, 74 insertions, 1 deletions
diff --git a/software/ihu/ihu.asm b/software/ihu/ihu.asm
index 0a8e907..72ecc32 100644
--- a/software/ihu/ihu.asm
+++ b/software/ihu/ihu.asm
@@ -94,6 +94,7 @@ WAIT_CNT EQU H'002F'
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'
BUF EQU H'0040'
BUF_END EQU H'004F'
@@ -153,8 +154,22 @@ int_dtmf
movwf FSR
movf PORTD,w
andlw b'00001111'
+ xorwf DTMF_CS,f
call dtmfSign
movwf INDF
+ incf DTMF_BUF_PTR,f
+ movlw DTMF_BUF_END
+ subwf DTMF_BUF_PTR,w
+ btfss STATUS,C
+ goto int_dtmf_end
+ btfsc STATUS,Z
+ goto int_dtmf_end
+
+;; DTMF command complete
+ movlw .1
+ movwf TMP
+
+int_dtmf_end
bcf INTCON,INTF
goto interrupt_end
@@ -233,7 +248,8 @@ init
bcf PORTD,DTMF_PWRDWN
movlw DTMF_BUF
movwf DTMF_BUF_PTR
-
+ clrf DTMF_CS
+
bcf PORTD,TTX_RESET ;reset TTX
bcf PORTD,TTX_SCL
bcf PORTD,TTX_SDA
@@ -296,7 +312,64 @@ main
btfsc STATUS,Z
goto main
+ movf DTMF_BUF,w
+ movwf TXREG
+ movlw .1
+ call wait_ms
+
+ movf DTMF_BUF+1,w
+ movwf TXREG
+ movlw .1
+ call wait_ms
+
+ movf DTMF_BUF+2,w
+ movwf TXREG
+ movlw .1
+ call wait_ms
+
+ movf DTMF_BUF+3,w
+ movwf TXREG
+ movlw .1
+ call wait_ms
+
+ movf DTMF_BUF+4,w
+ movwf TXREG
+ movlw .1
+ call wait_ms
+
+ movlw ' '
+ movwf TXREG
+ movlw .1
+ call wait_ms
+
+ movf DTMF_CS,f
+ btfsc STATUS,Z
+ movlw '!'
+ btfss STATUS,Z
+ movlw 'x'
+ movwf TXREG
+ movlw .1
+ call wait_ms
+
+
+ movlw '\r'
+ movwf TXREG
+ movlw .1
+ call wait_ms
+ movlw '\n'
+ movwf TXREG
+ movlw .1
+ call wait_ms
+
+
+ clrf TMP
+ movlw DTMF_BUF
+ movwf DTMF_BUF_PTR
+ clrf DTMF_CS
+
goto main
+
+
movlw BUF
movwf FSR