Mercurial > public > mk2
annotate code_part1/OSTC_code_asm_part1/oled_samsung.asm @ 130:d721b49b8934
Fixed profile view (Logbook)
author | Heinrichsweikamp |
---|---|
date | Tue, 04 Jan 2011 17:41:13 +0100 |
parents | 06c4899ddb4b |
children | 8b75ba28d641 |
rev | line source |
---|---|
0 | 1 ; OSTC - diving computer code |
2 ; Copyright (C) 2009 HeinrichsWeikamp GbR | |
3 | |
4 ; This program is free software: you can redistribute it and/or modify | |
5 ; it under the terms of the GNU General Public License as published by | |
6 ; the Free Software Foundation, either version 3 of the License, or | |
7 ; (at your option) any later version. | |
8 | |
9 ; This program is distributed in the hope that it will be useful, | |
10 ; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 ; GNU General Public License for more details. | |
13 | |
14 ; You should have received a copy of the GNU General Public License | |
15 ; along with this program. If not, see <http://www.gnu.org/licenses/>. | |
16 | |
17 | |
18 ; hardware routines for S6E6D6 Samsung OLED Driver IC | |
19 ; written by: Matthias Heinrichs, info@heinrichsweikamp.com | |
20 ; written: 090801 | |
21 ; last updated: 090830 | |
22 ; known bugs: | |
23 ; ToDo: Optimise PLED_box calls | |
24 | |
25 WIN_FONT macro win_font_input | |
26 movlw win_font_input | |
27 movff WREG,win_font | |
28 endm | |
29 | |
30 WIN_TOP macro win_top_input | |
31 movlw win_top_input | |
32 movff WREG,win_top | |
33 endm | |
34 | |
35 WIN_LEFT macro win_left_input | |
36 movlw win_left_input | |
37 movff WREG,win_leftx2 | |
38 endm | |
39 | |
40 WIN_INVERT macro win_invert_input | |
41 movlw win_invert_input | |
42 movff WREG,win_invert | |
43 endm | |
44 | |
45 WIN_COLOR macro win_color_input | |
46 movlw win_color_input | |
47 call PLED_set_color | |
48 endm | |
49 | |
50 word_processor: ; word_processor: | |
123 | 51 clrf POSTINC2 ; Required, to mark end of string. |
83
3e351e25f5d1
adding anti-aliased fonts frame and merging some patches from Jeando
heinrichsweikamp
parents:
81
diff
changeset
|
52 call aa_wordprocessor |
3e351e25f5d1
adding anti-aliased fonts frame and merging some patches from Jeando
heinrichsweikamp
parents:
81
diff
changeset
|
53 movlb b'00000001' ; Back to Rambank1 |
0 | 54 return |
55 | |
56 ; ----------------------------- | |
57 ; PLED_SetColumnPixel: | |
58 ; ----------------------------- | |
59 PLED_SetColumnPixel: | |
130 | 60 movff WREG,win_leftx2 ; d'0' ... d'159' |
61 mullw 2 ; Copy to PROD, times 2. | |
123 | 62 |
0 | 63 movlw 0x21 ; Start Address Vertical (.0 - .319) |
64 rcall PLED_CmdWrite | |
123 | 65 bra PLED_DataWrite_PROD |
0 | 66 |
67 ; ----------------------------- | |
68 ; PLED_SetRow: | |
123 | 69 ; Backup WREG --> win_top, for the next write pixel. |
70 ; Setup OLED pixel horizontal address. | |
0 | 71 ; ----------------------------- |
72 PLED_SetRow: | |
123 | 73 movff WREG,win_top ; d'0' ... d'239' |
74 mullw 1 ; Copy row to PRODH:L | |
0 | 75 movlw 0x20 ; Horizontal Address START:END |
76 rcall PLED_CmdWrite | |
123 | 77 bra PLED_DataWrite_PROD |
0 | 78 |
79 ; ----------------------------- | |
80 ; PLED Write Two Pixel | |
81 ; ----------------------------- | |
123 | 82 |
0 | 83 PLED_PxlWrite: |
123 | 84 rcall PLED_PxlWrite_Single ; Write first pixel. |
0 | 85 |
123 | 86 ; Write 2nd Pixel on same row but one column to the right |
130 | 87 movff win_top,WREG |
88 rcall PLED_SetRow ; Re-Set Row | |
89 movff win_leftx2,WREG ; Increment column address. | |
123 | 90 mullw 2 |
91 incf PRODL | |
92 clrf WREG ; Does not reset CARRY... | |
93 addwfc PRODH | |
0 | 94 movlw 0x21 ; Start Address Vertical (.0 - .319) |
95 rcall PLED_CmdWrite | |
123 | 96 rcall PLED_DataWrite_PROD |
97 ; Continue with PLED_PxlWrite_Single... | |
0 | 98 |
99 ; ----------------------------- | |
100 ; PLED Write One Pixel | |
101 ; ----------------------------- | |
102 PLED_PxlWrite_Single: | |
103 movlw 0x22 ; Start Writing Data to GRAM | |
104 rcall PLED_CmdWrite | |
105 bsf oled_rs ; Data! | |
106 movff win_color1, PORTD | |
107 bcf oled_rw | |
108 bsf oled_rw ; Upper | |
109 movff win_color2, PORTD | |
110 bcf oled_rw | |
111 bsf oled_rw ; Lower | |
112 return | |
113 | |
114 ; ----------------------------- | |
115 ; PLED Display Off | |
116 ; ----------------------------- | |
117 PLED_DisplayOff: | |
118 clrf PORTD | |
119 bcf oled_hv | |
120 bcf oled_vdd | |
121 bcf oled_cs | |
122 bcf oled_e_nwr | |
123 bcf oled_rw | |
124 bcf oled_nreset | |
125 return | |
126 | |
123 | 127 ;============================================================================= |
128 ; PLED_frame : draw a frame around current box with current color. | |
129 ; Inputs: win_top, win_leftx2, win_height, win_width, win_color1, win_color2 | |
130 ; Outputs: (none) | |
131 ; Trashed: WREG, PROD, aa_start:2, aa_end:2, win_leftx2, win_width:1 | |
0 | 132 |
123 | 133 PLED_frame: |
134 movff win_top,aa_start+0 ; Backup everything. | |
135 movff win_height,aa_start+1 | |
136 movff win_leftx2,aa_end+0 | |
137 movff win_width,aa_end+1 | |
0 | 138 |
123 | 139 ;---- TOP line ----------------------------------------------------------- |
140 movlw 1 ; row ~ height=1 | |
141 movff WREG,win_height | |
142 rcall PLED_box | |
0 | 143 |
123 | 144 ;---- BOTTOM line -------------------------------------------------------- |
145 movff aa_start+0,PRODL ; Get back top, | |
146 movff aa_start+1,WREG ; and height | |
147 addwf PRODL,W ; top+height | |
148 decf WREG ; top+height-1 | |
149 movff WREG,win_top ; top+height-1 --> top | |
150 rcall PLED_box | |
0 | 151 |
123 | 152 ;---- LEFT column -------------------------------------------------------- |
153 movff aa_start+0,win_top ; Restore top/height. | |
154 movff aa_start+1,win_height | |
155 movlw 1 ; column ~ width=1 | |
156 movff WREG,win_width | |
157 rcall PLED_box | |
0 | 158 |
123 | 159 ;---- RIGHT column ------------------------------------------------------- |
160 movff aa_end+0,WREG | |
161 movff aa_end+1,PRODL | |
162 addwf PRODL,W | |
163 decf WREG | |
164 movff WREG,win_leftx2 | |
165 bra PLED_box | |
0 | 166 |
123 | 167 ;============================================================================= |
168 ; PLED_box : fills current box with current color. | |
169 ; Inputs: win_top, win_leftx2, win_height, win_width, win_color1, win_color2 | |
170 ; Outputs: (none) | |
171 ; Trashed: WREG, PROD | |
0 | 172 |
173 PLED_box: | |
123 | 174 ;---- Define Window ------------------------------------------------------ |
0 | 175 movlw 0x35 ; VerticalStartAddress HIGH:LOW |
176 rcall PLED_CmdWrite | |
123 | 177 movff win_leftx2,WREG |
178 mullw 2 | |
179 rcall PLED_DataWrite_PROD | |
0 | 180 |
181 movlw 0x36 ; VerticalEndAddress HIGH:LOW | |
182 rcall PLED_CmdWrite | |
123 | 183 movff win_width,PRODL ; Bank-safe addressing |
184 movff win_leftx2,WREG | |
185 addwf PRODL,W ; left+width | |
186 decf WREG ; left+width-1 | |
187 mullw 2 ; times 2 --> rightx2 | |
188 rcall PLED_DataWrite_PROD | |
0 | 189 |
190 movlw 0x37 ; HorizontalAddress START:END | |
191 rcall PLED_CmdWrite | |
123 | 192 movff win_top,PRODH ; Start row. |
193 movff win_height,PRODL ; height | |
194 movf PRODH,W | |
195 addwf PRODL,F ; top + height | |
196 decf PRODL,F ; top + height - 1 --> bottom. | |
197 rcall PLED_DataWrite_PROD | |
0 | 198 |
123 | 199 ;---- Start pointer ------------------------------------------------------ |
0 | 200 movlw 0x20 ; Start Address Horizontal (.0 - .239) |
201 rcall PLED_CmdWrite | |
123 | 202 movff win_top,WREG |
203 mullw 1 | |
204 rcall PLED_DataWrite_PROD | |
0 | 205 |
206 movlw 0x21 ; Start Address Vertical (.0 - .319) | |
207 rcall PLED_CmdWrite | |
123 | 208 movff win_leftx2,WREG |
209 mullw 2 | |
210 rcall PLED_DataWrite_PROD | |
0 | 211 |
123 | 212 ;---- Fill Window -------------------------------------------------------- |
0 | 213 movlw 0x22 ; Start Writing Data to GRAM |
214 rcall PLED_CmdWrite | |
215 | |
123 | 216 movff win_height,PRODH |
0 | 217 bsf oled_rs ; Data! |
218 | |
123 | 219 PLED_box2: ; Loop height times |
220 movff win_width,PRODL | |
221 PLED_box3: ; loop width times | |
0 | 222 movff win_color1,PORTD |
223 bcf oled_rw | |
224 bsf oled_rw ; Upper | |
225 movff win_color2,PORTD | |
226 bcf oled_rw | |
227 bsf oled_rw ; Lower | |
228 | |
229 movff win_color1,PORTD | |
230 bcf oled_rw | |
231 bsf oled_rw ; Upper | |
232 movff win_color2,PORTD | |
233 bcf oled_rw | |
234 bsf oled_rw ; Lower | |
235 | |
123 | 236 decfsz PRODL,F |
0 | 237 bra PLED_box3 |
123 | 238 decfsz PRODH,F |
0 | 239 bra PLED_box2 |
240 | |
241 movlw 0x00 ; NOP, to stop Address Update Counter | |
129
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
123
diff
changeset
|
242 bra PLED_CmdWrite ; Returns... |
0 | 243 |
123 | 244 ;============================================================================= |
129
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
123
diff
changeset
|
245 ; PLED_ClearScreen: An optimized version of PLEX_box, for full screen black. |
123 | 246 ; Trashed: WREG, PROD |
0 | 247 |
248 PLED_ClearScreen: | |
249 movlw 0x35 ; VerticalStartAddress HIGH:LOW | |
250 rcall PLED_CmdWrite | |
123 | 251 mullw 0 |
252 rcall PLED_DataWrite_PROD | |
0 | 253 |
254 movlw 0x36 ; VerticalEndAddress HIGH:LOW | |
255 rcall PLED_CmdWrite | |
256 movlw 0x01 | |
123 | 257 rcall PLED_DataWrite |
0 | 258 movlw 0x3F |
123 | 259 rcall PLED_DataWrite |
0 | 260 |
261 movlw 0x37 ; HorizontalAddress START:END | |
262 rcall PLED_CmdWrite | |
263 movlw 0x00 | |
123 | 264 rcall PLED_DataWrite |
0 | 265 movlw 0xEF |
123 | 266 rcall PLED_DataWrite |
0 | 267 |
268 movlw 0x20 ; Start Address Horizontal (.0 - .239) | |
269 rcall PLED_CmdWrite | |
123 | 270 rcall PLED_DataWrite_PROD |
0 | 271 |
272 movlw 0x21 ; Start Address Vertical (.0 - .319) | |
273 rcall PLED_CmdWrite | |
123 | 274 rcall PLED_DataWrite_PROD |
0 | 275 |
276 movlw 0x22 ; Start Writing Data to GRAM | |
277 rcall PLED_CmdWrite | |
278 | |
83
3e351e25f5d1
adding anti-aliased fonts frame and merging some patches from Jeando
heinrichsweikamp
parents:
81
diff
changeset
|
279 ; See Page 101 of OLED Driver IC Datasheet how to handle rs/rw clocks |
0 | 280 bsf oled_rs ; Data! |
281 | |
123 | 282 movlw .160 |
283 movwf PRODH | |
0 | 284 PLED_ClearScreen2: |
123 | 285 movlw .240 |
286 movwf PRODL | |
0 | 287 PLED_ClearScreen3: |
288 | |
81
31fa973a70fd
Kludges to emulate inexisting devices when debugged with the MPLAB software SIMulator.
JeanDo
parents:
3
diff
changeset
|
289 clrf PORTD ; Need to generate trace here too. |
0 | 290 bcf oled_rw |
291 bsf oled_rw ; Upper | |
81
31fa973a70fd
Kludges to emulate inexisting devices when debugged with the MPLAB software SIMulator.
JeanDo
parents:
3
diff
changeset
|
292 |
31fa973a70fd
Kludges to emulate inexisting devices when debugged with the MPLAB software SIMulator.
JeanDo
parents:
3
diff
changeset
|
293 clrf PORTD ; Need to generate trace here too. |
0 | 294 bcf oled_rw |
295 bsf oled_rw ; Lower | |
296 | |
123 | 297 clrf PORTD ; Need to generate trace here too. |
298 bcf oled_rw | |
299 bsf oled_rw ; Upper | |
300 | |
301 clrf PORTD ; Need to generate trace here too. | |
302 bcf oled_rw | |
303 bsf oled_rw ; Lower | |
304 | |
305 decfsz PRODL,F | |
0 | 306 bra PLED_ClearScreen3 |
123 | 307 decfsz PRODH,F |
0 | 308 bra PLED_ClearScreen2 |
309 | |
310 movlw 0x00 ; NOP, to stop Address Update Counter | |
123 | 311 bra PLED_CmdWrite |
0 | 312 |
313 ; ----------------------------- | |
314 ; PLED Write Cmd via W | |
315 ; ----------------------------- | |
316 PLED_CmdWrite: | |
317 bcf oled_rs ; Command! | |
318 movwf PORTD ; Move Data to PORTD | |
319 bcf oled_rw | |
320 bsf oled_rw | |
321 return | |
322 | |
323 ; ----------------------------- | |
324 ; PLED Write Display Data via W | |
325 ; ----------------------------- | |
326 PLED_DataWrite: | |
123 | 327 bsf oled_rs ; Data! |
328 movwf PORTD ; Move Data to PORTD | |
329 bcf oled_rw | |
330 bsf oled_rw | |
331 return | |
0 | 332 |
333 ; ----------------------------- | |
334 ; PLED Data Cmd via W | |
335 ; ----------------------------- | |
123 | 336 PLED_DataWrite_PROD: |
0 | 337 bsf oled_rs ; Data! |
123 | 338 movff PRODH,PORTD ; Move high byte to PORTD (OLED is bigendian) |
339 bcf oled_rw | |
340 bsf oled_rw | |
341 movff PRODL,PORTD ; Move low byte to PORTD | |
0 | 342 bcf oled_rw |
343 bsf oled_rw | |
344 return | |
345 | |
346 ; ----------------------------- | |
347 ; PLED boot | |
348 ; ----------------------------- | |
349 PLED_boot: | |
350 bcf oled_hv | |
351 WAITMS d'32' | |
352 bsf oled_vdd | |
353 nop | |
354 bcf oled_cs | |
355 nop | |
356 bsf oled_nreset | |
3 | 357 ; WAITMS d'10' ; Quick wake-up |
358 WAITMS d'250' ; Standard wake-up | |
0 | 359 bsf oled_e_nwr |
360 nop | |
361 bcf oled_nreset | |
362 WAIT10US d'2' | |
363 bsf oled_nreset | |
364 WAITMS d'10' | |
365 | |
366 movlw 0x24 ; 80-System 8-Bit Mode | |
367 rcall PLED_CmdWrite | |
368 | |
369 movlw 0x02 ; RGB Interface Control (S6E63D6 Datasheet page 42) | |
370 rcall PLED_CmdWrite | |
371 movlw 0x00 ; X X X X X X X RM | |
123 | 372 rcall PLED_DataWrite |
0 | 373 movlw 0x00 ; DM X RIM1 RIM0 VSPL HSPL EPL DPL |
123 | 374 rcall PLED_DataWrite ; System Interface: RIM is ignored, Internal Clock |
0 | 375 |
376 movlw 0x03 ; Entry Mode (S6E63D6 Datasheet page 46) | |
377 rcall PLED_CmdWrite | |
378 movlw 0x00 ; =b'00000000' CLS MDT1 MDT0 BGR X X X SS 65k Color | |
123 | 379 rcall PLED_DataWrite |
0 | 380 movlw b'00110000' ; =b'00110000' X X I/D1 I/D0 X X X AM |
123 | 381 rcall PLED_DataWrite |
0 | 382 |
383 movlw 0x18 | |
384 rcall PLED_CmdWrite | |
385 movlw 0x00 | |
123 | 386 rcall PLED_DataWrite |
0 | 387 movlw 0x28 |
123 | 388 rcall PLED_DataWrite |
0 | 389 |
390 movlw 0xF8 | |
391 rcall PLED_CmdWrite | |
392 movlw 0x00 | |
123 | 393 rcall PLED_DataWrite |
0 | 394 movlw 0x0F |
123 | 395 rcall PLED_DataWrite |
0 | 396 |
397 movlw 0xF9 | |
398 rcall PLED_CmdWrite | |
399 movlw 0x00 | |
123 | 400 rcall PLED_DataWrite |
0 | 401 movlw 0x0F |
123 | 402 rcall PLED_DataWrite |
0 | 403 |
404 movlw 0x10 | |
405 rcall PLED_CmdWrite | |
406 movlw 0x00 | |
123 | 407 rcall PLED_DataWrite |
0 | 408 movlw 0x00 |
123 | 409 rcall PLED_DataWrite |
0 | 410 |
411 ; Now Gamma settings... | |
412 rcall PLED_brightness_full | |
2 | 413 ;rcall PLED_brightness_low |
0 | 414 ; End Gamma Settings |
415 | |
416 rcall PLED_ClearScreen | |
417 | |
418 bsf oled_hv | |
419 WAITMS d'32' | |
420 | |
421 movlw 0x05 | |
422 rcall PLED_CmdWrite | |
423 movlw 0x00 | |
123 | 424 rcall PLED_DataWrite |
0 | 425 movlw 0x01 |
123 | 426 rcall PLED_DataWrite ; Display ON |
0 | 427 return |
428 | |
429 | |
430 PLED_brightness_full: | |
431 movlw 0x70 | |
432 rcall PLED_CmdWrite | |
433 movlw 0x1F | |
123 | 434 rcall PLED_DataWrite |
0 | 435 movlw 0x00 |
123 | 436 rcall PLED_DataWrite |
0 | 437 movlw 0x71 |
438 rcall PLED_CmdWrite | |
439 movlw 0x23 | |
123 | 440 rcall PLED_DataWrite |
0 | 441 movlw 0x80 |
123 | 442 rcall PLED_DataWrite |
0 | 443 movlw 0x72 |
444 rcall PLED_CmdWrite | |
445 movlw 0x2A | |
123 | 446 rcall PLED_DataWrite |
0 | 447 movlw 0x80 |
123 | 448 rcall PLED_DataWrite |
0 | 449 |
450 movlw 0x73 | |
451 rcall PLED_CmdWrite | |
452 movlw 0x15 | |
123 | 453 rcall PLED_DataWrite |
0 | 454 movlw 0x11 |
123 | 455 rcall PLED_DataWrite |
0 | 456 movlw 0x74 |
457 rcall PLED_CmdWrite | |
458 movlw 0x1C | |
123 | 459 rcall PLED_DataWrite |
0 | 460 movlw 0x11 |
123 | 461 rcall PLED_DataWrite |
0 | 462 |
463 movlw 0x75 | |
464 rcall PLED_CmdWrite | |
465 movlw 0x1B | |
123 | 466 rcall PLED_DataWrite |
0 | 467 movlw 0x15 |
123 | 468 rcall PLED_DataWrite |
0 | 469 movlw 0x76 |
470 rcall PLED_CmdWrite | |
471 movlw 0x1A | |
123 | 472 rcall PLED_DataWrite |
0 | 473 movlw 0x15 |
123 | 474 rcall PLED_DataWrite |
0 | 475 |
476 movlw 0x77 | |
477 rcall PLED_CmdWrite | |
478 movlw 0x1C | |
123 | 479 rcall PLED_DataWrite |
0 | 480 movlw 0x18 |
123 | 481 rcall PLED_DataWrite |
0 | 482 movlw 0x78 |
483 rcall PLED_CmdWrite | |
484 movlw 0x21 | |
123 | 485 rcall PLED_DataWrite |
0 | 486 movlw 0x15 |
123 | 487 rcall PLED_DataWrite |
0 | 488 |
489 return | |
490 | |
491 PLED_brightness_low: | |
492 movlw 0x70 | |
493 rcall PLED_CmdWrite | |
494 movlw 0x14 | |
123 | 495 rcall PLED_DataWrite |
0 | 496 movlw 0x00 |
123 | 497 rcall PLED_DataWrite |
0 | 498 movlw 0x71 |
499 rcall PLED_CmdWrite | |
500 movlw 0x17 | |
123 | 501 rcall PLED_DataWrite |
0 | 502 movlw 0x00 |
123 | 503 rcall PLED_DataWrite |
0 | 504 movlw 0x72 |
505 rcall PLED_CmdWrite | |
506 movlw 0x15 | |
123 | 507 rcall PLED_DataWrite |
0 | 508 movlw 0x80 |
123 | 509 rcall PLED_DataWrite |
0 | 510 |
511 movlw 0x73 | |
512 rcall PLED_CmdWrite | |
513 movlw 0x15 | |
123 | 514 rcall PLED_DataWrite |
0 | 515 movlw 0x11 |
123 | 516 rcall PLED_DataWrite |
0 | 517 movlw 0x74 |
518 rcall PLED_CmdWrite | |
519 movlw 0x14 | |
123 | 520 rcall PLED_DataWrite |
0 | 521 movlw 0x0B |
123 | 522 rcall PLED_DataWrite |
0 | 523 |
524 movlw 0x75 | |
525 rcall PLED_CmdWrite | |
526 movlw 0x1B | |
123 | 527 rcall PLED_DataWrite |
0 | 528 movlw 0x15 |
123 | 529 rcall PLED_DataWrite |
0 | 530 movlw 0x76 |
531 rcall PLED_CmdWrite | |
532 movlw 0x13 | |
123 | 533 rcall PLED_DataWrite |
0 | 534 movlw 0x0E |
123 | 535 rcall PLED_DataWrite |
0 | 536 |
537 movlw 0x77 | |
538 rcall PLED_CmdWrite | |
539 movlw 0x1C | |
123 | 540 rcall PLED_DataWrite |
0 | 541 movlw 0x18 |
123 | 542 rcall PLED_DataWrite |
0 | 543 movlw 0x78 |
544 rcall PLED_CmdWrite | |
545 movlw 0x15 | |
123 | 546 rcall PLED_DataWrite |
0 | 547 movlw 0x0E |
123 | 548 rcall PLED_DataWrite |
0 | 549 |
550 return | |
551 | |
552 PLED_set_color:;Converts 8Bit RGB b'RRRGGGBB' into 16Bit RGB b'RRRRRGGGGGGBBBBB' | |
553 movwf oled1_temp ; Get 8Bit RGB b'RRRGGGBB' | |
554 movff oled1_temp, oled2_temp ; Copy | |
555 | |
556 ; Mask Bit 7,6,5,4,3,2 | |
557 movlw b'00000011' | |
558 andwf oled2_temp,F | |
559 | |
560 movlw b'00000000' | |
561 dcfsnz oled2_temp,F | |
562 movlw b'01010000' | |
563 dcfsnz oled2_temp,F | |
564 movlw b'10100000' | |
565 dcfsnz oled2_temp,F | |
566 movlw b'11111000' | |
567 movwf oled3_temp ; Blue done. | |
568 | |
569 movff oled1_temp, oled2_temp ; Copy | |
570 ; Mask Bit 7,6,5,1,0 | |
571 movlw b'00011100' | |
572 andwf oled2_temp,F | |
573 rrncf oled2_temp,F | |
574 rrncf oled2_temp,F | |
575 | |
576 movlw b'00000000' | |
577 dcfsnz oled2_temp,F | |
578 movlw b'00000100' | |
579 dcfsnz oled2_temp,F | |
580 movlw b'00001000' | |
581 dcfsnz oled2_temp,F | |
582 movlw b'00001100' | |
583 dcfsnz oled2_temp,F | |
584 movlw b'00010000' | |
585 dcfsnz oled2_temp,F | |
586 movlw b'00010100' | |
587 dcfsnz oled2_temp,F | |
588 movlw b'00100000' | |
589 dcfsnz oled2_temp,F | |
590 movlw b'00111111' | |
591 movwf oled4_temp | |
592 | |
593 rrcf oled4_temp,F | |
594 rrcf oled3_temp,F | |
595 | |
596 rrcf oled4_temp,F | |
597 rrcf oled3_temp,F | |
598 | |
599 rrcf oled4_temp,F | |
600 rrcf oled3_temp,F ; oled3_temp (b'GGGBBBBB') done. | |
601 | |
602 movff oled1_temp, oled2_temp ; Copy | |
603 clrf oled1_temp | |
604 | |
605 rrcf oled4_temp,F | |
606 rrcf oled1_temp,F | |
607 | |
608 rrcf oled4_temp,F | |
609 rrcf oled1_temp,F | |
610 | |
611 rrcf oled4_temp,F | |
612 rrcf oled1_temp,F ; Green done. | |
613 | |
614 ; Mask Bit 4,3,2,1,0 | |
615 movlw b'11100000' | |
616 andwf oled2_temp,F | |
617 | |
618 rrncf oled2_temp,F | |
619 rrncf oled2_temp,F | |
620 rrncf oled2_temp,F | |
621 rrncf oled2_temp,F | |
622 rrncf oled2_temp,F | |
623 | |
624 movlw b'00000000' | |
625 dcfsnz oled2_temp,F | |
626 movlw b'00000100' | |
627 dcfsnz oled2_temp,F | |
628 movlw b'00001000' | |
629 dcfsnz oled2_temp,F | |
630 movlw b'00001100' | |
631 dcfsnz oled2_temp,F | |
632 movlw b'00010000' | |
633 dcfsnz oled2_temp,F | |
634 movlw b'00010100' | |
635 dcfsnz oled2_temp,F | |
636 movlw b'00100000' | |
637 dcfsnz oled2_temp,F | |
638 movlw b'00111111' | |
639 movwf oled4_temp | |
640 | |
641 rrcf oled4_temp,F | |
642 rrcf oled1_temp,F | |
643 | |
644 rrcf oled4_temp,F | |
645 rrcf oled1_temp,F | |
646 | |
647 rrcf oled4_temp,F | |
648 rrcf oled1_temp,F | |
649 | |
650 rrcf oled4_temp,F | |
651 rrcf oled1_temp,F | |
652 | |
653 rrcf oled4_temp,F | |
654 rrcf oled1_temp,F ; Red done. | |
655 | |
656 movff oled1_temp,win_color1 | |
657 movff oled3_temp,win_color2 ; Set Bank0 Color registers... | |
658 return | |
659 |