[Logo] TCC discussion forum
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Top Downloads] Top Downloads   [Groups] Back to home page 
[Register] Register /  [Login] Login 


This forum is read only and new users cannot register, please ask all new questions either using GitHub discussions, or in Arduino forum tagging @davetcc.

Menu rendering issue w. the Generator for AdafruitGFX quick start on ILI9341 LCD shield (Adafruit Product ID 1651) RSS feed
Forum Index » tcMenu Designer UI
Author Message
atmosphericengineering


Joined: Nov 27, 2022
Messages: 11
Offline
Hi, I'm a new user and first let me congratulate Dave Cherry et. al. for some fantastic software engineering.
Last week I had quick project success using an Arduino Mega with 16x2 LCD shield with built-in cursor and enter buttons. Now I'm trying my previous project with a rotary encoder (which I've tested as ok) and a 320x240 LCD shield, which has a built-in resistive touchscreen which I'm not using here.
I've tried all reasonable combinations of themes but the best result I get is my project title rendered at the top of the LCD with all subsequent menu items missing. Operating the rotary encoder and selection button has no effect with this ILI9341 LCD. I realise this Adafruit 1651 LCD shield is old hardware but its good value and all I've got atm. I've spotted that your website documentation describes the ILI9341 as "no frame buffer". However the Adafruit documentation describes the 1651 shield as "This display shield has a controller built into it with RAM buffering".
My hardware is all OK as the Adafruit graphicstest example works fine.
Has anyone had any success using an Arduino Mega board with an Adafruit 1651 LCD shield (ILI9341) and/or any ideas to try and make the menus appear and render properly? Thanks for reading.
atmosphericengineering


Joined: Nov 27, 2022
Messages: 11
Offline
UPDATE: I should have done this earlier but I've gone down to an empty user application and I do get menu rendering using the Dark Mode Traditional for small to medium color displays theme. Even with this empty user applications there are some issues such as during editing the Use sliders for analog items appearing ragged and the numeric values can overlay earlier values so that they cannot be easily read e.g. changing from a 3 to a 4 renders the 4 over the previous 3 and produces a corrupted character. Also I have colour palettes seemingly randomly changing and the Mega / Display crashing, sometimes every few minutes. Any ideas on how to proceed / debug? Or is this Adafruit 1651 LCD shield going to be unusable with tcmenu?
davetcc


Joined: Jan 19, 2019
Messages: 686
Offline
We’ve never really tried to generate a high resolution Color TFT graphic display onto an 8bit device but at least theoretically nothing should stop it from working. That display is probably the one we test with the most. What you describe doesn’t sound right. Could you take a photo of the screen with the faulty characters please and attach here. I’ll look into the other issues later. Please also could you zip up the empty project and attach that too so I can take a look at that too.
atmosphericengineering


Joined: Nov 27, 2022
Messages: 11
Offline
Thanks for your reply. Apologies. My previous "empty" application wasn't completely empty and I was also attaching a servo on D9. This clashed with the LCD shield. Once this was removed my empty application now renders tcmenu correctly and reliably.
I'll get to work on what is causing my full application stopping tcmenu from rendering and report back.
atmosphericengineering


Joined: Nov 27, 2022
Messages: 11
Offline
Hi Dave, its interesting that you say that the 320x240 ILI9341 LCD is one you've tested with. I'm using the SPI version, have you tested with this one and/or the parallel interface version?

I've modified my application to run with tcmenu with hardware interrupts on D2 and D3 to detect two reed switches, and a single FreeRTOS task to read and write on Serial at 9600 baud. I can observe my app Serial print output ok, but so far I cant get any Serial reading to work at all. Do you have any ideas or comments about being unable to do Serial reads on a single FreeRTOS task? Thanks.
davetcc


Joined: Jan 19, 2019
Messages: 686
Offline
To be honest we only test with the SPI version on Arduino, with modern hardware and the TFT_eSPI library extremely high speeds can be obtained. On mbed we have an example that uses the STM32F4 LTDC frame buffer hardware (it acts as an ARM peripheral with DMA and memory mapping), the results as you would expect are exceptional, and the boards "STM32F429 DISC1" are pretty cheap with an inbuilt hardware debugger. We also test with Adafruit GFX as well, as a lot of users use that library.

Using FreeRTOS on a Mega 2560? That would seem quite a small board to use a multithreaded OS with, personally, I only use FreeRTOS on much larger boards (STM32F4, ESP32, RPI Pico). Something to bear in mind, some parts of Arduino are not thread-safe, using the Serial object on another thread I've not tried, you'd certainly not want to use it ever on any more than one thread, and there could well be assumptions about what thread it is running on. Especially on a MEGA 2560. I would just use a regular task manager task instead and use Serial.available() to check if anything is there, it does not block.

Something like

taskManager.scheduleFixedRate(10, [] {
    while(Serial.available()) {
        // read a byte from serial here and process..
    }
});


Even within TcMenu, the assumption is that the core rendering code always runs on the main thread. Task manager integrates pretty well with FreeRTOS, so run a task manager loop on the main thread, and then you can offload work using CircularBuffers to be done on other threads.
atmosphericengineering


Joined: Nov 27, 2022
Messages: 11
Offline
SOLVED: Thanks Dave for your great advice. I moved my FreeRTOS serial task to the tcmenu taskManager schedule as you suggested and I can now read from Serial ok. I also restored the baud rate from 9600 to my original 115200 and all was still ok. I haven't tried optimisation like CircularBuffers yet and it still works ok. Thanks again. I'll report back on any optimisations I try later.
 
Forum Index » tcMenu Designer UI
Go to:   
Mobile view
Powered by JForum 2.7.0 © 2020 JForum Team • Maintained by Andowson Chang and Ulf Dittmer

This site uses cookies to analyse traffic, serve ads by Google AdSense (non-personalized in EEA/UK), and to record consent. We also embed Twitter, Youtube and Disqus content on some pages, these companies have their own privacy policies.

Our privacy policy applies to all pages on our site

Should you need further guidance on how to proceed: External link for information about cookie management.