Building a TinySDC Instance

Version 1.41 of SDC introduces a new display target which is called TinySDC. This target can be implemented in two forms;

  • By purchasing a pre-made device from the SDC Webstore
  • Build it yourself by purchasing the necessary components. You will still need an I/O hat, and a license from the Webstore if you want a decent frame rate.

This page describes how to buld your own TinySDC screen.

What is it?

TinySDC is a display device made from a 1.28” round SPI display screen. Due to its size, this display can fit inside a standard 52mm gauge pod making it possible to mount it alongside other existing dashboard gauges without having to mount a full SDC HDMI display in your dash.

You can of course mix and match TinySDC devices with other HDMI displays if you wish by using CANBus to share data between the displays.

Due to its size, this display is limited in what it can sensibly display, but all of the same tools are used and there is an example pageset (tinysdc.xml) in the SDC distribution as of version 1.41. You can actually display anything that an HDMI display can produce; even the example pagesets designed for larger HDMI screens will work, but they will of course be very small.

The frame rate of TinySDC is about 15 frames per second (5 fps on the free license). This is enough for it to display most things pretty well but obviously anything that moves around at a significantly higher rate is going to need a proper HDMI display running at 60fps. Support within the free license is provided primarily for people to test their own builds prior to making a purchase.

TinySDC screens have a resolution of 240x240 pixels.

Although SDC version 1.40 mentions TinySDC in the release notes, you must use SDC Version 1.41 or later to implement it, otherwise it won’t work.

Components

For an ideal installation, you will need the following (see Absolute Minimum if you just want to test it):

You can also optionally add a Rotary Encoder if you want to be able to change pages on the display. There are multiple ways this can be achieved though such as using a touch screen on another SDC installation, or an encoder on another installation (all via canbus), or via momentary buttons, or even by sending canbus messages from some other device you create. See the rest of the documentation for further details.

The official waveshare screens can be found on places such as Amazon but they are more expensive than the clones. Note that the clones are not exactly the same size, so if designing a case for one it may not fit the other correctly. They are close, but not exactly the same. The mount points are in a different location and the outline of the PCB is slightly different, by 1 millimetre or less.

If you want more than one TinySDC gauge, then you need CANBus support in your I/O Hat and License. This is so that data can be distributed between the devices as Speeduino cannot do this by itself.

Note that the AliExpress link to the cheaper screen is correct at the time of writing, but these listings are regularly taken down and recreated, so you may find the link is dead when you click it.

In the hope that you may be able to find the right product, it is currently described on AliExpress as “1.28 Inch IPS Color TFT LCD Display Module 1.28Inch RGB LED Round Screen 240x240 GC9A01 Drive 4 Wire SPI Interface”

The most important parts are the GC9A01 reference, and the SPI mention. GC9A01 is the driver IC that SDC has been written to work with, so in theory any round display which contains that driver IC and breaks out the SPI pins will work, although the only two that have been tested are the official WaveShare screen and the one linked above from AliExpress (seller Digital Antila Store). Note there are other screens that have a round display mounted on a rectangular board with a standard 2.54mm pin header on the bottom. These are untested and I do not know if they will work.

Here are some images of the Waveshare clone device:

Device Connections

To connect the TinySDC screen to your Pi, you will be using the SPI port. This SPI port is shared with the CANBus device so if you are using an I/O hat, you will need to use the pin header on the board that has specifically been added for TinySDC. You will find this 8 pin header at the bottom left of the board on I/O hats from version 1.6 onwards.

Connect the screen like this:

Description AliExpresss Screen Pin Name WaveShare Screen Pin Name Pi 40 pin header Pin NUmber I/O Hat 8 pin header number
Backlight Control BLK BL 12 8
Chip Select CS CS 24 3
Data/Command selector DC DS 22 5
Reset RES RST 13 7
Data Input SDA DIN 19 6
Clock SCL CLK 23 4
Power supply (3.3v) VIN VCC 3.3v (Pin 1) 1
Power Ground GND GND Any Ground Pin 2

If you already have an I/O Hat that does not have an 8 pin breakout

You can still connect to the SPI pins, but you will need to solder your connections directly to the top of the 40 pin header on the I/O Hat using the pin numbers in the above table and a Pi Pin Header diagram. If you go with this option, be sure to verify that you are looking at the Pi pins from the correct orientation. With the I/O hat mounted on top of the Pi, and the 40 pin header to the right, Pin 1 on the 40 pin header is top left, pin 2 is top right, and pin 3 is below pin 1.

If you don’t have an I/O hat

