diff options
-rw-r--r-- | software/ihu/ihu.asm | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/software/ihu/ihu.asm b/software/ihu/ihu.asm index d8bf6d5..6c33b5c 100644 --- a/software/ihu/ihu.asm +++ b/software/ihu/ihu.asm @@ -8,10 +8,10 @@ ;; ESC im Labor and realraum. ;; ;; Please visit the project hompage at sat.mur.at for further information. - ;; + ;; ;; ;; Copyright (C) 2011 Christian Pointner <equinox@mur.at> - ;; + ;; ;; This file is part of mur.sat. ;; ;; mur.sat is free software: you can redistribute it and/or modify @@ -34,11 +34,11 @@ include "p16f887.inc" __config _CONFIG1, _DEBUG_OFF & _LVP_OFF & _FCMEN_OFF & _IESO_OFF & _BOR_NSLEEP & _CPD_OFF & _CP_OFF & _MCLRE_OFF & _PWRTE_ON & _WDT_OFF & _XT_OSC __config _CONFIG2, _BOR21V & _WRT_OFF - + ;; ------------------------------------- ;; DEFINES ;; constants - + ;; I/O Pins ;; PortA #define SOLAR_C0 PORTA,0 @@ -101,7 +101,7 @@ RTC_TOD0 EQU H'003A' RTC_TOD1 EQU H'003B' RTC_TOD2 EQU H'003C' RTC_TOD3 EQU H'003D' - + BUF EQU H'0040' BUF_END EQU H'004F' @@ -129,7 +129,7 @@ SOL_CALC_7 EQU H'0063' SOL_CALC_8 EQU H'0064' SOL_CALC_9 EQU H'0065' SOL_CALC_CNT EQU H'0066' - + ;; variables ;; page 2 only CALC_ACC0 EQU H'0110' @@ -140,8 +140,8 @@ CALC_TEMP0 EQU H'0114' CALC_TEMP1 EQU H'0115' CALC_TEMP2 EQU H'0116' CALC_TEMP3 EQU H'0117' - - + + ;; all pages I2C_BYTE EQU H'0070' I2C_BIT_CNT EQU H'0071' @@ -149,12 +149,12 @@ OWIRE_BYTE EQU H'0072' OWIRE_BIT_CNT EQU H'0073' OWIRE_CNT EQU H'0074' -FSR_TEMP EQU H'007D' +FSR_TEMP EQU H'007D' W_TEMP EQU H'007E' STATUS_TEMP EQU H'007F' - ;; bits - + ;; bits + ;; ------------------------------------- ;; Reset Vector org 0 @@ -169,7 +169,7 @@ STATUS_TEMP EQU H'007F' movwf STATUS_TEMP movf FSR,w movwf FSR_TEMP - + bcf STATUS,RP0 bcf STATUS,RP1 @@ -201,7 +201,7 @@ int_dtmf ;; DTMF command complete movlw .1 movwf TMP - + int_dtmf_end bcf T1CON,TMR1ON clrf TMR1L @@ -230,7 +230,7 @@ int_rtc btfsc RTC_RST call rtc_init goto int_rtc_end - + int_rtc_end bcf INTCON,RBIF goto interrupt_end @@ -243,7 +243,7 @@ int_uart_rx btfss RCSTA,OERR goto int_uart_rx_oe goto interrupt_end - + int_uart_rx_oe bcf RCSTA,CREN bsf RCSTA,CREN @@ -271,7 +271,7 @@ init movwf ANSEL movlw b'00000111' movwf ANSELH - + ;; bank 1 bsf STATUS,RP0 bcf STATUS,RP1 @@ -303,9 +303,9 @@ init movlw b'00100001' movwf PIE1 clrf PIE2 - + ;; bank 0 - bcf STATUS,RP0 + bcf STATUS,RP0 bcf STATUS,RP1 movlw b'01000001' movwf ADCON0 @@ -313,9 +313,9 @@ init movwf RCSTA movlw B'01011000' movwf INTCON - + clrf PORTB - + bcf DTMF_PWRDWN movlw DTMF_BUF movwf DTMF_BUF_PTR @@ -329,7 +329,7 @@ init bcf TTX_SDA nop bcf TTX_RESET ;reset TTX - clrf TMR0 + clrf TMR0 bsf INTCON,GIE clrf TMP @@ -340,7 +340,7 @@ init ;; ------------------------------------- ;; TABLES include "tables.inc" - + ;; ------------------------------------- ;; SUBROUTINES wait_ms @@ -382,13 +382,13 @@ uart_rx_fe ;; ------------------------------------- include "temp.inc" - + ;; ------------------------------------- include "adc.inc" ;; ------------------------------------- include "solar.inc" - + ;; ------------------------------------- ;; MAINLOOP main @@ -411,7 +411,7 @@ main ;; xorlw .0 ;; btfss STATUS,Z ;; goto main_error - + ;; movlw 'O' ;; movwf TXREG ;; movlw .1 @@ -429,7 +429,7 @@ main ;; movlw .1 ;; call wait_ms ;; goto main - + ;; main_error ;; movlw 'E' ;; movwf TXREG @@ -450,7 +450,7 @@ main ;; movlw '\n' ;; movwf TXREG ;; movlw .1 -;; call wait_ms +;; call wait_ms ;; goto main ;; -------------------- @@ -519,7 +519,7 @@ main ;; call wait_ms ;; movf SOL_POWERL,w - ;; movwf TXREG + ;; movwf TXREG ;; movlw .8 ;; call wait_ms @@ -596,11 +596,11 @@ main movlw DTMF_BUF movwf DTMF_BUF_PTR clrf DTMF_CS - + goto main ;; -------------------- - ;; RTC Test program + ;; RTC Test program ;; movf TMP,f ;; btfsc STATUS,Z ;; goto main @@ -613,7 +613,7 @@ main ;; movwf TXREG ;; movlw .1 ;; call wait_ms - + ;; movf RTC_TOD3,w ;; andlw b'00001111' ;; call digit @@ -627,7 +627,7 @@ main ;; movwf TXREG ;; movlw .1 ;; call wait_ms - + ;; movf RTC_TOD2,w ;; andlw b'00001111' ;; call digit @@ -641,7 +641,7 @@ main ;; movwf TXREG ;; movlw .1 ;; call wait_ms - + ;; movf RTC_TOD1,w ;; andlw b'00001111' ;; call digit @@ -655,7 +655,7 @@ main ;; movwf TXREG ;; movlw .1 ;; call wait_ms - + ;; movf RTC_TOD0,w ;; andlw b'00001111' ;; call digit @@ -663,22 +663,22 @@ main ;; movlw .1 ;; call wait_ms - ;; movlw '\r' + ;; movlw '\r' ;; movwf TXREG ;; movlw .1 ;; call wait_ms - ;; movlw '\n' + ;; movlw '\n' ;; movwf TXREG ;; clrf TMP ;; goto main ;; -------------------- - ;; Temp Test program + ;; Temp Test program ;; movf TMP,f ;; btfsc STATUS,Z ;; goto main - + ;; call temp_read_value ;; swapf OWIRE_BYTE,w ;; andlw b'00001111' @@ -686,24 +686,24 @@ main ;; movwf TXREG ;; movlw .1 ;; call wait_ms - + ;; movf OWIRE_BYTE,w ;; andlw b'00001111' ;; call digit ;; movwf TXREG ;; movlw .1 ;; call wait_ms - - ;; movlw '\r' + + ;; movlw '\r' ;; movwf TXREG ;; movlw .1 ;; call wait_ms - ;; movlw '\n' + ;; movlw '\n' ;; movwf TXREG - + ;; clrf TMP ;; goto main - + ;; ------------------------------------- ;; END end |