Is it possible that in version 7.6.0 of MikroBasic PRO for PIC there is a bug on the TFT library? I tried to use an old Mikromedia board with PIC18FJ and TFT HX8347G on Work Station v.7 and the result after the initialisation is an inverted and mirror image ...
This is the code I used for initialization ...
Code: Select all
dim TFT_DataPort as char at PORTJ
dim TFT_DataPort_Direction as char at TRISJ
dim TFT_RST as sbit at LATD3_bit
dim TFT_BLED as sbit at LATC2_bit
dim TFT_RS as sbit at LATE0_bit
dim TFT_CS as sbit at LATD2_bit
dim TFT_RD as sbit at LATH1_bit
dim TFT_WR as sbit at LATH2_bit
dim TFT_RST_Direction as sbit at TRISD3_bit
dim TFT_BLED_Direction as sbit at TRISC2_bit
dim TFT_RS_Direction as sbit at TRISE0_bit
dim TFT_CS_Direction as sbit at TRISD2_bit
dim TFT_RD_Direction as sbit at TRISH1_bit
dim TFT_WR_Direction as sbit at TRISH2_bit
sub procedure InitMcu()
PLLEN_bit = 1
Delay_ms(150)
ANCON0 = 0xFF
ANCON1 = 0xFF
CM1CON = 0
CM2CON = 0
TFT_Set_Default_Mode()
TFT_Init_HX8347G(320,240)
end sub
sub procedure DrawFrame()
TFT_Fill_Screen(CL_WHITE)
TFT_Set_Pen(CL_BLACK, 1)
TFT_Line(20, 220, 300, 220)
TFT_LIne(20, 46, 300, 46)
TFT_Set_Font(@HandelGothic_BT21x22_Regular, CL_RED, FO_HORIZONTAL)
TFT_Write_Text("TEOLAB WIFI TEST",70,14)
TFT_Set_Font(@Verdana12x13_Regular, CL_BLACK, FO_HORIZONTAL)
TFT_Write_Text("EasyPIC Fusion v7",19,223)
TFT_Set_Font(@Verdana12x13_Regular, CL_RED, FO_HORIZONTAL)
TFT_Write_Text("www.teolab.it",210,223)
TFT_Set_Font(@TFT_defaultFont, CL_BLACK, FO_HORIZONTAL)
end sub