Guten abend, ich habe mir bei dem Versandhaus meines Vertrauens einen Tft Display bestellt mit dem Controller ili9488, jetzt bin ich auf der suche nach einer Library für Bascom. Mr. Google konnte mir auch nicht weiterhelfen.... Vielleicht hat ja einer von euch eine gute idee das ding zum Laufen zu bekommen.
Steffen W. schrieb: > Vielleicht hat ja > einer von euch eine gute idee das ding zum Laufen zu bekommen. Eine Library von ILI9235 oder ILI9341 suchen und anpassen. Diese Controller sind dem ILI9488 sehr ähnlich, siehe auch Datenblatt. Um das Lesen des Datenblatts kommst du aber fast nicht herum, es sei denn der Schreiber hat schon für das ILI9488 mitgedacht. Hier auch etwas zum ILI9488: Beitrag "LCD 480x320 mit wenig Aufwand zum Anbinden"
Sooo, Ich habe mal ein wenig das Datenblatt durchsucht und Mr. Google gefragt... Nun habe ich ein kleinen Code der aber nicht läuft, vielleicht kann ja mal einer schauen wo das Problem liegt.
1 | $regfile = "m128def.Dat" |
2 | $hwstack = 128 |
3 | $swstack = 128 |
4 | $framesize = 128 |
5 | $crystal = 16000000 |
6 | $baud = 19200 |
7 | |
8 | '******************************************************************************* |
9 | 'Beginn der Library |
10 | |
11 | 'ILI9488 Library im 8Bit Paralel Modus |
12 | 'DBI = 101 |
13 | 'IM = 011 |
14 | '******************************************************************************* |
15 | |
16 | |
17 | |
18 | |
19 | '******************************************************************************* |
20 | 'Display Configuration |
21 | '******************************************************************************* |
22 | CSX alias Porte.4 |
23 | RESX alias Porte.3 |
24 | DCX alias porte.5 |
25 | WRX alias Porte.6 |
26 | RDX alias Porte.7 |
27 | |
28 | DATA_PORT alias PortC |
29 | |
30 | Const Wait_S = 150 |
31 | |
32 | Dim a as long |
33 | |
34 | '******************************************************************************* |
35 | 'Colors |
36 | '******************************************************************************* |
37 | Const Red = &HF800 |
38 | Const Green = &H07E0 |
39 | Const Blue = &H001F |
40 | Const White = &HFFFF |
41 | Const Black = &H0000 |
42 | Const Yellow = &HFFE0 |
43 | Const Cyan = &H0410 |
44 | Const Magenta = &H8010 |
45 | Const Brown = &HFC00 |
46 | Const Olive = &H8400 |
47 | |
48 | Const Bright_red = &HF800 |
49 | Const Bright_green = &H07E0 |
50 | Const Bright_blue = &H001F |
51 | Const Bright_yellow = &HFFE0 |
52 | Const Bright_cyan = &H07FF |
53 | Const Bright_magenta = &HF81F |
54 | |
55 | Const Light_gray = &H8410 |
56 | Const Dark_gray = &H4208 |
57 | Const Light_blue = &H841F |
58 | Const Light_green = &H87F0 |
59 | Const Light_cyan = &H87FF |
60 | Const Light_red = &HFC10 |
61 | Const Light_magenta = &HFC1F |
62 | |
63 | Const Gray0 = &HE71C |
64 | Const Gray1 = &HC618 |
65 | Const Gray2 = &HA514 |
66 | Const Gray3 = &H630C |
67 | Const Gray4 = &H4208 |
68 | Const Gray5 = &H2104 |
69 | Const Gray6 = &H3186 |
70 | |
71 | Const Blue0 = &H1086 |
72 | Const Blue1 = &H3188 |
73 | Const Blue2 = &H4314 |
74 | Const Blue3 = &H861C |
75 | |
76 | Const Cyan0 = &H3D34 |
77 | Const Cyan1 = &H1DF7 |
78 | |
79 | Const Green0 = &H0200 |
80 | Const Green1 = &H0208 |
81 | |
82 | |
83 | '******************************************************************************* |
84 | 'Config Pins |
85 | '******************************************************************************* |
86 | config CSX = output |
87 | config RESX = output |
88 | config DCX = output |
89 | config WRX = output |
90 | config RDX = output |
91 | config DATA_PORT = output |
92 | |
93 | CSX = 1 |
94 | RESX = 1 |
95 | DCX = 0 |
96 | WRX = 0 |
97 | RDX = 1 |
98 | DATA_PORT = 0 |
99 | |
100 | '******************************************************************************* |
101 | 'Subs for Display |
102 | '******************************************************************************* |
103 | Declare Sub LCD_Init() |
104 | Declare Sub LCD_Clear(byval Color as Word) |
105 | Declare Sub Write_LCD_Command(byval Command as Byte) |
106 | Declare Sub Write_LCD_Data(byval Command as Byte) |
107 | |
108 | |
109 | |
110 | '******************************************************************************* |
111 | 'Start Programm |
112 | '******************************************************************************* |
113 | |
114 | waitms 5 |
115 | resx = 0 |
116 | waitms 100 |
117 | resx = 1 |
118 | waitms 100 |
119 | |
120 | csx = 1 |
121 | wrx = 1 |
122 | CSX = 0 |
123 | |
124 | call Write_LCD_Command(&h11) 'Exit Sleep |
125 | waitms 200 |
126 | call Write_LCD_Command(&hD1) 'VCOM |
127 | call Write_LCD_Data(&h00) 'SEL/VCM |
128 | call Write_LCD_Data(&h0C) 'VCM |
129 | call Write_LCD_Data(&h0F) 'VDV |
130 | |
131 | call Write_LCD_Command(&hD0) 'Power Setting |
132 | call Write_LCD_Data(&h07) |
133 | call Write_LCD_Data(&h04) |
134 | call Write_LCD_Data(&h00) |
135 | |
136 | call Write_LCD_Command(&h36) 'Power Setting |
137 | call Write_LCD_Data(&h48) |
138 | ' 48 = 0b01001000 |
139 | ' 0 - top to bottom |
140 | ' 1 - right to left |
141 | ' 0 - normal mode of columns order |
142 | ' 0 - refresh top to bottom |
143 | ' 1 - RGB or BGR (here BGR order) |
144 | ' 0 - <skip> |
145 | ' 0 - no hflip |
146 | ' 0 - no flip |
147 | |
148 | call Write_LCD_Command(&hE0) |
149 | call Write_LCD_Data(&h00) |
150 | call Write_LCD_Data(&h04) |
151 | call Write_LCD_Data(&h0E) |
152 | call Write_LCD_Data(&h08) |
153 | call Write_LCD_Data(&h17) |
154 | call Write_LCD_Data(&h0A) |
155 | call Write_LCD_Data(&h40) |
156 | call Write_LCD_Data(&h79) |
157 | call Write_LCD_Data(&h4D) |
158 | call Write_LCD_Data(&h07) |
159 | call Write_LCD_Data(&h0E) |
160 | call Write_LCD_Data(&h0A) |
161 | call Write_LCD_Data(&h1A) |
162 | call Write_LCD_Data(&h1D) |
163 | call Write_LCD_Data(&h0F) |
164 | |
165 | call Write_LCD_Command(&hE1) |
166 | call Write_LCD_Data(&h00) |
167 | call Write_LCD_Data(&h1B) |
168 | call Write_LCD_Data(&h1F) |
169 | call Write_LCD_Data(&h02) |
170 | call Write_LCD_Data(&h10) |
171 | call Write_LCD_Data(&h05) |
172 | call Write_LCD_Data(&h32) |
173 | call Write_LCD_Data(&h34) |
174 | call Write_LCD_Data(&h43) |
175 | call Write_LCD_Data(&h02) |
176 | call Write_LCD_Data(&h0A) |
177 | call Write_LCD_Data(&h09) |
178 | call Write_LCD_Data(&h33) |
179 | call Write_LCD_Data(&h37) |
180 | call Write_LCD_Data(&h0F) |
181 | |
182 | call Write_LCD_Command(&hB1) |
183 | call Write_LCD_Data(&hB0) |
184 | |
185 | call Write_LCD_Command(&hB4) |
186 | call Write_LCD_Data(&h02) |
187 | |
188 | call Write_LCD_Command(&hF7) |
189 | call Write_LCD_Data(&hA9) |
190 | call Write_LCD_Data(&h51) |
191 | call Write_LCD_Data(&h2C) |
192 | call Write_LCD_Data(&h82) |
193 | |
194 | call Write_LCD_Command(&hB0) |
195 | call Write_LCD_Data(&h00) |
196 | |
197 | call Write_LCD_Command(&h3A ) ' Set pixel format |
198 | call Write_LCD_Data(&h55 ) |
199 | call Write_LCD_Command(&hC1 ) ' Display timing setting for normal/partial mode |
200 | call Write_LCD_Data(&h41 ) |
201 | call Write_LCD_Command(&hC0 ) ' Set Default Gamma |
202 | call Write_LCD_Data(&h18 ) |
203 | call Write_LCD_Data(&h16 ) |
204 | call Write_LCD_Command(&hC5 ) ' Set frame rate |
205 | call Write_LCD_Data(&h00 ) |
206 | call Write_LCD_Data(&h1E ) |
207 | call Write_LCD_Data(&h80 ) |
208 | call Write_LCD_Command(&hD2 ) ' Power setting |
209 | call Write_LCD_Data(&h01 ) |
210 | call Write_LCD_Data(&h44 ) |
211 | call Write_LCD_Command(&hC8 ) ' Set Gamma |
212 | call Write_LCD_Data(&h04 ) |
213 | call Write_LCD_Data(&h67 ) |
214 | call Write_LCD_Data(&h35 ) |
215 | call Write_LCD_Data(&h04 ) |
216 | call Write_LCD_Data(&h08 ) |
217 | call Write_LCD_Data(&h06 ) |
218 | call Write_LCD_Data(&h24 ) |
219 | call Write_LCD_Data(&h01 ) |
220 | call Write_LCD_Data(&h37 ) |
221 | call Write_LCD_Data(&h40 ) |
222 | call Write_LCD_Data(&h03 ) |
223 | call Write_LCD_Data(&h10 ) |
224 | call Write_LCD_Data(&h08 ) |
225 | call Write_LCD_Data(&h80 ) |
226 | call Write_LCD_Data(&h00 ) |
227 | call Write_LCD_Command(&h2A ) |
228 | call Write_LCD_Data(&h00 ) |
229 | call Write_LCD_Data(&h00 ) |
230 | call Write_LCD_Data(&h01 ) |
231 | call Write_LCD_Data(&h3F ) |
232 | call Write_LCD_Command(&h2B ) |
233 | call Write_LCD_Data(&h00 ) |
234 | call Write_LCD_Data(&h00 ) |
235 | call Write_LCD_Data(&h01 ) |
236 | call Write_LCD_Data(&hDF ) |
237 | call Write_LCD_Command(&h29 ) 'display on |
238 | call Write_LCD_Command(&h2C ) 'display on |
239 | |
240 | |
241 | 'Malen==================== |
242 | call Write_LCD_Command(&h2a) ' Set_column_address |
243 | call Write_LCD_Data(&h10) |
244 | call Write_LCD_Data(&h00) |
245 | call Write_LCD_Data(&h20) |
246 | call Write_LCD_Data(&h00) |
247 | call Write_LCD_Command(&h2b) ' Set_page_address |
248 | call Write_LCD_Data(&h10) |
249 | call Write_LCD_Data(&h00) |
250 | call Write_LCD_Data(&h20) |
251 | call Write_LCD_Data(&h00) |
252 | call Write_LCD_Command(&h2c) ' Write_memory_start |
253 | |
254 | for a = 0 to 1000 |
255 | call Write_LCD_Data(&hF8) |
256 | call Write_LCD_Data(&h0) |
257 | next a |
258 | |
259 | CSX = 1 |
260 | Do |
261 | |
262 | |
263 | Loop |
264 | |
265 | |
266 | |
267 | '******************************************************************************* |
268 | 'Subs for Display |
269 | '******************************************************************************* |
270 | Sub LCD_Init() |
271 | |
272 | End Sub |
273 | |
274 | |
275 | Sub LCD_Clear(byval Color as Word) |
276 | |
277 | End Sub |
278 | |
279 | |
280 | Sub Write_LCD_Command(byval Command as Byte) |
281 | CSX = 0 |
282 | DCX = 0 |
283 | WRX = 0 |
284 | |
285 | Data_port = Command |
286 | waitus Wait_s |
287 | WRX = 1 |
288 | waitus Wait_S |
289 | |
290 | |
291 | End sub |
292 | |
293 | |
294 | Sub Write_LCD_Data(byval Command as Byte) |
295 | CSX = 0 |
296 | DCX = 1 |
297 | WRX = 0 |
298 | |
299 | Data_port = Command |
300 | waitus Wait_s |
301 | WRX = 1 |
302 | waitus Wait_S |
303 | |
304 | |
305 | |
306 | End sub |
Du hast es unterlassen zu beschreiben wie du das Display angeschlossen hast. Wie sollen wir dann wissen ob dein Programm zur Hardware passt und funktioniert?
CS -> PE4 RST -> PE3 D/CX -> PE5 WR -> PE6 RD -> PE7 D0 -> PC0 . . . . . D7 -> PC7
Guten abend nochmal, eben ist mir aufgefallen das bei dem oben stehendem Code der Display etwas dunkler wird, aber sonst nichts.. :( weiß niemand eine Lösung?
Ich würde ja gern helfen und habe auch ein paar Erfahrungen mit diesen LCDs, aber die Syntax dieses Basics ist mir zu undurchsichtig und ich habe kein Lust dafür jetzt Basic zu lernen oder mir Bascom zu kaufen um das nachzuvollziehen. Hier nur eins: In beiden Fällen wo geschrieben wird ----------------------- CSX = 0 DCX = 1 WRX = 0 Data_port = Command waitus Wait_s WRX = 1 waitus Wait_S ----------------------- fällt auf dass zuerst Chip Select und Write aktiv low gezogen und dann erst Daten geschrieben werden. Da sträuben sich jeden Bus- Designer die Haare bzw stellen sich die Zehennägel auf. Also wenn es nach dem Papst ging dann sollten erst Daten anliegen dann der CS aktiviert und dann erst ein Write Zyklus ausgeführt werden. Danach (zweite verdächtige Stelle:) sollte der CS auch wieder deaktiviert werden. ----------------------- Data_port = xxxxxx .... Rem Datum auf Port ausgeben DCX = xxxxxx ... Rem Data oder Command Modus auswählen CSX = 0 Rem Chip Select aktivieren WRX = 0 Rem Write Zyklus fallende Flanke waitus Wait_s Rem Write Zyklus Verzögerung WRX = 1 Rem Write Zyklus beenden steigende Flanke CSX = 0 Rem Chip Select deaktivieren ----------------------- Ob das die Lösung aller deiner Probleme ist weiss ich nicht ...
Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.