What is a suitable microcontroller to display graphics on an LCD?

Thread Starter

Bill_the_Bear

Joined Jul 1, 2013
4
Hi Guys,

First post! I'm looking for some advice.

I'm interested in a project to make a digital speedo using a small LCD (say, smartphone size) and a microcontroller. What I'm having trouble with is finding a suitable microcontroller for this kind of project. I want to use an LCD with around 640x480 or similar resolution and given some inputs (off the top of my head: velocity, fuel level, oil pressure) to the microcontroller have it display the information graphically like a speedo.

I'm guessing it would require a higher level of processing power than normal, and some kind of support for graphics would be needed. I've tried extensive google searches, but not got anywhere. I either find basic projects to program a 2 line monochrone text output, or I find highly technical describptions of articles telling me all of the things they support and don't support but I have no idea what any of this is and therefore what I should or should not be looking for.

Can anyone help, either by recommending a microcontroller, or by pointing me to someone else who has embarked on a similar project?

I should probably mention my experience. I did a microcontroller project at uni about 10 years ago, but the system was provided for me so the task for selected one with appropriate features never came up. Also it didn't involve a display. I use VBA on a daily basis and used to do C++. I really love writing code so can learn anything I need provided there is reasonable documentation.

Thanks
Bear.
 

donpetru

Joined Nov 14, 2008
185
I recommend choosing one ARM that offers a broad spectrum of design and computing power to match. For example, STM32F407 by STMicroelectronics. It is an ARM that has a good price and that fits with the requirement exposed.
 

ErnieM

Joined Apr 24, 2011
8,377
I've done this twice: once in B&W using a PIC18 and another in color with a PIC32.

The hardware is almost trivial: 8 data lines (some can use 16) along with 2-3 control lines is all that is needed. Some even work over very simple serial interfaces. The software is the devil: I wrote my own B&W routines over several weeks, the color code all came from Microchip's free libraries. So whatever you choose make sure you get some backup.

Displaying just some widgets such as a meter or a button is not very memory intensive, showing a movie is. But them, SD cards give you a huge amount of memory.


PIC32 running graphic display for a clock:

 

Attachments

Thread Starter

Bill_the_Bear

Joined Jul 1, 2013
4
ErnieM:

Did you just display static images from a file, or did you generate the image on the fly? I want to be drawing the image based on some input. The refresh rate would have to be high, say 30Hz so that I can redraw the needle on my speedo fast enough to give a smooth animation, preferably so it would appear to be mechanical, not an image at all.

If the boards you mention can handle this I'll get hold of one and start to play.

Cheers!
 

ErnieM

Joined Apr 24, 2011
8,377
Did you just display static images from a file, or did you generate the image on the fly?
Making the clock a smooth experience took a bit of work to keep any drawing artifacts off the screen.

As far as I remember (that clock was a few years back) it started with a Yahoo image search for a nice old school clock picture. That was edited to remove the hands, and make the face color uniform across the entire face; it has a subtle variation that needed to be eliminated so a single color could refresh a blank area.

Then there are 4 elements to be drawn: the hour, minute, and second hands, and the central dot. Each second the second hand needs be undrawn (ie, draw it again but in the face color), each minute the minute hand, and each hours the hour hand.

That by itself looked terrible, since both the minute and second hands draw over the numbers, so the numbers get blanked out. Redrawing the entire clock face plus the hand elements wasn't smooth. You could see this or that part change and change again each second.

There are several ways to get around that, one of the best called "double buffering" where you draw the next screen on a temporary memory area, and when it is complete copy the entire frame to the display. I didn't do that...

So a refresh of the numbers was done by adding 12 smaller bitmaps of each number itself. First the hands were undrawn. Then the number area that needed to be refreshed (between zero to two) were overdrawn with the fresh small bitmap. Finally the new hands were drawn. Just doing these small tasks happened fast enough so the drawing did not rip or tear or flash.

I want to be drawing the image based on some input. The refresh rate would have to be high, say 30Hz so that I can redraw the needle on my speedo fast enough to give a smooth animation, preferably so it would appear to be mechanical, not an image at all.
Really, it doesn't need be anywhere that fast. That's true for video, but all you have for a speedometer is a needle point on a relatively slow changing event: ask yourself just how long it takes to go from zero to sixty, then how many screen pixels that change is. No way that needs 30Hz. The display I used (it's a Microelectronica development board plus some goodies I added to the back) has a sample program where it plays 15Hz video so it's no slouch.
 

Thread Starter

Bill_the_Bear

Joined Jul 1, 2013
4
Thanks! Sounds promising. Got somewhere to start from now.

It also occurred to me that searching for "micro-controller lcd" probably wasn't a great strategy. I figured out that if you wanted to make a game, say 'pong' using a micro-controller, then you'd have similar problems to overcome. Sure enough searching "micro-controller game" gave a lot more useful results.

I think the sensible thing to do is start small, getting a small lcd to work using one of the boards you suggested. Then when I've understood that to move on to a VGA size screen about 7-8 inches which might need a more powerful board I guess.

If I do get it working well then got to figure out the outputs from a car and think about miniaturising everything, but thats way off.

Cheers again!
 

MrChips

Joined Oct 2, 2009
30,823

Thread Starter

Bill_the_Bear

Joined Jul 1, 2013
4
Hi MrChips,

Just checking I've got this right. The examples you give are add-ons for uC boards, is that correct?

So for example with the STM option:

I'd need to acquire the STM32F4 DISCOVERY board, which this LCD attaches too?

The Raspberry Pi link mentioned driving an lcd from the uC is taxing, but doing it this way is not because the lcd is combined with an on board controller. What does the on board controller do that then frees up the uC?

Apologies if I'm asking something basic here. Unfortunately I'm completely ignorant when it comes to how to drive a display but I want to understand enough before buying an lcd and controller so I can get the right one.

Thanks again!
 

MrChips

Joined Oct 2, 2009
30,823
I think you have the right idea. There are actually two separate issues and two decisions to be made, the choice of MCU (microcontroller unit) and choice of LCD.

Every LCD module is simply that, a graphics display module that comes with its own driver circuitry. This is only to get the pixels to turn on. You still need the intelligence to determine what to draw on the screen. That is what the MCU does.

Hence you need to select a MCU module and a LCD module.
Connecting (interfacing) the two can be problematic. If you choose an MCU that already has a physcial LCD interface then that is one hurdle taken care of.

The other hurdle is to find the right graphics libraries. If you are an experienced C programmer then it is not difficult to write your own.
 

mcgyvr

Joined Oct 15, 2009
5,394
is there any alternate method to add graphics without using C program ??? ,, Because I don't know C language :(
Your question is really vague...
You will more than likely have to know/learn some programming language..
Plenty of tutorials,etc... for an Arduino with TFT shields,etc...
I like the 4D systems TFT displays... (it even has its own IDE in which you don't have to know any language..sort of)
I'm using one of their 4.3" touch screens with the Arduino.. I didn't have to know any programming to create a GUI on the screen that I just sent/receive information to/from the Arduino over serial
 

Art

Joined Sep 10, 2007
806
If you’re talking a single hand moving in circular motion it can be done with any micro controller, any dot matrix LCD, and in any language.
So get yourself any micro controller, any LCD, and learn any language :D
 
Top