LVGL V8.1 with PIC32MZ and Touchscreen screen

I’m creating a small project to use lvgl 8.1 and in the future to let it opensource for peolple to have an example. I’m hobbist and I like to repare an example for people like student or any one would used the LVGL instead of the Microchip. After several month to try to display something using the Harmony 3 from Microchip unsucessfull, I have decide to use LVGL . In few hour I was able to display widget on screen.

For my project, I’m using the following component:

MCU : PIC32MZ2048EFM144
TFT : (800x480) 7"TFT Screen Touch LCD Display Module w/SSD1963 Controller Board
TouchScreen : FT5206 controller

My project public repository :

The project actually display just a button. I’m block with the FT5206. No action is occuring when I push the button.
I don’t found what is missing or wrong.

Some one can help me and don’t hesitate to update the project?

Best regards

Go from source, at first:

  • FT generate signal at INT output?.
  • MZ go to FT interrupt routine?.
  • Is any conversation on I2C after interrupt?
  • FT generate signal at INT output?.
    Yes, I have tested setting a led. If I touch the screen the led is lighting.
  • MZ go to FT interrupt routine?.
    It’s the problem. Seams not working. I don’t understand how to do the setup to archive this call
  • Is any conversation on I2C after interrupt?
    Due the previous issue, this steps not occurs.

If you have no reaction then I suppose that you not turn on this interrupt. You use harmony to configuration? if manual, then look here Setting up an external interrupt on PIC32MZ [Solved] | Microchip

In last week I try to begin project on PICMZ DA, I made touch int by change notyfication clicked from harmony.


I use Harmony 3

Should I call the function “void ft5206_read(lv_indev_drv_t * indev_drv, lv_indev_data_t * data)” inside my interrupt MZ?

On Harmony I have created a function for the callback interrupt :
void controlLED(GPIO_PIN pin, uintptr_t context)
/* Turn OFF LED */
if(CTP_INT_Get() == 1)
// LED_Toggle();

Then I have declare this function to the interrupt.

GPIO_PinInterruptCallbackRegister(CTP_INT_PIN, controlLED, (uintptr_t)NULL);

When I touch the screen the led is blinking (I have checked with an oscilloscope)

I understand good?. LED was blinking from your int calback, right?. If yes, then your interrupt works well. So first issue is that you watch for 1 logic state. FT chip have falling or low activ state
Change 1 to 0 in:
if(CTP_INT_Get() == 0)

or simple delete this line, if you set int as falling mode.

FT5206 function comes from LVGL lib or it’s your code?. I never use LVGL but I see that custome touch driver in H3 match well to FT chip (need to configure register shift, etc). At output they “inject” X,Y and interrupt reason (touch/detouch/finger on the screen) to other GFX lib. I think that you can easy use it in other like H3 function.

Yes LED was blicking from my callback.
My disficulty is to understand how the lvgl trigger the action from the interrupt.
I have set disp_drv.flush_cb = ssd1963_flush; /Set your driver function/
at the initialisation.

As far as i know lvgl does not use touch interrupt. lt continuously reads the touch at a definition rate(30 hz for example). Unless they implemented touch interrupt now.


That’s correct.

Thanks for all your reply. Then if I understand well, the following declaraction is enough to trigger an action event :

static lv_indev_drv_t indev_drv;           /*Descriptor of a input device driver*/
lv_indev_drv_init(&indev_drv);             /*Basic initialization*/
indev_drv.type = LV_INDEV_TYPE_POINTER;    /*Touch pad is a pointer-like device*/
indev_drv.read_cb = ft5206_read;           /*Set your driver function*/
lv_indev_drv_register(&indev_drv);         /*Finally register the driver*/

Knowing that ft5206_read is my rountines to read the controller FT5206?

The function ft5206_read is not triggered then nothing appens.

I don’t found the root cause why this association is not working

indev_drv.read_cb = ft5206_read; /Set your driver function/

On your reply , you explain that the call is do every x rate. It’s not occuring.
Do you know what’s setup is missing or some orientation?

Best regards,