annotate code_part1/OSTC_code_asm_part1/oled_samsung.asm @ 126:ed275788a291

Re-indent c-code. Add .o file.
author JeanDo
date Tue, 04 Jan 2011 01:55:49 +0100
parents 6a94f96e9cea
children 06c4899ddb4b
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:
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
60 movwf win_leftx2 ; d'0' ... d'159'
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
61 mullw 2 ; Copy to POD, times 2.
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
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
87 movwf win_leftx2,W ; Increment column address.
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
88 mullw 2
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
89 incf PRODL
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
90 clrf WREG ; Does not reset CARRY...
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
91 addwfc PRODH
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
92 movlw 0x21 ; Start Address Vertical (.0 - .319)
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
93 rcall PLED_CmdWrite
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
94 rcall PLED_DataWrite_PROD
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
95 ; Continue with PLED_PxlWrite_Single...
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
96
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
97 ; -----------------------------
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
98 ; PLED Write One Pixel
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
99 ; -----------------------------
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
100 PLED_PxlWrite_Single:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
101 movlw 0x22 ; Start Writing Data to GRAM
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
102 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
103 bsf oled_rs ; Data!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
104 movff win_color1, PORTD
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
105 bcf oled_rw
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
106 bsf oled_rw ; Upper
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
107 movff win_color2, PORTD
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
108 bcf oled_rw
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
109 bsf oled_rw ; Lower
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
110 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
111
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
112 ; -----------------------------
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
113 ; PLED Display Off
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
114 ; -----------------------------
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
115 PLED_DisplayOff:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
116 clrf PORTD
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
117 bcf oled_hv
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
118 bcf oled_vdd
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
119 bcf oled_cs
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
120 bcf oled_e_nwr
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
121 bcf oled_rw
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
122 bcf oled_nreset
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
123 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
124
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
125 ;=============================================================================
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
126 ; PLED_frame : draw a frame around current box with current color.
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
127 ; Inputs: win_top, win_leftx2, win_height, win_width, win_color1, win_color2
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
128 ; Outputs: (none)
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
129 ; Trashed: WREG, PROD, aa_start:2, aa_end:2, win_leftx2, win_width:1
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
130
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
131 PLED_frame:
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
132 movff win_top,aa_start+0 ; Backup everything.
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
133 movff win_height,aa_start+1
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
134 movff win_leftx2,aa_end+0
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
135 movff win_width,aa_end+1
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
136
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
137 ;---- TOP line -----------------------------------------------------------
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
138 movlw 1 ; row ~ height=1
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
139 movff WREG,win_height
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
140 rcall PLED_box
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
141
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
142 ;---- BOTTOM line --------------------------------------------------------
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
143 movff aa_start+0,PRODL ; Get back top,
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
144 movff aa_start+1,WREG ; and height
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
145 addwf PRODL,W ; top+height
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
146 decf WREG ; top+height-1
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
147 movff WREG,win_top ; top+height-1 --> top
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
148 rcall PLED_box
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
149
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
150 ;---- LEFT column --------------------------------------------------------
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
151 movff aa_start+0,win_top ; Restore top/height.
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
152 movff aa_start+1,win_height
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
153 movlw 1 ; column ~ width=1
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
154 movff WREG,win_width
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
155 rcall PLED_box
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
156
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
157 ;---- RIGHT column -------------------------------------------------------
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
158 movff aa_end+0,WREG
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
159 movff aa_end+1,PRODL
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
160 addwf PRODL,W
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
161 decf WREG
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
162 movff WREG,win_leftx2
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
163 bra PLED_box
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
164
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
165 ;=============================================================================
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
166 ; PLED_box : fills current box with current color.
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
167 ; Inputs: win_top, win_leftx2, win_height, win_width, win_color1, win_color2
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
168 ; Outputs: (none)
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
169 ; Trashed: WREG, PROD
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
170
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
171 PLED_box:
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
172 ;---- Define Window ------------------------------------------------------
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
173 movlw 0x35 ; VerticalStartAddress HIGH:LOW
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
174 rcall PLED_CmdWrite
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
175 movff win_leftx2,WREG
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
176 mullw 2
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
177 rcall PLED_DataWrite_PROD
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
178
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
179 movlw 0x36 ; VerticalEndAddress HIGH:LOW
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
180 rcall PLED_CmdWrite
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
181 movff win_width,PRODL ; Bank-safe addressing
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
182 movff win_leftx2,WREG
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
183 addwf PRODL,W ; left+width
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
184 decf WREG ; left+width-1
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
185 mullw 2 ; times 2 --> rightx2
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
186 rcall PLED_DataWrite_PROD
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
187
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
188 movlw 0x37 ; HorizontalAddress START:END
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
189 rcall PLED_CmdWrite
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
190 movff win_top,PRODH ; Start row.
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
191 movff win_height,PRODL ; height
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
192 movf PRODH,W
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
193 addwf PRODL,F ; top + height
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
194 decf PRODL,F ; top + height - 1 --> bottom.
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
195 rcall PLED_DataWrite_PROD
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
196
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
197 ;---- Start pointer ------------------------------------------------------
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
198 movlw 0x20 ; Start Address Horizontal (.0 - .239)
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
199 rcall PLED_CmdWrite
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
200 movff win_top,WREG
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
201 mullw 1
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
202 rcall PLED_DataWrite_PROD
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
203
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
204 movlw 0x21 ; Start Address Vertical (.0 - .319)
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
205 rcall PLED_CmdWrite
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
206 movff win_leftx2,WREG
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
207 mullw 2
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
208 rcall PLED_DataWrite_PROD
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
209
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
210 ;---- Fill Window --------------------------------------------------------
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
211 movlw 0x22 ; Start Writing Data to GRAM
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
212 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
213
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
214 movff win_height,PRODH
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
215 bsf oled_rs ; Data!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
216
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
217 PLED_box2: ; Loop height times
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
218 movff win_width,PRODL
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
219 PLED_box3: ; loop width times
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
220 movff win_color1,PORTD
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
221 bcf oled_rw
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
222 bsf oled_rw ; Upper
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
223 movff win_color2,PORTD
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
224 bcf oled_rw
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
225 bsf oled_rw ; Lower
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
226
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
227 movff win_color1,PORTD
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
228 bcf oled_rw
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
229 bsf oled_rw ; Upper
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
230 movff win_color2,PORTD
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
231 bcf oled_rw
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
232 bsf oled_rw ; Lower
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
233
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
234 decfsz PRODL,F
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
235 bra PLED_box3
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
236 decfsz PRODH,F
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
237 bra PLED_box2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
238
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
239 movlw 0x00 ; NOP, to stop Address Update Counter
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
240 bra PLED_CmdWrite
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
241
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
242 ;=============================================================================
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
243 ; PLED_ClearScreen: An optimized version of PLEX_box, for ful screen black.
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
244 ; Trashed: WREG, PROD
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
245
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
246 PLED_ClearScreen:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
247 movlw 0x35 ; VerticalStartAddress HIGH:LOW
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
248 rcall PLED_CmdWrite
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
249 mullw 0
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
250 rcall PLED_DataWrite_PROD
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
251
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
252 movlw 0x36 ; VerticalEndAddress HIGH:LOW
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
253 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
254 movlw 0x01
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
255 rcall PLED_DataWrite
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
256 movlw 0x3F
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
257 rcall PLED_DataWrite
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
258
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
259 movlw 0x37 ; HorizontalAddress START:END
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
260 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
261 movlw 0x00
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
262 rcall PLED_DataWrite
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
263 movlw 0xEF
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
264 rcall PLED_DataWrite
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
265
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
266 movlw 0x20 ; Start Address Horizontal (.0 - .239)
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
267 rcall PLED_CmdWrite
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
268 rcall PLED_DataWrite_PROD
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
269
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
270 movlw 0x21 ; Start Address Vertical (.0 - .319)
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
271 rcall PLED_CmdWrite
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
272 rcall PLED_DataWrite_PROD
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
273
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
274 movlw 0x22 ; Start Writing Data to GRAM
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
275 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
276
83
3e351e25f5d1 adding anti-aliased fonts frame and merging some patches from Jeando
heinrichsweikamp
parents: 81
diff changeset
277 ; See Page 101 of OLED Driver IC Datasheet how to handle rs/rw clocks
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
278 bsf oled_rs ; Data!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
279
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
280 movlw .160
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
281 movwf PRODH
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
282 PLED_ClearScreen2:
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
283 movlw .240
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
284 movwf PRODL
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
285 PLED_ClearScreen3:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
286
81
31fa973a70fd Kludges to emulate inexisting devices when debugged with the MPLAB software SIMulator.
JeanDo
parents: 3
diff changeset
287 clrf PORTD ; Need to generate trace here too.
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
288 bcf oled_rw
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
289 bsf oled_rw ; Upper
81
31fa973a70fd Kludges to emulate inexisting devices when debugged with the MPLAB software SIMulator.
JeanDo
parents: 3
diff changeset
290
31fa973a70fd Kludges to emulate inexisting devices when debugged with the MPLAB software SIMulator.
JeanDo
parents: 3
diff changeset
291 clrf PORTD ; Need to generate trace here too.
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
292 bcf oled_rw
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
293 bsf oled_rw ; Lower
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
294
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
295 clrf PORTD ; Need to generate trace here too.
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
296 bcf oled_rw
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
297 bsf oled_rw ; Upper
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
298
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
299 clrf PORTD ; Need to generate trace here too.
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
300 bcf oled_rw
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
301 bsf oled_rw ; Lower
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
302
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
303 decfsz PRODL,F
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
304 bra PLED_ClearScreen3
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
305 decfsz PRODH,F
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
306 bra PLED_ClearScreen2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
307
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
308 movlw 0x00 ; NOP, to stop Address Update Counter
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
309 bra PLED_CmdWrite
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
310
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
311 ; -----------------------------
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
312 ; PLED Write Cmd via W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
313 ; -----------------------------
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
314 PLED_CmdWrite:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
315 bcf oled_rs ; Command!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
316 movwf PORTD ; Move Data to PORTD
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
317 bcf oled_rw
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
318 bsf oled_rw
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
319 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
320
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
321 ; -----------------------------
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
322 ; PLED Write Display Data via W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
323 ; -----------------------------
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
324 PLED_DataWrite:
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
325 bsf oled_rs ; Data!
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
326 movwf PORTD ; Move Data to PORTD
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
327 bcf oled_rw
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
328 bsf oled_rw
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
329 return
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
330
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
331 ; -----------------------------
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
332 ; PLED Data Cmd via W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
333 ; -----------------------------
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
334 PLED_DataWrite_PROD:
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
335 bsf oled_rs ; Data!
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
336 movff PRODH,PORTD ; Move high byte to PORTD (OLED is bigendian)
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
337 bcf oled_rw
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
338 bsf oled_rw
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
339 movff PRODL,PORTD ; Move low byte to PORTD
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
340 bcf oled_rw
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
341 bsf oled_rw
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
342 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
343
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
344 ; -----------------------------
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
345 ; PLED boot
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 bcf oled_hv
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
349 WAITMS d'32'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
350 bsf oled_vdd
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
351 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
352 bcf oled_cs
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
353 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
354 bsf oled_nreset
3
3cf8af30b36e v1.51 beta
heinrichsweikamp
parents: 2
diff changeset
355 ; WAITMS d'10' ; Quick wake-up
3cf8af30b36e v1.51 beta
heinrichsweikamp
parents: 2
diff changeset
356 WAITMS d'250' ; Standard wake-up
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
357 bsf oled_e_nwr
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
358 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
359 bcf oled_nreset
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
360 WAIT10US d'2'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
361 bsf oled_nreset
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
362 WAITMS d'10'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
363
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
364 movlw 0x24 ; 80-System 8-Bit Mode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
365 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
366
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
367 movlw 0x02 ; RGB Interface Control (S6E63D6 Datasheet page 42)
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
368 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
369 movlw 0x00 ; X X X X X X X RM
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
370 rcall PLED_DataWrite
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
371 movlw 0x00 ; DM X RIM1 RIM0 VSPL HSPL EPL DPL
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
372 rcall PLED_DataWrite ; System Interface: RIM is ignored, Internal Clock
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
373
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
374 movlw 0x03 ; Entry Mode (S6E63D6 Datasheet page 46)
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
375 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
376 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
377 rcall PLED_DataWrite
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
378 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
379 rcall PLED_DataWrite
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
380
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
381 movlw 0x18
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
382 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
383 movlw 0x00
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
384 rcall PLED_DataWrite
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
385 movlw 0x28
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
386 rcall PLED_DataWrite
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
387
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
388 movlw 0xF8
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
389 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
390 movlw 0x00
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
391 rcall PLED_DataWrite
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
392 movlw 0x0F
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
393 rcall PLED_DataWrite
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
394
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
395 movlw 0xF9
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
396 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
397 movlw 0x00
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
398 rcall PLED_DataWrite
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
399 movlw 0x0F
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
400 rcall PLED_DataWrite
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
401
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
402 movlw 0x10
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
403 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
404 movlw 0x00
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
405 rcall PLED_DataWrite
0
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
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
409 ; Now Gamma settings...
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
410 rcall PLED_brightness_full
2
d11ef8dc4b2c Bugfix: PC simulator
heinrichsweikamp
parents: 0
diff changeset
411 ;rcall PLED_brightness_low
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
412 ; End Gamma Settings
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
413
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
414 rcall PLED_ClearScreen
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
415
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
416 bsf oled_hv
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
417 WAITMS d'32'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
418
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
419 movlw 0x05
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
420 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
421 movlw 0x00
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
422 rcall PLED_DataWrite
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
423 movlw 0x01
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
424 rcall PLED_DataWrite ; Display ON
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
425 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
426
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
427
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
428 PLED_brightness_full:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
429 movlw 0x70
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
430 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
431 movlw 0x1F
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
432 rcall PLED_DataWrite
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
433 movlw 0x00
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 0x71
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
436 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
437 movlw 0x23
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
438 rcall PLED_DataWrite
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
439 movlw 0x80
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 0x72
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
442 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
443 movlw 0x2A
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
444 rcall PLED_DataWrite
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
445 movlw 0x80
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
446 rcall PLED_DataWrite
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
447
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
448 movlw 0x73
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
449 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
450 movlw 0x15
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
451 rcall PLED_DataWrite
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
452 movlw 0x11
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 0x74
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
455 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
456 movlw 0x1C
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
457 rcall PLED_DataWrite
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
458 movlw 0x11
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
459 rcall PLED_DataWrite
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
460
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
461 movlw 0x75
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
462 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
463 movlw 0x1B
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
464 rcall PLED_DataWrite
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
465 movlw 0x15
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 0x76
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
468 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
469 movlw 0x1A
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
470 rcall PLED_DataWrite
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
471 movlw 0x15
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
472 rcall PLED_DataWrite
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
473
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
474 movlw 0x77
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
475 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
476 movlw 0x1C
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
477 rcall PLED_DataWrite
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
478 movlw 0x18
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 0x78
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
481 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
482 movlw 0x21
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
483 rcall PLED_DataWrite
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
484 movlw 0x15
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
485 rcall PLED_DataWrite
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
486
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
487 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
488
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
489 PLED_brightness_low:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
490 movlw 0x70
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
491 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
492 movlw 0x14
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
493 rcall PLED_DataWrite
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
494 movlw 0x00
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 0x71
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
497 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
498 movlw 0x17
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
499 rcall PLED_DataWrite
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
500 movlw 0x00
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 0x72
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
503 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
504 movlw 0x15
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
505 rcall PLED_DataWrite
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
506 movlw 0x80
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
507 rcall PLED_DataWrite
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
508
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
509 movlw 0x73
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
510 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
511 movlw 0x15
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
512 rcall PLED_DataWrite
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
513 movlw 0x11
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 0x74
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
516 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
517 movlw 0x14
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
518 rcall PLED_DataWrite
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
519 movlw 0x0B
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
520 rcall PLED_DataWrite
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
521
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
522 movlw 0x75
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
523 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
524 movlw 0x1B
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
525 rcall PLED_DataWrite
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
526 movlw 0x15
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 0x76
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
529 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
530 movlw 0x13
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
531 rcall PLED_DataWrite
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
532 movlw 0x0E
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
533 rcall PLED_DataWrite
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
534
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
535 movlw 0x77
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
536 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
537 movlw 0x1C
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
538 rcall PLED_DataWrite
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
539 movlw 0x18
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 0x78
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
542 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
543 movlw 0x15
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
544 rcall PLED_DataWrite
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
545 movlw 0x0E
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 83
diff changeset
546 rcall PLED_DataWrite
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
547
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
548 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
549
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
550 PLED_set_color:;Converts 8Bit RGB b'RRRGGGBB' into 16Bit RGB b'RRRRRGGGGGGBBBBB'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
551 movwf oled1_temp ; Get 8Bit RGB b'RRRGGGBB'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
552 movff oled1_temp, oled2_temp ; Copy
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
553
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
554 ; Mask Bit 7,6,5,4,3,2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
555 movlw b'00000011'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
556 andwf oled2_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
557
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
558 movlw b'00000000'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
559 dcfsnz oled2_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
560 movlw b'01010000'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
561 dcfsnz oled2_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
562 movlw b'10100000'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
563 dcfsnz oled2_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
564 movlw b'11111000'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
565 movwf oled3_temp ; Blue done.
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
566
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
567 movff oled1_temp, oled2_temp ; Copy
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
568 ; Mask Bit 7,6,5,1,0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
569 movlw b'00011100'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
570 andwf oled2_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
571 rrncf oled2_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
572 rrncf oled2_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
573
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
574 movlw b'00000000'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
575 dcfsnz oled2_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
576 movlw b'00000100'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
577 dcfsnz oled2_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
578 movlw b'00001000'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
579 dcfsnz oled2_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
580 movlw b'00001100'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
581 dcfsnz oled2_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
582 movlw b'00010000'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
583 dcfsnz oled2_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
584 movlw b'00010100'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
585 dcfsnz oled2_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
586 movlw b'00100000'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
587 dcfsnz oled2_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
588 movlw b'00111111'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
589 movwf oled4_temp
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
590
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
591 rrcf oled4_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
592 rrcf oled3_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
593
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
594 rrcf oled4_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
595 rrcf oled3_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
596
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
597 rrcf oled4_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
598 rrcf oled3_temp,F ; oled3_temp (b'GGGBBBBB') done.
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
599
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
600 movff oled1_temp, oled2_temp ; Copy
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
601 clrf oled1_temp
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
602
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
603 rrcf oled4_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
604 rrcf oled1_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
605
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
606 rrcf oled4_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
607 rrcf oled1_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
608
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
609 rrcf oled4_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
610 rrcf oled1_temp,F ; Green done.
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
611
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
612 ; Mask Bit 4,3,2,1,0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
613 movlw b'11100000'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
614 andwf oled2_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
615
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
616 rrncf oled2_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
617 rrncf oled2_temp,F
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
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
622 movlw b'00000000'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
623 dcfsnz oled2_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
624 movlw b'00000100'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
625 dcfsnz oled2_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
626 movlw b'00001000'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
627 dcfsnz oled2_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
628 movlw b'00001100'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
629 dcfsnz oled2_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
630 movlw b'00010000'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
631 dcfsnz oled2_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
632 movlw b'00010100'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
633 dcfsnz oled2_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
634 movlw b'00100000'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
635 dcfsnz oled2_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
636 movlw b'00111111'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
637 movwf oled4_temp
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
638
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
639 rrcf oled4_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
640 rrcf oled1_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
641
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
642 rrcf oled4_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
643 rrcf oled1_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
644
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
645 rrcf oled4_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
646 rrcf oled1_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
647
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
648 rrcf oled4_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
649 rrcf oled1_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
650
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
651 rrcf oled4_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
652 rrcf oled1_temp,F ; Red done.
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
653
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
654 movff oled1_temp,win_color1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
655 movff oled3_temp,win_color2 ; Set Bank0 Color registers...
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
656 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
657