[Solved] Possible bug on the TFT library?

General discussion on mikroBasic PRO for PIC.
Post Reply
Author
Message
Darklakebridge78
Posts: 138
Joined: 12 May 2007 14:04
Location: Italy
Contact:

[Solved] Possible bug on the TFT library?

#1 Post by Darklakebridge78 » 23 May 2020 20:18

Hello everyone!
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 ... :shock:

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

Attached are photos of how the image looks on the display ... I tried to use the 180 ° rotation library but the rotated image is always mirror ...
Attachments
Display.jpg
Display.jpg (143.45 KiB) Viewed 835 times
Mikromedia Work Station.jpg
Mikromedia Work Station.jpg (267.78 KiB) Viewed 835 times
MikroC PRO for PIC, MikroC PRO for dsPIC, MikroC PRO for PIC32, MikroC PRO for ARM, Visual TFT, Visual GLCD,
http://www.teolab.it

Darklakebridge78
Posts: 138
Joined: 12 May 2007 14:04
Location: Italy
Contact:

Re: [Solved] Possible bug on the TFT library?

#2 Post by Darklakebridge78 » 23 May 2020 20:28

I solved the problem with this initialization:

Code: Select all

  TFT_Set_Default_Mode()
  TFT_Init(320,240)
I apologize for the post open for nothing ... :oops:
MikroC PRO for PIC, MikroC PRO for dsPIC, MikroC PRO for PIC32, MikroC PRO for ARM, Visual TFT, Visual GLCD,
http://www.teolab.it

Post Reply

Return to “mikroBasic PRO for PIC General”