TFT 480 X 320 falsche farben ILI9481

Gast #3314043
Lesenswert?

Hallo,
habe dieses Display
http://www.ebay.de/itm/271237495675?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649

und muss in der Software gelb nehmen wenn ich blaue Schrift will, und 
weiß als Hintergrund wählen, wenn ich schwarz will..
Was währen hier die möglichen Fehler?

Ich steuer es mit 16 Bit an
Gast #3314051
Lesenswert?

achso und mir Mikropascal, also keine direkten ASM Zugriffe oder 
sowas..sonder ich wähle die Farbe gelb oder rote etc
1
program ATXMEGA128A3_fist_try;
2

3
{ Declarations section }
4

5
// TFT display connections
6

7
var TFT_16bit_DataPort_Lo : byte at PORTB_OUT;
8
var TFT_16bit_DataPort_Hi : byte at PORTC_OUT;
9
var TFT_16bit_WR : sbit at PORTE_OUT.B1;
10
var TFT_16bit_RD : sbit at PORTE_OUT.B0;
11
var TFT_16bit_CS : sbit at PORTE_OUT.B3;
12
var TFT_16bit_RS : sbit at PORTE_OUT.B6;
13
var TFT_16bit_RST : sbit at PORTE_OUT.B4;
14

15
var TFT_16bit_DataPort_Lo_Direction : byte at PORTB_DIR;
16
var TFT_16bit_DataPort_Hi_Direction : byte at PORTC_DIR;
17
var TFT_16bit_WR_Direction : sbit at PORTE_DIR.B1;
18
var TFT_16bit_RD_Direction : sbit at PORTE_DIR.B0;
19
var TFT_16bit_CS_Direction : sbit at PORTE_DIR.B3;
20
var TFT_16bit_RS_Direction : sbit at PORTE_DIR.B6;
21
var TFT_16bit_RST_Direction : sbit at PORTE_DIR.B4;
22
// End of TFT display connections
23

24

25
begin
26
  { Main program }
27
    // Internal oscillator selection procedure
28
  OSC_CTRL := 0x02;  // 32MHz internal RC oscillator
29
   while RC32MRDY_bit = 0 do nop;
30

31
  CPU_CCP := 0xD8;   // The CCP register must be written with the correct signature to enable change of the protected
32
                     // I/O register or execution of the protected instruction for a maximum of 4 CPU instruction cycles.
33
  CLK_CTRL := 1;     // Internal oscillator
34

35
// Initialize 240x320 TFT display
36
TFT_Init_ILI9481(320,240);
37

38
delay_ms(10);
39
TFT_16bit_Set_Default_Mode();
40

41
while (TRUE) do                           // Endless loop
42
    begin
43
    TFT_16bit_Set_Font(@TFT_16bit_defaultFont, CL_blue_16bit, FO_HORIZONTAL_16bit);
44
    TFT_16bit_Write_Text('TFT 16-bit LIBRARY DEMO, WELCOME !', 0, 0);
45
        delay_ms(1000);
46
     TFT_16bit_Fill_Screen(CL_white_16bit);
47
        delay_ms(300);
48
    end;
49
end.

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren