comparison src/ms5541.asm @ 630:4cd81bdbf15c

3.08 stable release
author heinrichsweikamp
date Fri, 21 Feb 2020 10:51:36 +0100
parents c40025d8e750
children 185ba2f91f59
comparison
equal deleted inserted replaced
629:237931377539 630:4cd81bdbf15c
114 movf isr_xC+1,W ; and sum into SENS 114 movf isr_xC+1,W ; and sum into SENS
115 addwf SENS+0,F 115 addwf SENS+0,F
116 movf isr_xC+2,W 116 movf isr_xC+2,W
117 addwfc SENS+1,F 117 addwfc SENS+1,F
118 118
119 ; calculate absolute pressure = (sens * (d1-off))/2^12 + 1000 119 ; calculate absolute pressure = (sens * (d1-off))/2^12 + 1000 (For MS5541C)
120 ; calculate absolute pressure = (sens * (d1-off))/2^11 + 1000 (For MS5541C-30)
120 movf OFF+0,W ; d1-off --> a 121 movf OFF+0,W ; d1-off --> a
121 subwf D1+0,W 122 subwf D1+0,W
122 movwf isr_xA+0 123 movwf isr_xA+0
123 movf OFF+1,W 124 movf OFF+1,W
124 subwfb D1+1,W 125 subwfb D1+1,W
125 movwf isr_xA+1 126 movwf isr_xA+1
126 127
127 MOVII SENS,isr_xB ; sens --> b 128 MOVII SENS,isr_xB ; sens --> b
128 call isr_signed_mult16x16 129 call isr_signed_mult16x16
130 movlw .13
131 cpfslt C1+1 ; C1 > 3328 (Must be MS5541-30)
132 bra isr_shift_ms5541_30
133 ; MS5541
129 movlw .12-.8 ; a 12 bit shift = 1 byte + 4 bits 134 movlw .12-.8 ; a 12 bit shift = 1 byte + 4 bits
130 call isr_shift_C31 135 call isr_shift_C31
131 136 bra isr_shift_ms5541_all
137 isr_shift_ms5541_30:
138 ; MS5541-30
139 movlw .11-.8 ; a 11 bit shift = 1 byte + 3 bits
140 call isr_shift_C31
141 isr_shift_ms5541_all:
132 movlw LOW .1000 ; add 1000 142 movlw LOW .1000 ; add 1000
133 addwf isr_xC+1,F 143 addwf isr_xC+1,F
134 movlw HIGH .1000 144 movlw HIGH .1000
135 addwfc isr_xC+2,F 145 addwfc isr_xC+2,F
136 146