annotate src/ostc3.asm @ 0:11d4fc797f74

init
author heinrichsweikamp
date Wed, 24 Apr 2013 19:22:45 +0200
parents
children e4e662746c02
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
heinrichsweikamp
parents:
diff changeset
1 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2 ;
heinrichsweikamp
parents:
diff changeset
3 ; File ostc3.asm
heinrichsweikamp
parents:
diff changeset
4 ;
heinrichsweikamp
parents:
diff changeset
5 ; Definition of the ostc3 dive computer platform.
heinrichsweikamp
parents:
diff changeset
6 ;
heinrichsweikamp
parents:
diff changeset
7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved.
heinrichsweikamp
parents:
diff changeset
8 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
9 ; HISTORY
heinrichsweikamp
parents:
diff changeset
10 ; 2011-05-24 : [jDG] Cleanups from initial Matthias code.
heinrichsweikamp
parents:
diff changeset
11 ; 2011-06-24 : [MH] Added clock speeds.
heinrichsweikamp
parents:
diff changeset
12 #include "ostc3.inc"
heinrichsweikamp
parents:
diff changeset
13
heinrichsweikamp
parents:
diff changeset
14 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
15 ;
heinrichsweikamp
parents:
diff changeset
16 ;----------------------------- CONFIG ---------------------------------
heinrichsweikamp
parents:
diff changeset
17 ; CONFIG RETEN = OFF ;Disabled - Controlled by SRETEN bit
heinrichsweikamp
parents:
diff changeset
18 ; CONFIG SOSCSEL = HIGH ;High Power SOSC circuit selected
heinrichsweikamp
parents:
diff changeset
19 ; CONFIG XINST = OFF ;Code won't excute in extended mode...
heinrichsweikamp
parents:
diff changeset
20 ; CONFIG FOSC = INTIO2 ;Internal RC oscillator, no clock-out
heinrichsweikamp
parents:
diff changeset
21 ; CONFIG PLLCFG = OFF
heinrichsweikamp
parents:
diff changeset
22 ; CONFIG IESO = OFF ;Disabled
heinrichsweikamp
parents:
diff changeset
23 ; CONFIG PWRTEN = OFF ;Disabled, because incompatible with ICD3 (Ri-400)
heinrichsweikamp
parents:
diff changeset
24 ; CONFIG BOREN = ON ;Controlled with SBOREN bit
heinrichsweikamp
parents:
diff changeset
25 ; CONFIG BORV = 2 ;2.0V
heinrichsweikamp
parents:
diff changeset
26 ; CONFIG BORPWR = MEDIUM ;BORMV set to medium power level
heinrichsweikamp
parents:
diff changeset
27 ; CONFIG WDTEN = ON ;WDT controlled by SWDTEN bit setting
heinrichsweikamp
parents:
diff changeset
28 ; CONFIG WDTPS = 128 ;1:128
heinrichsweikamp
parents:
diff changeset
29 ; CONFIG RTCOSC = SOSCREF ;RTCC uses SOSC
heinrichsweikamp
parents:
diff changeset
30 ; CONFIG MCLRE = ON ;MCLR Enabled, RG5 Disabled
heinrichsweikamp
parents:
diff changeset
31 ; CONFIG CCP2MX = PORTBE ;RE7-Microcontroller Mode/RB3-All other modes
heinrichsweikamp
parents:
diff changeset
32 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
33 boot CODE
heinrichsweikamp
parents:
diff changeset
34 global init_ostc3
heinrichsweikamp
parents:
diff changeset
35
heinrichsweikamp
parents:
diff changeset
36 init_ostc3:
heinrichsweikamp
parents:
diff changeset
37 banksel common ; Bank1
heinrichsweikamp
parents:
diff changeset
38 ;init oscillator
heinrichsweikamp
parents:
diff changeset
39 movlw b'01110010'
heinrichsweikamp
parents:
diff changeset
40 movwf OSCCON ; 16MHz INTOSC
heinrichsweikamp
parents:
diff changeset
41 movlw b'00001000'
heinrichsweikamp
parents:
diff changeset
42 movwf OSCCON2 ; Secondary Oscillator running
heinrichsweikamp
parents:
diff changeset
43 movlw b'00000000'
heinrichsweikamp
parents:
diff changeset
44 movwf OSCTUNE ; 4x PLL Disable (Bit6) - only works with 8 or 16MHz (=32 or 64MHz)
heinrichsweikamp
parents:
diff changeset
45 bcf RCON,SBOREN ; Bown-Out off
heinrichsweikamp
parents:
diff changeset
46 bcf RCON,IPEN ; Priority Interrupts off
heinrichsweikamp
parents:
diff changeset
47
heinrichsweikamp
parents:
diff changeset
48 ; I/O Ports
heinrichsweikamp
parents:
diff changeset
49 banksel 0xF16 ; Addresses, F16h through F5Fh, are also used by SFRs, but are not part of the Access RAM.
heinrichsweikamp
parents:
diff changeset
50
heinrichsweikamp
parents:
diff changeset
51 clrf REFOCON ; No reference oscillator active on REFO pin
heinrichsweikamp
parents:
diff changeset
52 clrf ODCON1 ; Disable Open Drain capability
heinrichsweikamp
parents:
diff changeset
53 clrf ODCON2 ; Disable Open Drain capability
heinrichsweikamp
parents:
diff changeset
54 clrf ODCON3 ; Disable Open Drain capability
heinrichsweikamp
parents:
diff changeset
55
heinrichsweikamp
parents:
diff changeset
56 movlw b'11000000' ; ANSEL, AN7 and AN6 -> Analog inputs, PORTA is digital.
heinrichsweikamp
parents:
diff changeset
57 movwf ANCON0
heinrichsweikamp
parents:
diff changeset
58 movlw b'00000000' ; ANSEL
heinrichsweikamp
parents:
diff changeset
59 movwf ANCON1
heinrichsweikamp
parents:
diff changeset
60 movlw b'00000010' ; ANSEL, AN17 -> Analog input
heinrichsweikamp
parents:
diff changeset
61 movwf ANCON2
heinrichsweikamp
parents:
diff changeset
62
heinrichsweikamp
parents:
diff changeset
63 banksel common
heinrichsweikamp
parents:
diff changeset
64
heinrichsweikamp
parents:
diff changeset
65 movlw b'00000000' ; 1= Input -> Data TFT_high
heinrichsweikamp
parents:
diff changeset
66 movwf TRISA
heinrichsweikamp
parents:
diff changeset
67 movlw b'00000000' ; Init port
heinrichsweikamp
parents:
diff changeset
68 movwf PORTA
heinrichsweikamp
parents:
diff changeset
69
heinrichsweikamp
parents:
diff changeset
70 movlw b'00001011' ; 1= Input, (RB0, RB1) -> Switches, RB2 -> Power_MCP, RB3 -> lf_data, RB4 -> LED_green, RB5 -> /TFT_POWER
heinrichsweikamp
parents:
diff changeset
71 movwf TRISB
heinrichsweikamp
parents:
diff changeset
72 movlw b'00100000' ; Init port
heinrichsweikamp
parents:
diff changeset
73 movwf PORTB
heinrichsweikamp
parents:
diff changeset
74
heinrichsweikamp
parents:
diff changeset
75 movlw b'10011010' ; 1= Input, (RC0, RC1) -> SOSC, RC2 -> TFT_LED_PWM, (RC3,RC4) -> I²C, RC5 -> MOSI_MS5541, (RC6, RC7) -> UART1
heinrichsweikamp
parents:
diff changeset
76 movwf TRISC
heinrichsweikamp
parents:
diff changeset
77 movlw b'00000000' ; Init port
heinrichsweikamp
parents:
diff changeset
78 movwf PORTC
heinrichsweikamp
parents:
diff changeset
79
heinrichsweikamp
parents:
diff changeset
80 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
heinrichsweikamp
parents:
diff changeset
81 movwf TRISD
heinrichsweikamp
parents:
diff changeset
82 movlw b'00000000' ; Init port
heinrichsweikamp
parents:
diff changeset
83 movwf PORTD
heinrichsweikamp
parents:
diff changeset
84
heinrichsweikamp
parents:
diff changeset
85 movlw b'00000000' ; 1= Input, RE1 -> Power_IR, RE2 -> CS_MCP, RE3 -> LED_blue, RE4 -> power_sw1,
heinrichsweikamp
parents:
diff changeset
86 movwf TRISE
heinrichsweikamp
parents:
diff changeset
87 movlw b'00010000' ; Init port
heinrichsweikamp
parents:
diff changeset
88 movwf PORTE
heinrichsweikamp
parents:
diff changeset
89
heinrichsweikamp
parents:
diff changeset
90 movlw b'00000110' ; 1= Input, (RF1, RF2) -> Analog
heinrichsweikamp
parents:
diff changeset
91 movwf TRISF
heinrichsweikamp
parents:
diff changeset
92 movlw b'00000000' ; Init port
heinrichsweikamp
parents:
diff changeset
93 movwf PORTF
heinrichsweikamp
parents:
diff changeset
94
heinrichsweikamp
parents:
diff changeset
95 movlw b'00001111' ; 1= Input, <7:6> not implemented, RG0 -> SCLK_MCP, RG2 -> RX2, RG3 -> AN17_RSSI, RG4 -> SOSC_OUT, RG5 -> /RESET
heinrichsweikamp
parents:
diff changeset
96 movwf TRISG
heinrichsweikamp
parents:
diff changeset
97 movlw b'00000000' ; Init port
heinrichsweikamp
parents:
diff changeset
98 movwf PORTG
heinrichsweikamp
parents:
diff changeset
99
heinrichsweikamp
parents:
diff changeset
100 movlw b'00000000' ; 1= Input -> Data TFT_low
heinrichsweikamp
parents:
diff changeset
101 movwf TRISH
heinrichsweikamp
parents:
diff changeset
102 movlw b'00000000' ; Init port
heinrichsweikamp
parents:
diff changeset
103 movwf PORTH
heinrichsweikamp
parents:
diff changeset
104
heinrichsweikamp
parents:
diff changeset
105 movlw b'10010000' ; 1= Input, RJ4 -> vusb_in, RJ5 -> power_sw2, RJ6 -> CLK_MS5541, RJ7 -> MISO_MS5541
heinrichsweikamp
parents:
diff changeset
106 movwf TRISJ
heinrichsweikamp
parents:
diff changeset
107 movlw b'00100000' ; Init port
heinrichsweikamp
parents:
diff changeset
108 movwf PORTJ
heinrichsweikamp
parents:
diff changeset
109
heinrichsweikamp
parents:
diff changeset
110
heinrichsweikamp
parents:
diff changeset
111 ; Timer 0
heinrichsweikamp
parents:
diff changeset
112 ; movlw b'00000000' ; Timer0 with 1:2 prescaler
heinrichsweikamp
parents:
diff changeset
113 movlw b'00001000' ; Timer0 with 1:1 prescaler
heinrichsweikamp
parents:
diff changeset
114 movwf T0CON
heinrichsweikamp
parents:
diff changeset
115
heinrichsweikamp
parents:
diff changeset
116 ; Timer 1 - Button hold-down timer
heinrichsweikamp
parents:
diff changeset
117 movlw b'10001100' ; 32768Hz clock source, 1:1 Prescaler -> ; 30,51757813µs/bit in TMR1L:TMR1H
heinrichsweikamp
parents:
diff changeset
118 movwf T1CON
heinrichsweikamp
parents:
diff changeset
119
heinrichsweikamp
parents:
diff changeset
120 banksel 0xF16 ; Addresses, F16h through F5Fh, are also used by SFRs, but are not part of the Access RAM.
heinrichsweikamp
parents:
diff changeset
121
heinrichsweikamp
parents:
diff changeset
122 ; RTCC
heinrichsweikamp
parents:
diff changeset
123 movlw 0x55
heinrichsweikamp
parents:
diff changeset
124 movwf EECON2
heinrichsweikamp
parents:
diff changeset
125 movlw 0xAA
heinrichsweikamp
parents:
diff changeset
126 movwf EECON2
heinrichsweikamp
parents:
diff changeset
127 bsf RTCCFG,RTCWREN ; Unlock sequence for RTCWREN
heinrichsweikamp
parents:
diff changeset
128 bsf RTCCFG,RTCPTR1
heinrichsweikamp
parents:
diff changeset
129 bsf RTCCFG,RTCPTR0
heinrichsweikamp
parents:
diff changeset
130 bsf RTCCFG,RTCEN ; Module enable
heinrichsweikamp
parents:
diff changeset
131 bsf RTCCFG,RTCOE ; Output enable
heinrichsweikamp
parents:
diff changeset
132 movlw b'00000100' ; 32768Hz SOCS on RTCC pin (PORTG,4) Bit7-5: Pullups for Port D, E and J
heinrichsweikamp
parents:
diff changeset
133 movwf PADCFG1
heinrichsweikamp
parents:
diff changeset
134 movlw b'11000100'
heinrichsweikamp
parents:
diff changeset
135 movwf ALRMCFG ; 1 second alarm
heinrichsweikamp
parents:
diff changeset
136 movlw d'1'
heinrichsweikamp
parents:
diff changeset
137 movwf ALRMRPT ; Alarm repeat counter
heinrichsweikamp
parents:
diff changeset
138 movlw 0x55
heinrichsweikamp
parents:
diff changeset
139 movwf EECON2
heinrichsweikamp
parents:
diff changeset
140 movlw 0xAA
heinrichsweikamp
parents:
diff changeset
141 movwf EECON2
heinrichsweikamp
parents:
diff changeset
142 bcf RTCCFG,RTCWREN ; Lock sequence for RTCWREN
heinrichsweikamp
parents:
diff changeset
143
heinrichsweikamp
parents:
diff changeset
144 banksel common
heinrichsweikamp
parents:
diff changeset
145 ; A/D Converter
heinrichsweikamp
parents:
diff changeset
146 movlw b'00011000' ; power off ADC, select AN6
heinrichsweikamp
parents:
diff changeset
147 movwf ADCON0
heinrichsweikamp
parents:
diff changeset
148 movlw b'00100000' ; 2.048V Vref+
heinrichsweikamp
parents:
diff changeset
149 movwf ADCON1
heinrichsweikamp
parents:
diff changeset
150 movlw b'10001101' ; Right justified
heinrichsweikamp
parents:
diff changeset
151 movwf ADCON2
heinrichsweikamp
parents:
diff changeset
152
heinrichsweikamp
parents:
diff changeset
153
heinrichsweikamp
parents:
diff changeset
154 ;init serial port1 (TRISC6/7)
heinrichsweikamp
parents:
diff changeset
155 movlw b'00001000' ; BRG16=1
heinrichsweikamp
parents:
diff changeset
156 movwf BAUDCON1
heinrichsweikamp
parents:
diff changeset
157 movlw b'00100100' ; BRGH=1, SYNC=0
heinrichsweikamp
parents:
diff changeset
158 movwf TXSTA1
heinrichsweikamp
parents:
diff changeset
159 movlw .34 ; SPBRGH:SPBRG = .34 : 114285 BAUD @ 16MHz (+0,79% Error to 115200 BAUD)
heinrichsweikamp
parents:
diff changeset
160 movwf SPBRG1 ; SPBRGH:SPBRG = .207 : 19230 BAUD @ 16MHz (-0,16% Error to 19200 BAUD)
heinrichsweikamp
parents:
diff changeset
161 clrf SPBRGH1 ;
heinrichsweikamp
parents:
diff changeset
162 movlw b'10010000'
heinrichsweikamp
parents:
diff changeset
163 movwf RCSTA1
heinrichsweikamp
parents:
diff changeset
164
heinrichsweikamp
parents:
diff changeset
165 ;init serial port2 (TRISG2)
heinrichsweikamp
parents:
diff changeset
166 banksel BAUDCON2
heinrichsweikamp
parents:
diff changeset
167 movlw b'00100000' ; BRG16=0
heinrichsweikamp
parents:
diff changeset
168 movwf BAUDCON2
heinrichsweikamp
parents:
diff changeset
169 movlw b'00100000' ; BRGH=0, SYNC=0
heinrichsweikamp
parents:
diff changeset
170 movwf TXSTA2
heinrichsweikamp
parents:
diff changeset
171 movlw .102 ; SPBRGH:SPBRG = .102 : 2403 BAUD @ 16MHz
heinrichsweikamp
parents:
diff changeset
172 movwf SPBRG2
heinrichsweikamp
parents:
diff changeset
173 clrf SPBRGH2
heinrichsweikamp
parents:
diff changeset
174 movlw b'10010000'
heinrichsweikamp
parents:
diff changeset
175 movwf RCSTA2
heinrichsweikamp
parents:
diff changeset
176 banksel common
heinrichsweikamp
parents:
diff changeset
177
heinrichsweikamp
parents:
diff changeset
178 ; Timer3 for IR-RX Timeout
heinrichsweikamp
parents:
diff changeset
179 clrf T3GCON ; Reset Timer3 Gate Control register
heinrichsweikamp
parents:
diff changeset
180 ; movlw b'10001101' ; 1:1 Prescaler -> 2seconds@32768Hz, not synced
heinrichsweikamp
parents:
diff changeset
181 movlw b'10001001' ; 1:1 Prescaler -> 2seconds@32768Hz, synced
heinrichsweikamp
parents:
diff changeset
182 ; 30,51757813µs/bit in TMR3L:TMR3H
heinrichsweikamp
parents:
diff changeset
183 movwf T3CON
heinrichsweikamp
parents:
diff changeset
184
heinrichsweikamp
parents:
diff changeset
185 ; SPI Module(s)
heinrichsweikamp
parents:
diff changeset
186 ; SPI2: External Flash
heinrichsweikamp
parents:
diff changeset
187 movlw b'00110000'
heinrichsweikamp
parents:
diff changeset
188 movwf SSP2CON1
heinrichsweikamp
parents:
diff changeset
189 movlw b'00000000'
heinrichsweikamp
parents:
diff changeset
190 movwf SSP2STAT
heinrichsweikamp
parents:
diff changeset
191 ; ->0,25MHz Bit clock @1MHz mode (Eco)
heinrichsweikamp
parents:
diff changeset
192 ; -> 4MHz Bit clock @16MHz mode (Normal)
heinrichsweikamp
parents:
diff changeset
193 ; -> 16MHz Bit clock @64MHz mode (Fastest)
heinrichsweikamp
parents:
diff changeset
194
heinrichsweikamp
parents:
diff changeset
195 ; MSSP1 Module: I2C Master
heinrichsweikamp
parents:
diff changeset
196 movlw b'00101000' ; I2C Master Mode
heinrichsweikamp
parents:
diff changeset
197 movwf SSP1CON1
heinrichsweikamp
parents:
diff changeset
198 movlw b'00000000'
heinrichsweikamp
parents:
diff changeset
199 movwf SSP1CON2
heinrichsweikamp
parents:
diff changeset
200 movlw 0x27
heinrichsweikamp
parents:
diff changeset
201 movwf SSP1ADD ; 100kHz @ 16MHz Fosc
heinrichsweikamp
parents:
diff changeset
202
heinrichsweikamp
parents:
diff changeset
203 ; PWM Module(s)
heinrichsweikamp
parents:
diff changeset
204 ; PWM1 for LED dimming
heinrichsweikamp
parents:
diff changeset
205 movlw b'00001100'
heinrichsweikamp
parents:
diff changeset
206 movwf CCP1CON
heinrichsweikamp
parents:
diff changeset
207 movlw b'00000001'
heinrichsweikamp
parents:
diff changeset
208 movwf PSTR1CON ; Pulse steering disabled
heinrichsweikamp
parents:
diff changeset
209 movlw d'255'
heinrichsweikamp
parents:
diff changeset
210 movwf PR2 ; Period
heinrichsweikamp
parents:
diff changeset
211 ; 255 is max brightness (300mW)
heinrichsweikamp
parents:
diff changeset
212 clrf CCPR1L ; Duty cycle
heinrichsweikamp
parents:
diff changeset
213 clrf CCPR1H ; Duty cycle
heinrichsweikamp
parents:
diff changeset
214 movlw T2CON_NORMAL
heinrichsweikamp
parents:
diff changeset
215 movwf T2CON
heinrichsweikamp
parents:
diff changeset
216
heinrichsweikamp
parents:
diff changeset
217 ; Timer5 for ISR-independent wait routines
heinrichsweikamp
parents:
diff changeset
218 clrf T5GCON ; Reset Timer5 Gate Control register
heinrichsweikamp
parents:
diff changeset
219 ; movlw b'10001101' ; 1:1 Prescaler -> 2seconds@32768Hz, not synced
heinrichsweikamp
parents:
diff changeset
220 movlw b'10001001' ; 1:1 Prescaler -> 2seconds@32768Hz, synced
heinrichsweikamp
parents:
diff changeset
221 ; 30,51757813µs/bit in TMR5L:TMR5H
heinrichsweikamp
parents:
diff changeset
222 movwf T5CON
heinrichsweikamp
parents:
diff changeset
223
heinrichsweikamp
parents:
diff changeset
224 ; Timer7 for 62,5ms Interrupt (Sensor states)
heinrichsweikamp
parents:
diff changeset
225 banksel 0xF16 ; Addresses, F16h through F5Fh, are also used by SFRs, but are not part of the Access RAM.
heinrichsweikamp
parents:
diff changeset
226 clrf T7GCON ; Reset Timer7 Gate Control register
heinrichsweikamp
parents:
diff changeset
227 ; movlw b'10001101' ; 1:1 Prescaler -> 2seconds@32768Hz, not synced
heinrichsweikamp
parents:
diff changeset
228 movlw b'10001001' ; 1:1 Prescaler -> 2seconds@32768Hz, synced
heinrichsweikamp
parents:
diff changeset
229 movwf T7CON
heinrichsweikamp
parents:
diff changeset
230 clrf TMR7L
heinrichsweikamp
parents:
diff changeset
231 movlw .248
heinrichsweikamp
parents:
diff changeset
232 movwf TMR7H ; -> Rollover after 2048 cycles -> 62,5ms
heinrichsweikamp
parents:
diff changeset
233
heinrichsweikamp
parents:
diff changeset
234 banksel common
heinrichsweikamp
parents:
diff changeset
235 ; Interrupts
heinrichsweikamp
parents:
diff changeset
236 movlw b'11110000'
heinrichsweikamp
parents:
diff changeset
237 movwf INTCON
heinrichsweikamp
parents:
diff changeset
238 movlw b'10000000' ; BIT7=1: Pullup for PORTB disabled
heinrichsweikamp
parents:
diff changeset
239 movwf INTCON2
heinrichsweikamp
parents:
diff changeset
240 movlw b'00001000'
heinrichsweikamp
parents:
diff changeset
241 movwf INTCON3
heinrichsweikamp
parents:
diff changeset
242 movlw b'00000001' ; Bit0: TMR1
heinrichsweikamp
parents:
diff changeset
243 movwf PIE1
heinrichsweikamp
parents:
diff changeset
244 movlw b'00000010' ; Bit1: TMR3
heinrichsweikamp
parents:
diff changeset
245 movwf PIE2
heinrichsweikamp
parents:
diff changeset
246 movlw b'00000000' ; Bit1: TMR5
heinrichsweikamp
parents:
diff changeset
247 movwf PIE5
heinrichsweikamp
parents:
diff changeset
248 movlw b'00100001' ; Bit0: RTCC, Bit5: UART2
heinrichsweikamp
parents:
diff changeset
249 movwf PIE3
heinrichsweikamp
parents:
diff changeset
250 movlw b'00001000' ; Bit3: TMR7
heinrichsweikamp
parents:
diff changeset
251 movwf PIE5
heinrichsweikamp
parents:
diff changeset
252
heinrichsweikamp
parents:
diff changeset
253 bsf power_sw1
heinrichsweikamp
parents:
diff changeset
254 bsf power_sw2
heinrichsweikamp
parents:
diff changeset
255
heinrichsweikamp
parents:
diff changeset
256 return
heinrichsweikamp
parents:
diff changeset
257
heinrichsweikamp
parents:
diff changeset
258 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
259 global speed_eco
heinrichsweikamp
parents:
diff changeset
260 speed_eco:
heinrichsweikamp
parents:
diff changeset
261 movlw d'1'
heinrichsweikamp
parents:
diff changeset
262 movff WREG,speed_setting ; Bank-independent
heinrichsweikamp
parents:
diff changeset
263 ; Done in ISR
heinrichsweikamp
parents:
diff changeset
264 return
heinrichsweikamp
parents:
diff changeset
265 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
266 global speed_normal
heinrichsweikamp
parents:
diff changeset
267 speed_normal:
heinrichsweikamp
parents:
diff changeset
268 movlw d'2'
heinrichsweikamp
parents:
diff changeset
269 movff WREG,speed_setting ; Bank-independent
heinrichsweikamp
parents:
diff changeset
270 ; Done in ISR
heinrichsweikamp
parents:
diff changeset
271 return
heinrichsweikamp
parents:
diff changeset
272 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
273 global speed_fastest
heinrichsweikamp
parents:
diff changeset
274 speed_fastest:
heinrichsweikamp
parents:
diff changeset
275 movlw d'3'
heinrichsweikamp
parents:
diff changeset
276 movff WREG,speed_setting ; Bank-independent
heinrichsweikamp
parents:
diff changeset
277 ; Done in ISR
heinrichsweikamp
parents:
diff changeset
278 return
heinrichsweikamp
parents:
diff changeset
279 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
280
heinrichsweikamp
parents:
diff changeset
281 END