comparison src/hwos.asm @ 614:a32212cd5ea9

work on new battery menu
author heinrichsweikamp
date Wed, 30 Jan 2019 21:46:42 +0100
parents 6dd6b37da7c8
children 7b3903536213
comparison
equal deleted inserted replaced
613:8077ee960199 614:a32212cd5ea9
1 ;============================================================================= 1 ;=============================================================================
2 ; 2 ;
3 ; File hwos.asm V2.98f 3 ; File hwos.asm V2.99g
4 ; 4 ;
5 ; Definition of the hwOS dive computer platform. 5 ; Definition of the hwOS dive computer platform.
6 ; 6 ;
7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved. 7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved.
8 ;============================================================================= 8 ;=============================================================================
121 movlw b'10011011' ; 1= input, RJ4 -> vusb_in, RJ5 -> power_sw2, RJ6 -> CLK_MS5541, RJ7 -> MISO_MS5541 121 movlw b'10011011' ; 1= input, RJ4 -> vusb_in, RJ5 -> power_sw2, RJ6 -> CLK_MS5541, RJ7 -> MISO_MS5541
122 movwf TRISJ 122 movwf TRISJ
123 movlw b'00100000' ; init port 123 movlw b'00100000' ; init port
124 movwf PORTJ 124 movwf PORTJ
125 125
126 ; disable charger by default
127 bsf charge_disable
126 128
127 ; Timer 0 129 ; Timer 0
128 movlw b'00000001' ; timer0 with 1:4 prescaler 130 movlw b'00000001' ; timer0 with 1:4 prescaler
129 movwf T0CON 131 movwf T0CON
130 132
153 movwf EECON2 155 movwf EECON2
154 movlw 0xAA 156 movlw 0xAA
155 movwf EECON2 157 movwf EECON2
156 bcf RTCCFG,RTCWREN ; Lock sequence for RTCWREN 158 bcf RTCCFG,RTCWREN ; Lock sequence for RTCWREN
157 banksel common 159 banksel common
158 160
159 ; A/D Converter 161 ; A/D Converter
160 movlw b'00011000' ; power off ADC, select AN6 162 movlw b'00011000' ; power off ADC, select AN6
161 movwf ADCON0 163 movwf ADCON0
162 movlw b'00100000' ; 2.048V Vref+ 164 movlw b'00100000' ; 2.048V Vref+
163 movwf ADCON1 165 movwf ADCON1
164 movlw b'10001101' ; right aligned 166 movlw b'10001101' ; right aligned
165 movwf ADCON2 167 movwf ADCON2
166
167 168
168 ; init serial port1 (TRISC6/7) 169 ; init serial port1 (TRISC6/7)
169 movlw b'00001000' ; BRG16=1 170 movlw b'00001000' ; BRG16=1
170 movwf BAUDCON1 171 movwf BAUDCON1
171 movlw .34 ; SPBRGH:SPBRG = .34 : 114285 BAUD @ 16MHz (+0.79% Error to 115200 BAUD) 172 movlw .34 ; SPBRGH:SPBRG = .34 : 114285 BAUD @ 16MHz (+0.79% Error to 115200 BAUD)