3.5" ILI9486 (allegedly) + Mega2560 = no go

Hello guys!

Have been dealing with this for quite some time now but only granted with a white screen so I must do something wrong or the display is simple broken. Haven't dealt with TFT screens before but they seemed to be easier to control then I though, if I can get one to work that is. Have gone through similar topic suggestions here but no one have used the same screen so no help there.

The screen look like this:

Have defined the pins for a the Mega but examples I have tried so are some names not existing on the TFT or vice-versa or can't find where to put them even if i normally find the places in some .h file.

Have tested fex some examples in mcufriedn_kbv (yea I know its for UNO but hey worth a try), some UTFT and what not but the TFT I have don't have the same pin names that many libs and examples needs so of course nothing works I guess. And the tft doesnt have "read" pin so It can't be identified either.

Anyone have a lib or just some extremely simple example that accepts the pins the screen have and that would guaranteed work with this TFT, just so I know that it work or just anything?

Thanks!

Oh, this new Forum is HORRIBLE.

Thanks for the photo. It means that we can recognise your actual hardware.

Install either UTFT library from RinkyDink i.e.
http://www.rinkydinkelectronics.com/library.php?id=51
Or TFT_HX8357 library from Bodmer i.e.

Unfortunately neither library is available from the IDE Library Manager. You have to install them manually.

I suggest that you start with UTFT examples e.g.
C:\Users\ ...\Documents\Arduino\libraries\UTFT\examples\Arduino (AVR)\UTFT_Demo_480x320\UTFT_Demo_480x320.ino

Edit the constructor statement from:

// Remember to change the model parameter to suit your display module!
UTFT myGLCD(CTE32HR,38,39,40,41);

to

    // Remember to change the model parameter to suit your display module!
    UTFT myGLCD(ILI9486,38,39,40,41);
  1. plug the shield into your Mega2560
  2. build and upload the sketch.

Now try all the other UTFT examples. Remember to edit the constructor statement in each sketch.

When you have UTFT working 100% you can try TFT_HX8357

  1. Edit User_Setup.h to define ILI9486
  2. Build and Run all of the TFT_HX8357 examples. You don't need to edit the sketches.

At each step, take notes with pencil and paper.

If you have a problem you can type from your notes.

David.

p.s. yes, MCUFRIEND_kbv is a lot more complicated to configure.

Thanks for the answer!

Will try the things you mention and the model parameter would be very good to change yes. But the numbers, I must know what goes to the RST, WR, CS, RS. I guess there is an order but I don't know what that would be and can't find any info in the lib either.

Hmm, might miss something here but I was not aware that I need to build it, kinda thought just change, save the file, probably restart IDE and the IDE would afterwards handle the newly changed files normally? How is that rebuild otherwise done?


Absolutely a photo because without it its just a guessing game that waste time for ppl that want to help.

Have not been on the forum for over a year but I wonder what the heck had happened, totally agree.

I showed you what to change. i.e. model argument.

That is why God invented Shields. You don't alter the RST, WR, CS, RS arguments.

You plug the Shield into the Mega2560 header sockets as Nature intended. Each male pin finds a female socket.

With any sketch you have to Compile and Upload it. "Build" is just another name for Compile. And since a compiled sketch runs as soon as it has been Uploaded, "Build and Run" is just another name for the right-arrow icon.

David.

I know that predefined known shield have known pin assignment and thus can easily be preprogrammed into a sketch, for example those made for the UNO, but what say that the RST, WR, CS, RS (and I guess the data pins as well) on a unknown TFT are at the exactly right pins as the sketch want it to be? Or is some kind of TFT standard or something? I'm not arguing with you I'm just curious.

Go on. The Earth is flat and the Moon is made from green cheese.

You plug an Arduino Mega2560 Shield into a Mega2560 Arduino and it connects all the signals correctly.

It works the same for every Mega2560 in every country in the World.

Obviously the Laws of Physics don't apply to India. What country are you in?

David.

p.s. Have you tried to plug the Mega2560 Shield into a Uno ?
What happens ?

Totally forgot that it of course was specifically made for the Mega2560, was so concentrated to make it work, and thus everything is designated right in the sketch, sorry. :grinning_face_with_smiling_eyes:

And everything works! The ILI9684 re-designation was that made it all, I had another UTFT before but it didn't have that part. Now its just to get this to work in and with other sketches as well but this was a very good bit on the way to do that since I now know the basic how to get this to work. Thanks a bunch! :slightly_smiling_face:

Now try TFT_HX8357. It has more intuitive methods. Better examples. And much FASTER.

David.

Gees, that graphic test was like night and day and quite cool as well, learned more things there and there was a lot of other good examples as well, really good!

Thanks once again!

/Kevin

If you ever buy an ESP32, STM32, RP2040 you can use Bodmer's TFT_eSPI library. Which is even MORE impressive.

David.

I will buy one as long as I find a Nucleo H7 or F7 board that is supported in Arduino and then I will absolutely try that lib, thanks!

Nucleo boards are nice to use. Consistent pinout. Onboard STLink-V2. OTG USB sockets, Ethernet, ... depending on Target STM32.

However there is no need for any MCU faster than 64MHz . You get the performance and throughput due to sensible use of DMA on the SPI peripheral.

If you choose an MCU with two Cores like ESP32, RP2040, ... you can do other tricks.

H7 and F7 give impressive processing performance but no advantage when it comes to SPI or Parallel.

You can get slightly faster throughput with a Parallel display at the expense of a lot of pins. You lose DMA.

David.

I have looked at the ESP32 as well and they are cool with the 2 cpus but they normally, as far as I have seen, don't have as many pins and I want at least as many pins as the Mega2560 has to be sure to have to anything you throw at it.

But I have reconsidered a little, it seem the F/H7 and 144 pins are little over the top and I don't really need that much power for now either. And also when you say it won't be much faster with a H7 and its clock I might go with the F4 instead and they can go up to over 80MHz anyway and are in the same range as the Mega2560 what goes for pins but much faster so perhaps they can take even a 800x600 screen Idk but I already ordered a Nucleo L476RG.

This topic was automatically closed after 120 days. New replies are no longer allowed.