Nucleo-64 L476RG + ILI9486 4" Waveshare touch display, any libs?

Development environment specific, Arduino, Eclipse, VS2013, Em::Blocks etc
Post Reply
WilliamH
Posts: 7
Joined: Fri Aug 20, 2021 9:28 pm

Nucleo-64 L476RG + ILI9486 4" Waveshare touch display, any libs?

Post by WilliamH »

Hello

Just got the Nucleo-64 L476RG and it seem to communicate with the computer since I can get its board info except the model number and I think all the settings for the board in Arduino IDE (that was something new) is fine as well but it was not easy to find any info on those.

But all the examples I have in Arduino IDE are for the Mega2560 that I used before so they are no good for a SMT32 and is most likely why I get two errors if I even try to compile a simple LED blink code:

"Error while detecting libraries included by C:\.."
"open C:\Users\William\AppData\Local\Temp\arduino_build_352307\preproc\ctags_target_for_gcc_minus_e.cpp: file could not be found."
Error compiling for board Nucleo-64.


But it would have been really fun to try the "Mandelbrot" lib example with 5 times higher frequency from the the TFT_HX8357 lib, and that lib has really good examples so I really can understand the code for a project I'm doing.


I would really like to be able to use examples like those that are in the TFT_HX8357 lib (or wherever working ones) that is for the Mega2560 but for the Nucleo board and a Waveshare 4" touch display (https://www.waveshare.com/4inch-tft-touch-shield.htm) with also touch working of course, any ideas? And in similar easy fashion as with ex the Mega2560 where it usually just works. I'm still a newb so treat me thereafter. :) But I understand quite good anyway.

Have searched and I'm a little surprised that there are not as much libs for nucleo-64 or similar as it is for the Mega2560, I mean the Nucleo isn't that new, but maybe the Due get all the attention instead.

Anyone know if its possible what I'm looking for?

So any lib for the Nucleo-64 L476 working together with a waveshare ILI9486 incl its touch?

Thanks!

Regards William
mrburnette
Posts: 633
Joined: Thu Dec 19, 2019 1:23 am
Answers: 7

Re: Nucleo-64 L476RG + ILI9486 4" Waveshare touch display, any libs?

Post by mrburnette »

The STM32 official core examples are here:
https://github.com/stm32duino/STM32Examples

I must leave it to other members to discuss the: https://www.arduino.cc/reference/en/lib ... e-ili9486/
WilliamH
Posts: 7
Joined: Fri Aug 20, 2021 9:28 pm

Re: Nucleo-64 L476RG + ILI9486 4" Waveshare touch display, any libs?

Post by WilliamH »

Thanks missed that one. But the problem I have is that I want to use the TFT_HX8357 lib for the Waveshare display that is controlled over SPI but the TFT_HX8357 controls through parallell.
GonzoG
Posts: 403
Joined: Wed Jan 15, 2020 11:30 am
Answers: 26
Location: Prudnik, Poland

Re: Nucleo-64 L476RG + ILI9486 4" Waveshare touch display, any libs?

Post by GonzoG »

The only library that I found that works in Arduino IDE is their own library.
I just had to add pin definitions in library .cpp file. I've used it with f103 blue pill and I've added this:

Code: Select all

#elif defined ARDUINO_ARCH_STM32
	constexpr unsigned int LCD_CS = PA4; //  LCD Chip Select
	constexpr unsigned int LCD_BL = PA3;  //  LCD Backlight
	constexpr unsigned int LCD_RST = PA1;  //  LCD Reset
	constexpr unsigned int LCD_DC = PA0;  //  LCD Data/Control

	constexpr unsigned int TP_CS = PB3;
	constexpr unsigned int TP_IRQ = PB4;
	constexpr unsigned int TP_BUSY = PB5;

	constexpr unsigned int SD_CS = PB6;
You'll have to set correct pins for your board.
sheepdoll
Posts: 32
Joined: Fri Dec 20, 2019 6:47 pm

Re: Nucleo-64 L476RG + ILI9486 4" Waveshare touch display, any libs?

Post by sheepdoll »

I have some HX8357B displays sold by earthLCD as TDT320. These use a 9 bit serial protocol as some of the IMO configuration signals are not on the FPC cable. I also have a bunch of adafruit and Radio shack ILI9486 displays.

When working with these displays, I find that it works best to separate them into different abstraction layers.

The low level hardware layer. Usually SPI, can be bit banged or one of the hardware sections like on the STM32F429 fixed memory controller or direct TFT interface. This is the code what talks to the registers and turns a pixel on and off. The IMO lines (usually three) determine what mode the display connects with. I find it best to use cubeMX to set up the interface -- even when I am using arduino code.

