Font Size Selector
AAAAA
Header

Technology, old cars, & other stuff...

00:00:00

Saturday 28 January

New Instrument Panel For The Mini

One of the OLED displays on the Mini's instrument panel failed so decided to replace the the two small OLEDs with a single larger colour display. Also deleted the mechanical tachometer.

Mini Istruments

The display is a 3.5" 480 x 320 TFT LCD by "mcufriend". With 153,600 16 bit pixels, it was obvious that my trusted Arduino 2560 didn't have the processing power to manipulate such a large quantity of data at an adequate update rate. I'd long wanted to try the ARM Cortex CPU's so this was the opportunity. Found that the NUCLEO boards seemed to fit the bill so bought an stm32 NUCLEO-F303K8. Also downloaded and installed the CubeMX IDE from ST microlectronics. The NUCLEO boards and CubeMX work together seamlessly and provide a superb development environment with a decent debugger, similar to that you'd expect in industry. CubeMX / stm32 are a clear step up from Arduino in performance and capability, albeit with a much steeper learning curve.

Although the NUCLEO-F303K8 was around 2x faster than the Arduino 2560, it still didn't have adequate power to drive the LCD with anything like the speed and update rate I required. Eventually settled for the NUCLEO-F411RE that proved more than adequate for the task.

The new panel was made from a piece of scrap laminate flooring with 3D printed parts for the LCD bezel, switch bezels and various other components. There's an ON/OFF switch on the left and the switch on the right is for selecting the required display format. Still has the GPS speedo and discrete warning lamps.

New panel

 

On the software side, decided I needed to develop own drivers & libraries as there didn't seem to be much available in the public domain that would suit my needs. The main format has horizontal linear scales for fuel level, engine temperature, battery, and air-fuel ratio. The numerics along the bottom are air temperature, manifold absolute pressure and sync errors. The outer dial on the right is RPM and the inner dial is throttle. All of the static elements are defined in a bitmap which is drawn once on initialisation. Its takes around 200ms to draw a 480 x 320 bitmap and the screen is updated in less than 50ms, so a refresh rate of 20Hz is possible.

The main difficulty in the software was in developing a radial pointer without the ragged edges you get without using computing-intensive anti-aliasing functions. All of the pointers in the above format use small bitmaps. In the case of the horizontal scales, there's no problem with aliasing as the orientation of the symbols doesn't change - so they appear as they would in Photoshop. Once you try to rotate the bitmaps, or draw straight lines, they can become very ugly at certain angles. After experimenting with various anti-aliasing methods, eventually settled on an averaging filter which was a good compromise between aesthetics and CPU time.

A 2nd format provides all the sensor data and other ECU parameters needed for diagnostics:

 

The stm32 software is here and includes:

  • An interface to ILI9486-based TFT LCD panel. Includes drawing primitives for triangles, lines, points, bitmaps and bitmap filtering.
  • A display controller that provides the various formats, linear scales, circular dials, text/ font control.

I also developed a C# Visual Studio desktop app that converts any image into a C array file that can be included in a build. This isn't in the zip file above but I'll supply it on request.

 

Privacy Notice

The elements of this website developed by Just Technology uses cookies to store user settings such as the requested font-size to enhance the usability of the site. For reqistered users, cookies are also used to identify the user's logged-in status.

The elements of this website developed by Just Technology do not attempt to access cookies sent to your computer by other websites you have visited nor will it try to obtain any other information from your computer for use by Just Technology or for passing on to any other party.

This website uses 3rd party software from Disqus, Twitter, and Facebook. The privacy policy of these vendors is therefore applicable to any facilities provided by these 3rd parties. Just Technology cannot provide any statement regarding protection of your privacy with respect to the facilities provided by these 3rd parties and cannot accept any responsibility for the way that any facility provided by them interacts with your computer or uses the information obtained from you or your computer.