Greetings all,
I have recently acquired a MCUFRIEND variant 3.5" inch TFT LCD Touch Screen Shield for UNO/MEGA from eBay. The controller is identified as RM68140 320x480 ID=0x6814.
Forgive me if this has been asked before, and I have looked, but what is the reason it runs so slow on the MEGA2560?
One poster suggested the pins are in no particular order and require bit shifts and masks which slow things down (?)
I have successfully run the display with the following results reported by Deadbeef:
Arduino Due 4.90s
Arduino Duemilanove 15.07s
Arduino Mega2560 37.24s
As you can see, the Mega is the slowest, but I need the pins. The Duemilanove with a 328P actually runs a slower clock, but the improved performance is quite acceptable for my application.
Any way I can speed up the MEGA2560? Your suggestions would be very welcome.
Duncan McAllister
Toronto
You chose to buy a Uno shield and then run it on a non-Uno Arduino.
If you want to use a Mega2560, surely you would choose to buy a Mega2560 Shield !
The RM68140 is slower than most other 320x480 controllers.
Deadbeef reports 6.7s when using a Mcufriend mega2560 Shield on a Mega2560 @ 16MHz.
This is VERY different to the Mcufriend Uno Shield on a Mega2560 @ 16MHz.
There are practical limits to these controllers. The RM68140 Uno Shield will not do much better than 2.00s (with an Xmega @ 62MHz)
I have explained how to make a Uno Shield Adapter with a Mega2560 ProtoShield. This will give "almost" as good performance as a proper Mcufriend mega2560 shield.
The real mystery is: Why would anyone ever choose a MEGA2560 board?
It has horrible 5V GPIO.
It has horrible big USB connector.
David.
David,
Just picking up on your comment.
"The real mystery is: Why would anyone ever choose a MEGA2560 board?
It has horrible 5V GPIO.
It has horrible big USB connector."
What do you suggest as a better choice as I also have a 3.5 inch TFT?
Most external electrronics are 3.3V
Life is much simpler if you do not need level shifters.
USB connectors are in 3 sizes. Nowadays, the mini or micro connectors are more common.
The big USB socket gets in the way of several shields.
I prefer the Due to Mega2560 but the SAM3X chip is becoming deprecated. I would not worry too much. I am sure that Arduino support will continue for many years.
I like the Zero but the SAMD21 chip is not much better than an AVR.
Nucleo boards from ST Microelectronics are excellent for prototyping. And the best part of all is that you can experiment with M0, M3, M4 chips and with different speeds and capabilities.
The Teensy3.x boards are excellent. But do not accept shields.
Incidentally, it is unfortunate that the Xmega has never been adopted by Arduino or Chinese cloners.
If Xmegas had ever appeared on Ebay/AliExpress market, people would appreciate their virtues.
David.
"You chose to buy a Uno shield and then run it on a non-Uno Arduino."
So what, exactly, is the difference? The eBay ad said "for Uno and Mega2560"
OK, so with an Uno board, it would run much faster and I would be able to use the display, touch screen and the SD card, correct?
But that leaves me with 2 analog and 2 digital pins, right? (If I tie reset to arduino reset).
I want to have an external ESP32 send periodic values to the Uno to be updated on the display.
My guess is that I can facilitate an SPI/I2C/Serial link between the two boards using the remaining few pins?
Thanks.
"The real mystery is: Why would anyone ever choose a MEGA2560 board?"
I use what parts I have in stock. Right now, I have 2 x MEGA2560, 1 x Due, 5 x Duemilanove.
I don't care about USB sizes. I'm not a big fan of shields in any case. I'm only using it because the displays come that way (plug and play). I prefer custom point-to-point wiring (see attached photo).
But level shifting is an issue. I chose the MEGA2560 thinking that it had more memory for apps and more pins for interfacing, not knowing that there were different displays for Uno and Mega, and I couldn't use the SD card to store the graphics.
I think I'll buy an Uno, or attempt to wire the display to an ESP or something. My one and only Due is already being used in the radio router in the picture.
Yes, I like the Due too. I think the libraries will be around for some time to come.
I suspect that you could accomplish everything with a ESP32 and SPI ILI9341 display.
In fact you could probably do it with a ESP8266.
Regarding Uno shield marketing. Yes, I can use Uno, Mega, Due, Nucleo...
I presume that Canadian schools teach you how to "interpret" advertising or Trumpisms.
If you ask a straightforward question you will get a straightforward answer on this forum.
It is your choice if you want to ignore it.
I presume that you are over school-age. You can understand that multiple bit mangling is going to take longer than a single PORTx = value. Hence my Xmega performance even @ 60MHz. It still beats a 180MHz Cortex-M4 with random pins.
David.
"You can understand that multiple bit mangling is going to take longer than a single PORTx = value. Hence my Xmega performance even @ 60MHz. It still beats a 180MHz Cortex-M4 with random pins."
This is the straightforward answer I was seeking. Thank you.
Yes, I am over school age. I'm 58, and have earned a living as a computer engineer my entire adult life.
Keep up the good work David.