diff options
author | Christian Pointner <equinox@mur.at> | 2011-07-26 22:48:14 +0000 |
---|---|---|
committer | Christian Pointner <equinox@mur.at> | 2011-07-26 22:48:14 +0000 |
commit | c78147414699f568947ac87a625861336dd84160 (patch) | |
tree | a5421c0b0cb170319eb29ff8b1efb889f5c37ac8 /software/ihu | |
parent | renamed cpu to mpu at docs (diff) |
improved pic make file
ihu sends commands to ttx now
git-svn-id: https://svn.spreadspace.org/mur.sat@62 7de4ea59-55d0-425e-a1af-a3118ea81d4c
Diffstat (limited to 'software/ihu')
-rw-r--r-- | software/ihu/ihu.asm | 86 |
1 files changed, 63 insertions, 23 deletions
diff --git a/software/ihu/ihu.asm b/software/ihu/ihu.asm index dce1fa7..5258dfc 100644 --- a/software/ihu/ihu.asm +++ b/software/ihu/ihu.asm @@ -40,25 +40,29 @@ ;; constants ;; I/O Pins -DTMF_D0 EQU 0 -DTMF_D1 EQU 1 -DTMF_D2 EQU 2 -DTMF_D3 EQU 3 -DTMF_PWRDWN EQU 4 -TTX_RESET EQU 5 -TTX_SCL EQU 6 -TTX_SDA EQU 7 +DTMF_D0 EQU 0 +DTMF_D1 EQU 1 +DTMF_D2 EQU 2 +DTMF_D3 EQU 3 +DTMF_PWRDWN EQU 4 +TTX_RESET EQU 5 +TTX_SCL EQU 6 +TTX_SDA EQU 7 ;; variables ;; page 0 only -TMP EQU H'0020' -TTX_BYTE EQU H'0021' -TTX_CNT EQU H'0022' -WAIT_CNT EQU H'0023' +TMP EQU H'0020' +TTX_BYTE EQU H'0021' +TTX_BIT_CNT EQU H'0022' +TTX_BYTE_CNT EQU H'0023' +WAIT_CNT EQU H'0024' + +BUF EQU H'0040' +BUF_END EQU H'004F' ;; all pages -W_TEMP EQU H'007E' -STATUS_TEMP EQU H'007F' +W_TEMP EQU H'007E' +STATUS_TEMP EQU H'007F' ;; bits @@ -185,13 +189,12 @@ uart_rx_fe ;; ------------------------------------- ttx_send_byte + bsf STATUS,RP0 + bcf TRISD,TTX_SDA + bcf STATUS,RP0 movwf TTX_BYTE - bsf PORTD,TTX_SCL - movlw .3 - bcf PORTD,TTX_SCL - call wait_ms movlw .8 - movwf TTX_CNT + movwf TTX_BIT_CNT ttx_next_bit btfsc TTX_BYTE,7 bsf PORTD,TTX_SDA @@ -207,11 +210,46 @@ ttx_next_bit nop nop rlf TTX_BYTE,f - decfsz TTX_CNT,f + decfsz TTX_BIT_CNT,f goto ttx_next_bit - bcf PORTD,TTX_SDA + bsf STATUS,RP0 + bsf TRISD,TTX_SDA + bcf STATUS,RP0 return + + ;; ------------------------------------- +ttx_send_frame + movwf TTX_BYTE + andlw b'00001111' + movwf TTX_BYTE_CNT + bsf PORTD,TTX_SCL + movlw .3 + bcf PORTD,TTX_SCL + call wait_ms + + movf TTX_BYTE,w + call ttx_send_byte + + movf TTX_BYTE_CNT,f + btfsc STATUS,Z + return + +ttx_next_byte + movlw .16 + movwf TTX_BIT_CNT +ttx_wait_octet + decfsz TTX_BIT_CNT,f + goto ttx_wait_octet + + movf INDF,w + call ttx_send_byte + + incf FSR,f + decfsz TTX_BYTE_CNT,f + goto ttx_next_byte + return + ;; ------------------------------------- ;; MAINLOOP main @@ -219,8 +257,10 @@ main btfsc STATUS,Z goto main - movf TMP,w - call ttx_send_byte + movlw BUF + movwf FSR + movlw b'00010000' + call ttx_send_frame clrf TMP goto main |