Mercurial > public > hwos_code
comparison src/hwos.asm @ 448:aadfe9f2edaf
work on new battery options
author | heinrichsweikamp |
---|---|
date | Tue, 30 Aug 2016 17:26:21 +0200 |
parents | c64ffeeb86e5 |
children | 2c58631d5229 |
comparison
equal
deleted
inserted
replaced
447:f2a1d535347f | 448:aadfe9f2edaf |
---|---|
65 movlw b'00000010' ; ANSEL, AN17 -> Analog input | 65 movlw b'00000010' ; ANSEL, AN17 -> Analog input |
66 movwf ANCON2 | 66 movwf ANCON2 |
67 | 67 |
68 banksel common | 68 banksel common |
69 | 69 |
70 movlw b'00000000' ; 1= Input -> Data TFT_high | 70 ; movlw b'00000000' ; 1= Input -> Data TFT_high |
71 movwf TRISA | 71 clrf TRISA |
72 movlw b'00000000' ; Init port | 72 ; movlw b'00000000' ; Init port |
73 movwf PORTA | 73 clrf PORTA |
74 | 74 |
75 movlw b'00000011' ; 1= Input, (RB0, RB1) -> Switches, RB2 -> Power_MCP, RB3 -> s8_npower, RB4 -> LED_green, RB5 -> /TFT_POWER | 75 movlw b'00000011' ; 1= Input, (RB0, RB1) -> Switches, RB2 -> Power_MCP, RB3 -> s8_npower, RB4 -> LED_green, RB5 -> /TFT_POWER |
76 movwf TRISB | 76 movwf TRISB |
77 movlw b'00101000' ; Init port | 77 movlw b'00101000' ; Init port |
78 movwf PORTB | 78 movwf PORTB |
79 | 79 |
80 movlw b'10011010' ; 1= Input, (RC0, RC1) -> SOSC, RC2 -> TFT_LED_PWM, (RC3,RC4) -> I²C, RC5 -> MOSI_MS5541, (RC6, RC7) -> UART1 | 80 movlw b'10011010' ; 1= Input, (RC0, RC1) -> SOSC, RC2 -> TFT_LED_PWM, (RC3,RC4) -> I²C, RC5 -> MOSI_MS5541, (RC6, RC7) -> UART1 |
81 movwf TRISC | 81 movwf TRISC |
82 movlw b'00000000' ; Init port | 82 ; movlw b'00000000' ; Init port |
83 movwf PORTC | 83 clrf PORTC |
84 | 84 |
85 movlw b'00100000' ; 1= Input, RD0 -> TFT_NCS, RD1 -> TFT_RS, RD2 -> TFT_NWR, RD3 -> TFT_RD, RD4 -> MOSI_Flash, RD5 -> MISO_Flash, RD6 -> CLK_Flash, RD7 -> TFT_NRESET | 85 movlw b'00100000' ; 1= Input, RD0 -> TFT_NCS, RD1 -> TFT_RS, RD2 -> TFT_NWR, RD3 -> TFT_RD, RD4 -> MOSI_Flash, RD5 -> MISO_Flash, RD6 -> CLK_Flash, RD7 -> TFT_NRESET |
86 movwf TRISD | 86 movwf TRISD |
87 movlw b'00000000' ; Init port | 87 ; movlw b'00000000' ; Init port |
88 movwf PORTD | 88 clrf PORTD |
89 | 89 |
90 movlw b'00000000' ; 1= Input, RE1 -> Power_IR, RE2 -> CS_MCP, RE3 -> LED_blue, RE4 -> power_sw1, RE5 -> Set to 1 for cR hardware | 90 ; movlw b'00000000' ; 1= Input, RE1 -> Power_IR, RE2 -> CS_MCP, RE3 -> LED_blue, RE4 -> power_sw1, RE5 -> Set to 1 for cR hardware |
91 movwf TRISE | 91 clrf TRISE |
92 movlw b'00110001' ; Init port | 92 movlw b'00110001' ; Init port |
93 movwf PORTE | 93 movwf PORTE |
94 | 94 |
95 movlw b'01111110' ; 1= Input, (RF1, RF2, RF3, RF4, RF5) -> Analog | 95 movlw b'01111110' ; 1= Input, (RF1, RF2, RF3, RF4, RF5) -> Analog |
96 movwf TRISF | 96 movwf TRISF |
97 movlw b'00000000' ; Init port | 97 ; movlw b'00000000' ; Init port |
98 movwf PORTF | 98 clrf PORTF |
99 | 99 |
100 movlw b'00001110' ; 1= Input, <7:6> not implemented, RG0 -> TX3_PIEZO_CFG, RG2 -> RX2, RG3 -> AN17_RSSI, RG4 -> SOSC_OUT, RG5 -> /RESET | 100 movlw b'00001110' ; 1= Input, <7:6> not implemented, RG0 -> TX3_PIEZO_CFG, RG2 -> RX2, RG3 -> AN17_RSSI, RG4 -> SOSC_OUT, RG5 -> /RESET |
101 movwf TRISG | 101 movwf TRISG |
102 movlw b'00000001' ; Init port | 102 movlw b'00000001' ; Init port |
103 movwf PORTG | 103 movwf PORTG |
104 | 104 |
105 movlw b'00000000' ; 1= Input -> Data TFT_low | 105 ; movlw b'00000000' ; 1= Input -> Data TFT_low |
106 movwf TRISH | 106 clrf TRISH |
107 movlw b'00000000' ; Init port | 107 ; movlw b'00000000' ; Init port |
108 movwf PORTH | 108 clrf PORTH |
109 | 109 |
110 movlw b'10011011' ; 1= Input, RJ4 -> vusb_in, RJ5 -> power_sw2, RJ6 -> CLK_MS5541, RJ7 -> MISO_MS5541 | 110 movlw b'10011011' ; 1= Input, RJ4 -> vusb_in, RJ5 -> power_sw2, RJ6 -> CLK_MS5541, RJ7 -> MISO_MS5541 |
111 movwf TRISJ | 111 movwf TRISJ |
112 movlw b'00100000' ; Init port | 112 movlw b'00100000' ; Init port |
113 movwf PORTJ | 113 movwf PORTJ |
187 | 187 |
188 ; SPI Module(s) | 188 ; SPI Module(s) |
189 ; SPI2: External Flash | 189 ; SPI2: External Flash |
190 movlw b'00110000' | 190 movlw b'00110000' |
191 movwf SSP2CON1 | 191 movwf SSP2CON1 |
192 movlw b'00000000' | 192 ; movlw b'00000000' |
193 movwf SSP2STAT | 193 clrf SSP2STAT |
194 ; ->0,25MHz Bit clock @1MHz mode (Eco) | 194 ; ->0,25MHz Bit clock @1MHz mode (Eco) |
195 ; -> 4MHz Bit clock @16MHz mode (Normal) | 195 ; -> 4MHz Bit clock @16MHz mode (Normal) |
196 ; -> 16MHz Bit clock @64MHz mode (Fastest) | 196 ; -> 16MHz Bit clock @64MHz mode (Fastest) |
197 | 197 |
198 ; MSSP1 Module: I2C Master | 198 ; MSSP1 Module: I2C Master |
199 movlw b'00101000' ; I2C Master Mode | 199 movlw b'00101000' ; I2C Master Mode |
200 movwf SSP1CON1 | 200 movwf SSP1CON1 |
201 movlw b'00000000' | 201 ; movlw b'00000000' |
202 movwf SSP1CON2 | 202 clrf SSP1CON2 |
203 movlw 0x27 | 203 movlw 0x27 |
204 movwf SSP1ADD ; 100kHz @ 16MHz Fosc | 204 movwf SSP1ADD ; 100kHz @ 16MHz Fosc |
205 | 205 |
206 ; PWM Module(s) | 206 ; PWM Module(s) |
207 ; PWM1 for LED dimming | 207 ; PWM1 for LED dimming |