The adafruit library layer (Or the StemWin graphics layer) this is what does the basic line and text drawing. All of these libraries handle the so called "Bottleneck" procedures that hearken back to Quickdraw and postscript. This library takes the on/off pixel at location x,y and turns it into dots, lines circles, triangles rects roundrects etc. This is the library that is most often edited as it needs to send the data to the low level hardware layer and is where the difference between parallel and serial read happens. If you compare/diff the adafruit libaries, you can see what parts are fixed and called by the app, and which areas are dynamic and talk to the hardware registers.

There is also a touch screen layer which is an overlay that is independent of the graphics, other than the calibration points. This can be a subject unto itself. The best ones use a separate controller.

Last is the application layer, this is what put everything together. Arduino uses C++ objects to handle the abstractions, Almost all drawing calls the "Bottleneck" procedures. Once you identify these, the rest is trivial.

If you have a hobby display, then usually you have access to the IMO lines you can change the mode from serial to parallel. If you have a display that surplus, recycled or pull from something, then these probably can not be accessed and you have to use what is given. There are a number of tutorials on the adafruit page, along with the data sheets that detail this.

-julie
WilliamH
Posts: 7
Joined: Fri Aug 20, 2021 9:28 pm

Re: Nucleo-64 L476RG + ILI9486 4" Waveshare touch display, any libs?

Post by WilliamH »

Thanks for that information Julie, very informative! And thanks GonzoG as well.

Have also found the TFT_eSPI lib that should work with, among many other boards, Nucleo-64. But it show that I can't even upload anything to it, it doesn't matter what I do even a simple blink won't work so I have to dig into that before anything else, have no idea what is wrong, sigh. I can get the board info from the Nucleo so I assume it communicating with the board it doesn't say the model but I get the rest, I don't get it.
ag123
Posts: 1653
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: Nucleo-64 L476RG + ILI9486 4" Waveshare touch display, any libs?

Post by ag123 »

normally these days, it is about a google search away
https://www.youtube.com/watch?v=oyb5AZcuNdk
https://github.com/jaretburkett/ILI9488
https://github.com/Bodmer/TFT_eSPI
https://github.com/stm32duino/Arduino_Core_STM32
https://www.waveshare.com/w/upload/7/78 ... asheet.pdf

nearly most of them are derivatives from Adafruit_ILI9341
https://cdn-shop.adafruit.com/datasheets/ILI9341.pdf
https://github.com/adafruit/Adafruit_ILI9341
https://github.com/ag88/Adafruit_ILI9341_SPI_stm32duino

Adafruit_GFX is nearly a 'defacto standard' these days of a 'lcd api'
it may still take some work to compare between ili9486 vs ili9341 figure out the differences and maybe make updates in the library.
it takes some effort but not that difficult

oh and there is this particular thing about the lcd reset pin, you need to do a lcd reset using the pin before initialization or at least pass the lcd reset pin to the lib during the lcd initialization.this is probably the 'secret' to making it work.
i've tested this prior, if the lcd reset from the pin is not done, the lcd returns 'garbage' in response to 'status' commands.
pull that lcd reset pin low and back, run the initialization (e.g. simply pass the pin to the lib) everything works
this probably has to do with the spi baud rates sync at the lcd end.

and of course last but not least, this assumes blinking a led on the board and all should be 'childs play' before u'd embark on working the lcd.
complicated mcus like stm32 has lots to offer, it hardly seem to run 'out of features' for particular needs. sometimes what takes extra external components on other mcus can be completely done on chip in stm32. e.g. stm32 has a RTC, all it takes is a good 32k crystal and you have a builtin accurate clock. then it has an internal temperature sensor, vbat sensor and more.
WilliamH
Posts: 7
Joined: Fri Aug 20, 2021 9:28 pm

Re: Nucleo-64 L476RG + ILI9486 4" Waveshare touch display, any libs?

Post by WilliamH »

Thanks for the links, didn't knew many of them was derived from Adafruit_ILI9341, good to know. And I have absolutely searched and found many of your links as well before and also that TFT_eSPI that contain all what I need and should work with the Nucleo which is perfect, so that is most likely solved now.

But as I wrote so can I not program the board, first time it spit out some errors but I found a page where it mentioned any virus protection program that could have put any files in quarantine, and that was the case that it had. After fixing that so did everything compile (took a hell of long time even with only blink though which didn't make sense since and I'm also on a fast computer) but the "finished" compiled program is 0bytes and thus (I assume) didn't program the Nucleo. Have never seen anything like that, solved one problem and another emerge.
WilliamH
Posts: 7
Joined: Fri Aug 20, 2021 9:28 pm

Re: Nucleo-64 L476RG + ILI9486 4" Waveshare touch display, any libs?

Post by WilliamH »

Ok its fixed now and programming work. :) It was the virusprogram that was the guilty one, because after i disabled it completely and reinstalled the STM32 core "blink" work and I can now finally test the libs I have. And I expect the TFT_eSPI to work with Nucleo-64 since that lib has many settings for just this model.

Thanks all of you guys for the very good help in this!

Regards William
Post Reply

Return to “IDE's”