annotate code_part1/OSTC_code_asm_part1/oled_samsung.asm @ 82:bc3092c41335

Cleaning up old wordprocessor to make it OLEDSim compatible.
author JeanDo
date Tue, 07 Dec 2010 13:22:17 +0100
parents 31fa973a70fd
children 3e351e25f5d1
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
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
51 word_processor: ; word_processor:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
52 clrf POSTINC2 ; Required!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
53 movff win_color2,win_color2_temp
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
54 movff win_color1,win_color1_temp
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
55 call main_wordprocessor ; C-Code
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
56 movlb b'00000001' ; Back to Rambank1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
57 movff win_color2_temp,win_color2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
58 movff win_color1_temp,win_color1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
59 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
60
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
61 ; -----------------------------
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
62 ; PLED_SetColumnPixel:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
63 ; -----------------------------
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
64 PLED_SetColumnPixel:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
65 movwf LastSetColumn ; d'0' ... d'159'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
66 movff LastSetColumn,win_leftx2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
67 movlw 0x21 ; Start Address Vertical (.0 - .319)
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
68 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
69 bcf STATUS,C
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
70 rlcf LastSetColumn,W ; x2 -> WREG
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
71 movlw d'0'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
72 btfsc STATUS,C ; Result >255?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
73 movlw d'1' ; Yes: Upper=1!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
74 rcall PLED_DatWrite ; Upper
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
75 bcf STATUS,C
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
76 rlcf LastSetColumn,W ; x2 -> WREG
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
77 rcall PLED_DatWrite ; Lower
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
78 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
79
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
80 ; -----------------------------
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
81 ; PLED_SetRow:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
82 ; -----------------------------
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
83 PLED_SetRow:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
84 movwf LastSetRow ; d'0' ... d'239'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
85 movff LastSetRow,win_top
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
86 movlw 0x20 ; Horizontal Address START:END
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
87 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
88 movlw 0x00
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
89 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
90 movf LastSetRow,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
91 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
92 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
93
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
94 ; -----------------------------
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
95 ; PLED Write Two Pixel
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
96 ; -----------------------------
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
97 PLED_PxlWrite:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
98 movlw 0x22 ; Start Writing Data to GRAM
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
99 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
100 bsf oled_rs ; Data!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
101 movff win_color1,PORTD
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
102 bcf oled_rw
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
103 bsf oled_rw ; Upper
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
104 movff win_color2,PORTD
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
105 bcf oled_rw
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
106 bsf oled_rw ; Lower
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
107
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
108 ; Reset Column+1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
109 movlw 0x21 ; Start Address Vertical (.0 - .319)
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
110 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
111 bcf STATUS,C
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
112 rlcf LastSetColumn,W ; x2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
113 movlw d'0'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
114 btfsc STATUS,C ; Result >256?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
115 movlw d'1' ; Yes!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
116 rcall PLED_DatWrite ; Upper
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
117 bcf STATUS,C
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
118 rlcf LastSetColumn,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
119 incf LastSetColumn,W ; x2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
120 rcall PLED_DatWrite ; Lower
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
121
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
122 ; Reset Row
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
123 movlw 0x20 ; Horizontal Address START:END
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
124 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
125 movlw 0x00
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
126 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
127 movf LastSetRow,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
128 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
129
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
130 ; Write 2nd Pixel on same row but one column to the right
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
131 movlw 0x22 ; Start Writing Data to GRAM
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
132 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
133 bsf oled_rs ; Data!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
134 movff win_color1,PORTD
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
135 bcf oled_rw
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
136 bsf oled_rw ; Upper
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
137 movff win_color2,PORTD
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
138 bcf oled_rw
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
139 bsf oled_rw ; Lower
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
140 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
141
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
142 ; -----------------------------
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
143 ; PLED Write One Pixel
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
144 ; -----------------------------
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
145 PLED_PxlWrite_Single:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
146 movlw 0x22 ; Start Writing Data to GRAM
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
147 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
148 bsf oled_rs ; Data!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
149 movff win_color1, PORTD
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
150 bcf oled_rw
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
151 bsf oled_rw ; Upper
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
152 movff win_color2, PORTD
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
153 bcf oled_rw
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
154 bsf oled_rw ; Lower
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
155 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
156
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
157 ; -----------------------------
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
158 ; PLED Display Off
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
159 ; -----------------------------
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
160 PLED_DisplayOff:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
161 clrf PORTD
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
162 bcf oled_hv
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
163 bcf oled_vdd
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
164 bcf oled_cs
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
165 bcf oled_e_nwr
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
166 bcf oled_rw
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
167 bcf oled_nreset
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
168 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
169
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
170 ; -----------------------------
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
171 ; PLED FRAME (win_color1 and win_color2)
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
172 ; -----------------------------
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
173 PLED_frame:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
174 movf box_temp+0,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
175 call PLED_set_color
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
176 ; draw right line from row top (box_temp+1) to row bottom (box_temp+2)
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
177 movff box_temp+1,draw_box_temp1 ; Store start row
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
178 PLED_frame2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
179 movf draw_box_temp1,W ; d'0' ... d'239'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
180 rcall PLED_SetRow ; Set Row
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
181 movf box_temp+3,W ; d'0' ... d'159'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
182 call PLED_SetColumnPixel ; Set left column
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
183 rcall PLED_PxlWrite_Single ; Write Pixel
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
184 incf draw_box_temp1,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
185 movf draw_box_temp1,W ; Copy to W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
186 cpfseq box_temp+2 ; Done?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
187 bra PLED_frame2 ; Not yet...
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
188
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
189 movf draw_box_temp1,W ; d'0' ... d'239'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
190 rcall PLED_SetRow ; Set Row
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
191 movf box_temp+3,W ; d'0' ... d'159'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
192 call PLED_SetColumnPixel ; Set left column
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
193 rcall PLED_PxlWrite_Single ; Write Pixel
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
194
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
195 ; draw left line from row top (box_temp+1) to row bottom (box_temp+2)
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
196 movff box_temp+1,draw_box_temp1 ; Store start row
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
197 PLED_frame3:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
198 movf draw_box_temp1,W ; d'0' ... d'239'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
199 rcall PLED_SetRow ; Set Row
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
200 movf box_temp+4,W ; d'0' ... d'159'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
201 call PLED_SetColumnPixel ; Set left column
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
202 rcall PLED_PxlWrite_Single ; Write Pixel
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
203 incf draw_box_temp1,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
204 movf draw_box_temp1,W ; Copy to W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
205 cpfseq box_temp+2 ; Done?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
206 bra PLED_frame3 ; Not yet...
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
207
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
208 movf draw_box_temp1,W ; d'0' ... d'239'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
209 rcall PLED_SetRow ; Set Row
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
210 movf box_temp+4,W ; d'0' ... d'159'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
211 call PLED_SetColumnPixel ; Set left column
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
212 rcall PLED_PxlWrite_Single ; Write Pixel
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
213
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
214 ; draw top line from box_temp+3 (0-159) to box_temp+4 (0-159)
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
215 movff box_temp+3,draw_box_temp1 ; Store start column
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
216 PLED_frame4:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
217 movf draw_box_temp1,W ; d'0' ... d'159'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
218 rcall PLED_SetColumnPixel ; Set Column
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
219 movf box_temp+1,W ; d'0' ... d'239'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
220 rcall PLED_SetRow ; Set Row
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
221 rcall PLED_PxlWrite ; Write 2 Pixels
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
222 incf draw_box_temp1,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
223 movf draw_box_temp1,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
224 cpfseq box_temp+4
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
225 bra PLED_frame4
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
226
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
227 ; draw bottom line from box_temp+3 (0-159) to box_temp+4 (0-159)
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
228 movff box_temp+3,draw_box_temp1 ; Store start column
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
229 PLED_frame5:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
230 movf draw_box_temp1,W ; d'0' ... d'159'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
231 rcall PLED_SetColumnPixel ; Set Column
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
232 movf box_temp+2,W ; d'0' ... d'239'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
233 rcall PLED_SetRow ; Set Row
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
234 rcall PLED_PxlWrite ; Write 2 Pixels
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
235 incf draw_box_temp1,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
236 movf draw_box_temp1,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
237 cpfseq box_temp+4
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
238 bra PLED_frame5
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
239
3
3cf8af30b36e v1.51 beta
heinrichsweikamp
parents: 2
diff changeset
240 call PLED_standard_color
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
241
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
242 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
243
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
244 ; -----------------------------
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
245 ; PLED Box (win_color1 and win_color2)
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
246 ; -----------------------------
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
247 PLED_box:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
248 movf box_temp+0,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
249 call PLED_set_color
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
250 ; /Define Window
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
251 movlw 0x35 ; VerticalStartAddress HIGH:LOW
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
252 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
253 movff box_temp+3,draw_box_temp1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
254 bcf STATUS,C
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
255 rlcf draw_box_temp1,W ; x2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
256 movlw d'0'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
257 btfsc STATUS,C ; Result >255?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
258 movlw d'1' ; Yes: Upper=1!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
259 rcall PLED_DatWrite ; Upper
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
260 bcf STATUS,C
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
261 rlcf draw_box_temp1,W ; x2 -> WREG
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
262 rcall PLED_DatWrite ; Lower
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
263
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
264 movlw 0x36 ; VerticalEndAddress HIGH:LOW
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
265 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
266 movff box_temp+4,draw_box_temp1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
267 bcf STATUS,C
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
268 rlcf draw_box_temp1,W ; x2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
269 movlw d'0'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
270 btfsc STATUS,C ; Result >255?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
271 movlw d'1' ; Yes: Upper=1!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
272 rcall PLED_DatWrite ; Upper
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
273 bcf STATUS,C
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
274 rlcf draw_box_temp1,W ; x2 -> WREG
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
275 rcall PLED_DatWrite ; Lower
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
276
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
277 movlw 0x37 ; HorizontalAddress START:END
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
278 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
279 movff box_temp+1,draw_box_temp1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
280 movf draw_box_temp1,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
281 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
282 movff box_temp+2,draw_box_temp1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
283 movf draw_box_temp1,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
284 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
285
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
286 movlw 0x20 ; Start Address Horizontal (.0 - .239)
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
287 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
288 movlw 0x00
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
289 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
290 movff box_temp+1,draw_box_temp1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
291 movf draw_box_temp1,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
292 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
293
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
294 movlw 0x21 ; Start Address Vertical (.0 - .319)
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
295 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
296 movff box_temp+3,draw_box_temp1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
297 bcf STATUS,C
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
298 rlcf draw_box_temp1,W ; x2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
299 movlw d'0'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
300 btfsc STATUS,C ; Result >255?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
301 movlw d'1' ; Yes: Upper=1!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
302 rcall PLED_DatWrite ; Upper
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
303 bcf STATUS,C
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
304 rlcf draw_box_temp1,W ; x2 -> WREG
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
305 rcall PLED_DatWrite ; Lower
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
306 ; /Define Window
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
307
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
308 ; Fill Window
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
309 movlw 0x22 ; Start Writing Data to GRAM
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
310 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
311
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
312 movff box_temp+1,draw_box_temp1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
313 movff box_temp+2,draw_box_temp2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
314 movf draw_box_temp1,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
315 subwf draw_box_temp2,F ; X length
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
316 incf draw_box_temp2,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
317
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
318 movff box_temp+3,draw_box_temp1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
319 movff box_temp+4,draw_box_temp3
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
320 movf draw_box_temp1,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
321 subwf draw_box_temp3,F ; Y length/2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
322
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
323 incf draw_box_temp3,F ; Last pixel...
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
324
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
325 bsf oled_rs ; Data!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
326
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
327 PLED_box2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
328 movff draw_box_temp3,draw_box_temp1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
329 PLED_box3:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
330 movff win_color1,PORTD
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
331 bcf oled_rw
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
332 bsf oled_rw ; Upper
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
333 movff win_color2,PORTD
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
334 bcf oled_rw
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
335 bsf oled_rw ; Lower
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
336
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
337 movff win_color1,PORTD
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
338 bcf oled_rw
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
339 bsf oled_rw ; Upper
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
340 movff win_color2,PORTD
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
341 bcf oled_rw
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
342 bsf oled_rw ; Lower
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
343
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
344 decfsz draw_box_temp1,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
345 bra PLED_box3
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
346 decfsz draw_box_temp2,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
347 bra PLED_box2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
348
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
349 movlw 0x00 ; NOP, to stop Address Update Counter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
350 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
351
3
3cf8af30b36e v1.51 beta
heinrichsweikamp
parents: 2
diff changeset
352 call PLED_standard_color
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
353 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
354
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
355 ; -----------------------------
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
356 ; PLED_ClearScreen:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
357 ; -----------------------------
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
358 PLED_ClearScreen:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
359 movlw 0x35 ; VerticalStartAddress HIGH:LOW
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
360 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
361 movlw 0x00
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
362 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
363 movlw 0x00
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
364 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
365
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
366 movlw 0x36 ; VerticalEndAddress HIGH:LOW
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
367 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
368 movlw 0x01
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
369 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
370 movlw 0x3F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
371 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
372
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
373 movlw 0x37 ; HorizontalAddress START:END
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
374 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
375 movlw 0x00
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
376 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
377 movlw 0xEF
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
378 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
379
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
380 movlw 0x20 ; Start Address Horizontal (.0 - .239)
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
381 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
382 movlw 0x00
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
383 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
384 movlw 0x00
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
385 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
386
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
387 movlw 0x21 ; Start Address Vertical (.0 - .319)
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
388 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
389 movlw 0x00
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
390 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
391 movlw 0x00
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
392 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
393
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
394 movlw 0x22 ; Start Writing Data to GRAM
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
395 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
396
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
397 bsf oled_rs ; Data!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
398
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
399 movlw d'10'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
400 movwf draw_box_temp3
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
401 PLED_ClearScreen2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
402 movlw d'30'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
403 movwf draw_box_temp2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
404 PLED_ClearScreen3:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
405 clrf draw_box_temp1 ; 30*10*256=76800 Pixels -> Clear complete 240*320
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
406 PLED_ClearScreen4:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
407
81
31fa973a70fd Kludges to emulate inexisting devices when debugged with the MPLAB software SIMulator.
JeanDo
parents: 3
diff changeset
408 clrf PORTD ; Need to generate trace here too.
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
409 bcf oled_rw
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
410 bsf oled_rw ; Upper
81
31fa973a70fd Kludges to emulate inexisting devices when debugged with the MPLAB software SIMulator.
JeanDo
parents: 3
diff changeset
411
31fa973a70fd Kludges to emulate inexisting devices when debugged with the MPLAB software SIMulator.
JeanDo
parents: 3
diff changeset
412 clrf PORTD ; Need to generate trace here too.
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
413 bcf oled_rw
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
414 bsf oled_rw ; Lower
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
415
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
416 decfsz draw_box_temp1,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
417 bra PLED_ClearScreen4
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
418 decfsz draw_box_temp2,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
419 bra PLED_ClearScreen3
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
420 decfsz draw_box_temp3,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
421 bra PLED_ClearScreen2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
422
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
423 movlw 0x00 ; NOP, to stop Address Update Counter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
424 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
425
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
426 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
427
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 Write Cmd via W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
431 ; -----------------------------
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
432 PLED_CmdWrite:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
433 bcf oled_rs ; Command!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
434 movwf PORTD ; Move Data to PORTD
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
435 bcf oled_rw
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
436 bsf oled_rw
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
437 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
438
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
439 ; -----------------------------
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
440 ; PLED Write Display Data via W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
441 ; -----------------------------
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
442 PLED_DataWrite:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
443
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
444 ; -----------------------------
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
445 ; PLED Data Cmd via W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
446 ; -----------------------------
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
447 PLED_DatWrite:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
448 bsf oled_rs ; Data!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
449 movwf PORTD ; Move Data to PORTD
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
450 bcf oled_rw
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
451 bsf oled_rw
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
452 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
453
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
454 ; -----------------------------
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
455 ; PLED boot
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
456 ; -----------------------------
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
457 PLED_boot:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
458 bcf oled_hv
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
459 WAITMS d'32'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
460 bsf oled_vdd
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
461 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
462 bcf oled_cs
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
463 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
464 bsf oled_nreset
3
3cf8af30b36e v1.51 beta
heinrichsweikamp
parents: 2
diff changeset
465 ; WAITMS d'10' ; Quick wake-up
3cf8af30b36e v1.51 beta
heinrichsweikamp
parents: 2
diff changeset
466 WAITMS d'250' ; Standard wake-up
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
467 bsf oled_e_nwr
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
468 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
469 bcf oled_nreset
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
470 WAIT10US d'2'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
471 bsf oled_nreset
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
472 WAITMS d'10'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
473
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
474 movlw 0x24 ; 80-System 8-Bit Mode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
475 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
476
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
477 movlw 0x02 ; RGB Interface Control (S6E63D6 Datasheet page 42)
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
478 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
479 movlw 0x00 ; X X X X X X X RM
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
480 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
481 movlw 0x00 ; DM X RIM1 RIM0 VSPL HSPL EPL DPL
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
482 rcall PLED_DatWrite ; System Interface: RIM is ignored, Internal Clock
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
483
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
484 movlw 0x03 ; Entry Mode (S6E63D6 Datasheet page 46)
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
485 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
486 movlw 0x00 ; =b'00000000' CLS MDT1 MDT0 BGR X X X SS 65k Color
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
487 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
488 movlw b'00110000' ; =b'00110000' X X I/D1 I/D0 X X X AM
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
489 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
490
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
491 movlw 0x18
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
492 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
493 movlw 0x00
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
494 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
495 movlw 0x28
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
496 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
497
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
498 movlw 0xF8
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
499 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
500 movlw 0x00
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
501 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
502 movlw 0x0F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
503 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
504
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
505 movlw 0xF9
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
506 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
507 movlw 0x00
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
508 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
509 movlw 0x0F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
510 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
511
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
512 movlw 0x10
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
513 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
514 movlw 0x00
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
515 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
516 movlw 0x00
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
517 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
518
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
519 ; Now Gamma settings...
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
520 rcall PLED_brightness_full
2
d11ef8dc4b2c Bugfix: PC simulator
heinrichsweikamp
parents: 0
diff changeset
521 ;rcall PLED_brightness_low
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
522 ; End Gamma Settings
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
523
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
524 rcall PLED_ClearScreen
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
525
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
526 bsf oled_hv
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
527 WAITMS d'32'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
528
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
529 movlw 0x05
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
530 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
531 movlw 0x00
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
532 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
533 movlw 0x01
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
534 rcall PLED_DatWrite ; Display ON
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
535 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
536
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
537
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
538 PLED_brightness_full:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
539 movlw 0x70
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
540 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
541 movlw 0x1F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
542 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
543 movlw 0x00
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
544 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
545 movlw 0x71
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
546 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
547 movlw 0x23
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
548 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
549 movlw 0x80
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
550 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
551 movlw 0x72
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
552 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
553 movlw 0x2A
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
554 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
555 movlw 0x80
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
556 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
557
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
558 movlw 0x73
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
559 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
560 movlw 0x15
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
561 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
562 movlw 0x11
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
563 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
564 movlw 0x74
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
565 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
566 movlw 0x1C
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
567 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
568 movlw 0x11
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
569 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
570
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
571 movlw 0x75
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
572 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
573 movlw 0x1B
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
574 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
575 movlw 0x15
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
576 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
577 movlw 0x76
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
578 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
579 movlw 0x1A
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
580 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
581 movlw 0x15
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
582 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
583
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
584 movlw 0x77
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
585 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
586 movlw 0x1C
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
587 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
588 movlw 0x18
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
589 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
590 movlw 0x78
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
591 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
592 movlw 0x21
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
593 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
594 movlw 0x15
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
595 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
596
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
597 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
598
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
599 PLED_brightness_low:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
600 movlw 0x70
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
601 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
602 movlw 0x14
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
603 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
604 movlw 0x00
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
605 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
606 movlw 0x71
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
607 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
608 movlw 0x17
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
609 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
610 movlw 0x00
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
611 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
612 movlw 0x72
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
613 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
614 movlw 0x15
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
615 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
616 movlw 0x80
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
617 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
618
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
619 movlw 0x73
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
620 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
621 movlw 0x15
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
622 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
623 movlw 0x11
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
624 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
625 movlw 0x74
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
626 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
627 movlw 0x14
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
628 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
629 movlw 0x0B
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
630 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
631
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
632 movlw 0x75
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
633 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
634 movlw 0x1B
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
635 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
636 movlw 0x15
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
637 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
638 movlw 0x76
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
639 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
640 movlw 0x13
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
641 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
642 movlw 0x0E
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
643 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
644
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
645 movlw 0x77
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
646 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
647 movlw 0x1C
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
648 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
649 movlw 0x18
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
650 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
651 movlw 0x78
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
652 rcall PLED_CmdWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
653 movlw 0x15
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
654 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
655 movlw 0x0E
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
656 rcall PLED_DatWrite
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
657
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
658 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
659
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
660 PLED_set_color:;Converts 8Bit RGB b'RRRGGGBB' into 16Bit RGB b'RRRRRGGGGGGBBBBB'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
661 movwf oled1_temp ; Get 8Bit RGB b'RRRGGGBB'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
662 movff oled1_temp, oled2_temp ; Copy
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
663
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
664 ; Mask Bit 7,6,5,4,3,2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
665 movlw b'00000011'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
666 andwf oled2_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
667
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
668 movlw b'00000000'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
669 dcfsnz oled2_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
670 movlw b'01010000'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
671 dcfsnz oled2_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
672 movlw b'10100000'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
673 dcfsnz oled2_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
674 movlw b'11111000'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
675 movwf oled3_temp ; Blue done.
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
676
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
677 movff oled1_temp, oled2_temp ; Copy
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
678 ; Mask Bit 7,6,5,1,0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
679 movlw b'00011100'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
680 andwf oled2_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
681 rrncf oled2_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
682 rrncf oled2_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
683
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
684 movlw b'00000000'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
685 dcfsnz oled2_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
686 movlw b'00000100'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
687 dcfsnz oled2_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
688 movlw b'00001000'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
689 dcfsnz oled2_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
690 movlw b'00001100'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
691 dcfsnz oled2_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
692 movlw b'00010000'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
693 dcfsnz oled2_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
694 movlw b'00010100'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
695 dcfsnz oled2_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
696 movlw b'00100000'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
697 dcfsnz oled2_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
698 movlw b'00111111'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
699 movwf oled4_temp
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
700
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
701 rrcf oled4_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
702 rrcf oled3_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
703
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
704 rrcf oled4_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
705 rrcf oled3_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
706
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
707 rrcf oled4_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
708 rrcf oled3_temp,F ; oled3_temp (b'GGGBBBBB') done.
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
709
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
710 movff oled1_temp, oled2_temp ; Copy
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
711 clrf oled1_temp
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
712
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
713 rrcf oled4_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
714 rrcf oled1_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
715
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
716 rrcf oled4_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
717 rrcf oled1_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
718
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
719 rrcf oled4_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
720 rrcf oled1_temp,F ; Green done.
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
721
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
722 ; Mask Bit 4,3,2,1,0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
723 movlw b'11100000'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
724 andwf oled2_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
725
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
726 rrncf oled2_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
727 rrncf oled2_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
728 rrncf oled2_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
729 rrncf oled2_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
730 rrncf oled2_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
731
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
732 movlw b'00000000'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
733 dcfsnz oled2_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
734 movlw b'00000100'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
735 dcfsnz oled2_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
736 movlw b'00001000'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
737 dcfsnz oled2_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
738 movlw b'00001100'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
739 dcfsnz oled2_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
740 movlw b'00010000'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
741 dcfsnz oled2_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
742 movlw b'00010100'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
743 dcfsnz oled2_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
744 movlw b'00100000'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
745 dcfsnz oled2_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
746 movlw b'00111111'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
747 movwf oled4_temp
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
748
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
749 rrcf oled4_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
750 rrcf oled1_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
751
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
752 rrcf oled4_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
753 rrcf oled1_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
754
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
755 rrcf oled4_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
756 rrcf oled1_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
757
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
758 rrcf oled4_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
759 rrcf oled1_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
760
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
761 rrcf oled4_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
762 rrcf oled1_temp,F ; Red done.
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
763
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
764 movff oled1_temp,win_color1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
765 movff oled3_temp,win_color2 ; Set Bank0 Color registers...
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
766 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
767