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

Discussion in 'Embedded Systems and Microcontrollers' started by Bill_the_Bear, Jul 1, 2013.

  1. Bill_the_Bear

    Thread Starter New Member

    Jul 1, 2013
    4
    1
    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.
     
  2. donpetru

    Active Member

    Nov 14, 2008
    186
    25
    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.
     
    Bill_the_Bear likes this.
  3. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,386
    1,605
    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:

    [​IMG]
     
    absf and Bill_the_Bear like this.
  4. Bill_the_Bear

    Thread Starter New Member

    Jul 1, 2013
    4
    1
    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!
     
  5. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,386
    1,605
    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.

    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.
     
    Bill_the_Bear likes this.
  6. Bill_the_Bear

    Thread Starter New Member

    Jul 1, 2013
    4
    1
    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!
     
    ErnieM likes this.
  7. MrChips

    Moderator

    Oct 2, 2009
    12,414
    3,353
    Bill_the_Bear likes this.
  8. Bill_the_Bear

    Thread Starter New Member

    Jul 1, 2013
    4
    1
    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!
     
  9. MrChips

    Moderator

    Oct 2, 2009
    12,414
    3,353
    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.
     
  10. Sabari Nathan

    New Member

    Oct 8, 2015
    2
    0
    is there any alternate method to add graphics without using C program ??? ,, Because I don't know C language :(
     
  11. shteii01

    AAC Fanatic!

    Feb 19, 2010
    3,377
    494
    Sure. Use assembly.
    Or.
    Find program that someone else wrote, that does what you want and modify it to do what you want.
     
    Sabari Nathan and absf like this.
  12. Sabari Nathan

    New Member

    Oct 8, 2015
    2
    0
    Assembly means what ... can you please say about that ..?
     
  13. shteii01

    AAC Fanatic!

    Feb 19, 2010
    3,377
    494
    I am guessing you don't know it either.

    So to review:
    You don't know assembly.
    You don't know C.

    You want something done with LCD.
    I would guess you will have to hire someone or learn yourself.
     
    Robin66 likes this.
  14. mcgyvr

    AAC Fanatic!

    Oct 15, 2009
    4,769
    969
    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
     
  15. dannyf

    Well-Known Member

    Sep 13, 2015
    1,767
    356
    Plenty: every spectrometer does that for you.
     
  16. Art

    Distinguished Member

    Sep 10, 2007
    785
    61
    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
     
Loading...