annotate code_part1/OSTC_code_asm_part1/oled_samsung.asm @ 141:622da16b768f

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