Hallo Leute,
ich versuche ein 2.8 Zoll TFT mit dem ILI9341 anzusteuern, aber leider
ohne rechten Erfolg. Die Hardwarekommunition scheint zu gehen, ich kann
die Werte die ich in die Register geschrieben habe auch mit dem selben
Wert wieder auslesen.
Leider bin ich mir beim Setup der Register alles andere als sicher, und
möchte fragen, ob schon jemand mal Erfahrungen mit dem Controller
gesammelt hat. Offensichtlich gibt es da noch etwas, das ich übersehe.
Die Commandos werden auch irgendwie ausgeführt, webb ich beispielsweise
DISPLAY_ON (0x29) sende, dann dann ändert sich der Hintergrund von weiss
in ein komisches grau. Das war aber auch, was anderes kriege ich nicht
dargestellt.
Hier mal der Code den ich verwende, vllt fällt ja jemandem was auf:
1 | DisplayEnable();
|
2 |
|
3 | DisplaySetCommand();
|
4 | DeviceWrite(0x01); // Reset
|
5 | DelayMs(120); // Wait at least
|
6 |
|
7 | DisplaySetCommand();
|
8 | DeviceWrite(0x09); // Power Control
|
9 | mIDE_SET_INPUT();
|
10 | DisplaySetData();
|
11 | test = DeviceRead(); //
|
12 | test = DeviceRead(); //
|
13 | test = DeviceRead(); //
|
14 | test = DeviceRead(); //
|
15 |
|
16 | mIDE_SET_OUTPUT();
|
17 | DisplaySetCommand();
|
18 | DeviceWrite(0xC0); // Power Control
|
19 | DisplaySetData();
|
20 | DeviceWrite(0x26); // GVDD = 4.75V
|
21 |
|
22 | DisplaySetCommand(); // VCOM
|
23 | DeviceWrite(0xC1);
|
24 | DisplaySetData();
|
25 | DeviceWrite(0x11);
|
26 |
|
27 | DisplaySetCommand(); // VCOM
|
28 | DeviceWrite(0xC7);
|
29 | DisplaySetData();
|
30 | DeviceWrite(0xBE);
|
31 |
|
32 | DisplaySetCommand(); // Memory access control
|
33 | DeviceWrite(0x36);
|
34 | DisplaySetData();
|
35 | DeviceWrite(0x48); // 0048 my,mx,mv,ml,BGR,mh,0.0
|
36 |
|
37 | DisplaySetCommand(); // Pixel format
|
38 | DeviceWrite(0x3A);
|
39 | DisplaySetData();
|
40 | DeviceWrite(0x55); // 16bit per pixel
|
41 |
|
42 | DisplaySetCommand(); // Frame rate
|
43 | DeviceWrite(0xB1);
|
44 | DisplaySetData();
|
45 | DeviceWrite(0x00);
|
46 | DeviceWrite(0x1B); // 70
|
47 |
|
48 | DisplaySetCommand(); // Gamma
|
49 | DeviceWrite(0x26);
|
50 | DisplaySetData();
|
51 | DeviceWrite(0x01); // gamma set 4 gamma curve 01/02/04/08
|
52 |
|
53 | DisplaySetCommand(); // Pos. gamma correction
|
54 | DeviceWrite(0xE0);
|
55 | DisplaySetData();
|
56 | DeviceWrite(0x1F);
|
57 | DeviceWrite(0x1A);
|
58 | DeviceWrite(0x18);
|
59 | DeviceWrite(0x0A);
|
60 | DeviceWrite(0x0F);
|
61 | DeviceWrite(0x06);
|
62 | DeviceWrite(0x45);
|
63 | DeviceWrite(0x87);
|
64 | DeviceWrite(0x32);
|
65 | DeviceWrite(0x0A);
|
66 | DeviceWrite(0x07);
|
67 | DeviceWrite(0x02);
|
68 | DeviceWrite(0x07);
|
69 | DeviceWrite(0x05);
|
70 | DeviceWrite(0x00);
|
71 |
|
72 | DisplaySetCommand(); // Neg. gamma correction
|
73 | DeviceWrite(0xE1);
|
74 | DisplaySetData();
|
75 | DeviceWrite(0x00);
|
76 | DeviceWrite(0x25);
|
77 | DeviceWrite(0x27);
|
78 | DeviceWrite(0x05);
|
79 | DeviceWrite(0x10);
|
80 | DeviceWrite(0x09);
|
81 | DeviceWrite(0x3A);
|
82 | DeviceWrite(0x78);
|
83 | DeviceWrite(0x4D);
|
84 | DeviceWrite(0x05);
|
85 | DeviceWrite(0x18);
|
86 | DeviceWrite(0x0D);
|
87 | DeviceWrite(0x38);
|
88 | DeviceWrite(0x3A);
|
89 | DeviceWrite(0x1F);
|
90 |
|
91 | DisplaySetCommand(); // DDRAM
|
92 | DeviceWrite(0x2A);
|
93 | DisplaySetData();
|
94 | DeviceWrite(0x00);
|
95 | DeviceWrite(0x00);
|
96 | DeviceWrite(0x00);
|
97 | DeviceWrite(0xEF); // 239 columns
|
98 |
|
99 | DisplaySetCommand(); // DDRAM
|
100 | DeviceWrite(0x2B);
|
101 | DisplaySetData();
|
102 | DeviceWrite(0x00);
|
103 | DeviceWrite(0x00);
|
104 | DeviceWrite(0x01);
|
105 | DeviceWrite(0x3F); // 319 pages
|
106 |
|
107 | DisplaySetCommand(); // entry mode set
|
108 | DeviceWrite(0xB7);
|
109 | DisplaySetData();
|
110 | DeviceWrite(0x07);
|
111 |
|
112 | DisplaySetCommand(); // Display function control
|
113 | DeviceWrite(0xB6);
|
114 | DisplaySetData();
|
115 | DeviceWrite(0x0A);
|
116 | DeviceWrite(0x82);
|
117 | DeviceWrite(0x27);
|
118 | DeviceWrite(0x00); // 319 pages
|
119 |
|
120 | DisplaySetCommand();
|
121 | DeviceWrite(0x11); // Sleep out
|
122 | DelayMs(100); // Wait 120ms
|
123 |
|
124 | DeviceWrite(0x29); // Display on
|
125 | DelayMs(100); // Wait 120ms
|
126 | DeviceWrite(0x2C); //
|
127 | DisplayDisable();
|
Noch als Anmerkung: Die anderen Routinen zum schreiben etc. sind Teil
einer Graphik-Bib, die ich schon mit Erfolg mit einem S1D13748 verwendet
habe. Die sollte also auch nicht das Problem sein.
Gruß
Stampede