diff options
author | Christian Pointner <equinox@mur.at> | 2011-12-13 00:20:16 +0000 |
---|---|---|
committer | Christian Pointner <equinox@mur.at> | 2011-12-13 00:20:16 +0000 |
commit | b6d1f4d37d19a5364e5a60549a4035c8639224f1 (patch) | |
tree | cce11cc056aff6ddd06906120bc4740c22a0fe5f /software/ihu/ihu.asm | |
parent | - included titles for values in tracker window (diff) |
rtc_init only after rtc_rst goes high
git-svn-id: https://svn.spreadspace.org/mur.sat@224 7de4ea59-55d0-425e-a1af-a3118ea81d4c
Diffstat (limited to 'software/ihu/ihu.asm')
-rw-r--r-- | software/ihu/ihu.asm | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/software/ihu/ihu.asm b/software/ihu/ihu.asm index 716ac72..18c0db4 100644 --- a/software/ihu/ihu.asm +++ b/software/ihu/ihu.asm @@ -55,7 +55,7 @@ BAT_C EQU 3 RTC_SDA EQU 4 RTC_SCL EQU 5 RTC_INT EQU 6 -UNDEF_B7 EQU 7 +RTC_RST EQU 7 ;; PortC MPU_PWRDWN EQU 0 MPU_RESET EQU 1 @@ -162,6 +162,8 @@ STATUS_TEMP EQU H'007F' ;; dispatch interrupt sources btfsc INTCON,INTF goto int_dtmf + btfsc INTCON,RBIF + goto int_rtc btfsc PIR1,RCIF goto int_uart_rx goto interrupt_end @@ -189,7 +191,18 @@ int_dtmf int_dtmf_end bcf INTCON,INTF goto interrupt_end + + +int_rtc + btfsc PORTB,RTC_RST + call rtc_init + goto int_rtc_end +int_rtc_end + bcf INTCON,RBIF + goto interrupt_end + + int_uart_rx call uart_rx_byte btfsc PIR1,RCIF @@ -201,7 +214,8 @@ int_uart_rx int_uart_rx_oe bcf RCSTA,CREN bsf RCSTA,CREN - + + interrupt_end ;; restore context movf FSR_TEMP,w @@ -230,7 +244,7 @@ init bcf STATUS,RP1 movlw b'01110000' movwf WPUB - movlw b'01000000' + movlw b'11000000' movwf IOCB movlw b'01000001' movwf OPTION_REG @@ -264,12 +278,12 @@ init movwf ADCON0 movlw b'10010000' movwf RCSTA - movlw B'01010000' + movlw B'01011000' movwf INTCON clrf PORTB - bcf PORTD,DTMF_PWRDWN + bsf PORTD,DTMF_PWRDWN movlw DTMF_BUF movwf DTMF_BUF_PTR clrf DTMF_CS @@ -282,7 +296,6 @@ init bsf INTCON,GIE clrf TMP - call rtc_init bsf PORTD,TTX_RESET goto main @@ -335,6 +348,9 @@ uart_rx_fe ;; ------------------------------------- ;; MAINLOOP main + sleep + nop + ;; -------------------- ;; ADC Test ;; call adc_get_solar @@ -559,12 +575,7 @@ main ;; clrf TMP ;; goto main - -powerdown - sleep - nop - goto main - + ;; ------------------------------------- ;; END end |