[SOLVED] SSD1936 + 7" TFT + Mega too slow

Hi everyone,

I recently bought a 7 inches TFT screen with a shield for a Mega :

My project is a dashboard for a race motorcycle. It works well “graphically”, touchscreen ok, but it’s too slow for this application, especially the big fonts displaying the RPM (four characters, 40x60 pixels) taking approximately 113ms.

It would be nice if it can takes less than 20ms, ( i won’t display it every 20ms, just to have extra time in my loop to do other things) i thought about using another library, modifying this one or using an Arduino Due.

Can someone help me ?

Thanks you,

Maxime

I think, for that display, you will need a faster processor and maybe more memory for screen buffer to speed it up by that much.

groundFungus:
I think, for that display, you will need a faster processor and maybe more memory for screen buffer to speed it up by that much.

Ok with the speed processor, but can you enlighten me about memory buffer ? I i don’t really get what happens between the MCU and the LCD, what is the basic operation for displaying a frame ?

Thanks !

113ms seems quite long for printing a 160x60 rectangle. The SSD1963 is very fast. The SSD1963 can handle 9600 pixels in < 0.5ms if you have a fast enough Arduino. 20ms is an achievable target with an AVR.

Which library are you using?
What font?

For something like a RPM or speed, you don’t want the numbers to change too often. Just give a display that is easy to read by a human.

If you are using a fixed-width font, you only need to update the digits that change. For example 9876 RPM to 9875 RPM only involves 6 changing to 5. But 8999 RPM to 9000 RPM involves all four digits.

David.

Hello, thanks you very much for your interest.

I’m using UTFT 2014, the last version didn’t work wery well. The font is SixteenSegment40x60 :

http://www.rinkydinkelectronics.com/r_fonts.php

I agree that i want RPM and speed to be displayed every 0.5 second maybe. But i want a fast display of the RPM gauge bar graph ( 94 filled rectangles of 78x2 ), maybe a refresh every 2 or 3ms.

About updating only the changed digits, i thought about it but i think i will get a display with variable time refresh, sometimes it will be fast, sometimes slow, but i keep this in mind if don’t find any other solution.

I’m currently trying to optimize the code, updating my rpm bar graph between each “big” print, (a bar displays in about 500 microseconds)

The RPM Bar graph will be very fast to update. You will never change more than one or two stripes at any update. The fuel gauge is very SLOW.

I note that your 40x60 is a single digit. My UTFT draws one digit in 23ms. Other libraries will be considerably faster.

Likewise, the 7-segment KPH and RPM should be less than 20ms for 4 digits. A single-digit update will be 5ms.

Only you know what is important for an ergonomic dashboard. I suspect that a rider judges RPM with her ears and not her eyes.

Yes, you will need to apply some intelligence to the software design. i.e. write a general update_numeric() helper function. UTFT should be fast enough. Other libraries are available.

David.

david_prentice: I note that your 40x60 is a single digit. My UTFT draws one digit in 23ms. Other libraries will be considerably faster.

Likewise, the 7-segment KPH and RPM should be less than 20ms for 4 digits. A single-digit update will be 5ms.

Only you know what is important for an ergonomic dashboard. I suspect that a rider judges RPM with her ears and not her eyes.

David.

The single digit "GEAR" is a 96x144. The RPM and SPEED are 40x60 digits. I did the test and i've got 23ms to print a 40x60 digit too. So my five single digits 40x60 are printed in 113ms. I have to manage to print RPM each digit individually with an intelligent sotware yes.

It's for a proto race motorcycle, 2 stroke V4 homemade. So i will have a lot a works to tune the bike, and i need more informations than usual.

A rider judges RPM with his ears, a race rider with ears and his eyes, sometimes you have to try different style to turn quickly, and try differents ways, differents rpm, different gears, it depends of your driving and your bike. That's why i would love to display RPM, if possible.

I didn't find any other libraries, which one are available for SS1963 and my mega ?

Maxime

My apologies. I guessed the sizes of fonts. i.e. SevenSegNumFont and SixteenSegment40x60 I ran UTFT with an 480x320 ILI9486 screen on a Mega2560. I can only run a 800x480 SSD1963 screen on a Due.

I still maintain that UTFT will have acceptable performance with a update_numeric() helper and a update_bar() helper.

David.

Okay i ll stuck with UTFT. Can you please tell me how many times it takes to your due with the SSD1963 and your 800x480 to print a 96x144 rectangle ? I'm starting to guess how i will structure my code now.

Edit : I'm thinking this way about refresh :

  • Bar graph rpm : as fast as possible
  • Speed : 1s
  • RPM : 0.5s
  • Gear : 1s
  • Fuel : 10s maybe, very slow
  • Status display : 1s
  • Others additional informations : 1s

Thanks !

Maxime

As I said. Only update when something has changed.

The worst case is when the RPM goes from 2999 to 3000 e.g. 92ms or whatever.

Yes, the RPM Bar will miss updating one stripe while the four digits are drawn. I doubt if your eyes would notice.

It would be inconvenient for me to hook up the Due. There is little point when you do not have the appropriate Due and Adapter.

It will take you 20 minutes to write and test an update_numeric() helper function.

I can only simulate your motorbike. e.g. increasing RPM at 1000 per second. How fast can your engine rev under load?

And I can use random() for the other values.

David.

Thanks you for your help, but i will simulate the motorbike myself with another arduino sending data via serial with my own protocol. Something like random value every 100mSec maybe.

I think i just have to admit that i won't be able to display synchronously my datas, and i will do as you said, i.e updating only if the data changed.

This bike should Rev to 12500 max, maybe 13k.

I think about something like this :

Read serial data and store it, Update Bah Rpm, If Newvalue1 != Oldvalue1 =>Udapte Value1, Update Bar Rpm, If Newvalue2 != Old value2 =>Udapte Value2, etc.

Just to manage how updating some of these values with different individual times. Is it the right way ?

Thanks.

Maxime

Edit : I programed this and it seems to work well, fast refresh of the bar rpm and the others when i desire, i added a time condition like the example "blink without delay", now i ll confirm this programing another arduino to send data via serial at a refresh rate of 100ms.

Jolly good.

Your simulation requires fast acceleration of the RPM. You will only glitch on a 4-digit change.
Perhaps random values for the other fields.

You can do the Simulation on the single Mega2560.
In loop() check millis() and increment / random at specific intervals. e.g.

     static uint32_t uptime;
     uint32_t t = millis();
     if (t > uptime) {
          uptime = t + 50;   //e.g. next update due in 50ms
          if (rpm < 14000) rpm += 47;      //suitable acceleration
          update_value(x, y, font, rpm);
     }

Yes, either a timer interrupt or an external Arduino will give more accurate results.

David.

I wanted to simulate with the other board to test the serial connection (got some bugs), it’s the first time i did this, sometimes i’ve got wrong values. Is it mandatory to implement a CRC ?

I just use a string like this : “H29902999610011900199929910029949005009990E” every 100ms,
H is the begining, E the ending, and the numbers all my data. Maybe my subroutine to read this string is wrong.

I will test only my board alone with random function to know if the serial is the problem or not next week.

Anyway, the display works pretty well, just a bit laggy. I still plan to use a DUE. You helped me a lot =).

Maxime