You can connect directly to the pins on the Pi’s header using the DuPont cables that come with the screen (especially if you are just beginning your bench testing or feasibility study). However, long term you will need an I/O hat in order to get data into the system from your Speeduino board and have better power control.

In lieu of purchasing an I/O hat, bench testing can be performed using either the default playback mode, or using the “tsusbserial” datasource (connection method) to get data from your speeduino. Note that tsusbserial will probably need some sort of usb adapter if you are trying to use a Zero2W to connect. Any of the model 3 devices will have a full sized USB port you can use.

Software Configuration

In order to enable TinySDC display mode, you must make a change to the cmdline.txt file that can be found in the \kernel folder of the SDC Micro SD Card. To change this file you must insert your SD card into your desktop PC and edit the file directly on the card (\kernel\cmdline.txt).

The cmdline.txt file must have one and only one line in the file. You will find it looks like this if you have just installed SDC:

SSID=<your ssid> KEY=<your password> COUNTRY=<your country code> SHELL_UPDATE_LOCAL_PATH=c:\kernel\ SHELL_UPDATE_HTTP_SERVER=192.168.1.118:8000 SHELL_UPDATE_HTTP_PATH=/ BOOTSCREEN=TRUE SPEEDYCONSOLE=FALSE FILESYS_LOGGING_FILE= HOST_NAME=sdc

Change the file so it looks like this:

SDCDISPLAYTYPE=TINYSDC SSID=<your ssid> KEY=<your password> COUNTRY=<your country code> SHELL_UPDATE_LOCAL_PATH=c:\kernel\ SHELL_UPDATE_HTTP_SERVER=192.168.1.118:8000 SHELL_UPDATE_HTTP_PATH=/ BOOTSCREEN=TRUE SPEEDYCONSOLE=FALSE FILESYS_LOGGING_FILE= HOST_NAME=sdc

So add the SDCDISPLAYTYPE=TINYSDC to the beginning of the line, ensuring that there is a space before SSID=

Once you have done this you can save the file back to the SD card.

At this point, if you haven’t already done so, you should follow the instructions for getting a connection to your WIFI network so that you can run SDC tools and make changes to the pageset. The tinysdc.xml pageset contains something suitable for the TinySDC display.

Once you are ready to put the SD card back into the Pi, make sure you safely eject it from your PC.

Booting the device will now put all output onto the round LCD screen. You should see the SDC boot logo first, and then you’ll see the currently selected pageset. If this is the demo pageset it will be pretty small. At this point you can start SDC Tools, follow the procedure to get a connection to the device, and make changes as you wish such as switching it to the tinysdc example pageset.

Note that if you happen to have an HDMI screen connected to your Pi, then the TinySDC output will also appear on the HDMI screen. Both displays will always display the same pageset. You might find this useful for design purposes and bench testing but it has little use otherwise and you would normally just use the TinySDC screen.

What can I do with it?

With a TinySDC screen, you can use pretty much any of the gauges and features that you can use on an HDMI screen. This includes alpha blending which is important for needle gauges to look good if you are using a bitmap as a needle.

All bitmaps should be in 32 bit ARGB format, just as they are for SDC HDMI displays.

You can use different truetype fonts and sizes as normal, and specify colours as on any HDMI screen. However some colours will be approximated as these small displays can only manage 65,535 colours (16 bit colour) instead of the full 24 bit colour that is possible on an HDMI screeen.

Gauges that update their position rapidly may be too fast for the maximum frame rate. This is just a limitation of these devices and there is little that can be done about it. Most values do not update that fast but if you wanted to sweep a needle around a dial smoothly you may struggle to get that to look smooth enough.

Absolute Minimum Implementation

For bench testing, an absolute minimum implementation would be:

  • Pi 3A+
  • 32Gb Micro SD Card (I like Samsung EVO they are good quality and good value).
  • SDC Version 1.41 or later
  • TinySDC Screen either Waveshare or Clone (see above)

With this implementation, you can use the playback mode of SDC to see data on the TinySDC display, and design a pageset for it.

By adding a USB cable appropriate for your device, you can additionally utilise the ‘tsusbserial’ datasource to receive data from your Speeduino. I do not recommend using the USB cable on a permanent basis as you’ll need the port for TunerStudio. Therefore you should look to transition to an I/O Hat for serial input and a Delayed Shutdown Module for a proper implementation. All I/O Hats have canbus support as standard at the time of writing, enabling future expansion into more gauges or screens.

If you sustitute the 3A+ for a Zero2W, these are cheaper but you’ll need an adapter or a different cable to connbect to the USB port as they are micro USB.

Some card manbufacturers don’t quite meet the SD standard perfectly so if you can’t get SDC to boot, then try a different brand of card.