Contents

  1. Serial
  2. Display
  3. Configuring the screen type
  4. Controlled Shutdown

Serial

For use with Speeduino SDC requires a serial connection to the Speeduino ECU using the “Secondary Serial” port (often also referred to as “serial3”).

Connection of the serial ports between the Pi and the Arduino Mega is relatively easy but since the Pi is a 3.3v device, you must add a voltage divider to the Pi’s receive (Rx) line otherwise the 5v signals from the Arduino will kill it. If you have a 3v3 device such as an STM32, then you don’t need the voltage divider as both sides of the connection will be at 3.3 volts.

The best way to get your device connected is to purchase a Raspberry Pi SDC I/O Hat from me. It comes with a means to power the Pi from your vehicle’s 12v (nominal) power source using a DC-DC converter, terminal connections for the serial and ground wires from Speeduino, 5 digital inputs suitable for connecting hardware switches or rotary encoders, and optionally has a Canbus port with a 120ohm termination resistor (enable termination via a jumper). Version 1.4 of the I/O hat contains a jumper to choose between 5v and 3v3 devices; this automatically introduces the voltage divider where needed.

I expect one or two users might consider trying bluetooth as the serial connection rather than using a cable. To be blunt, don’t do it. Although you can probably get it to work, the modules are not that reliable and the data rates will be significantly slower. If you’re trying to get a working cluster you really need a proper update rate otherwise it’ll suck.

Display

Once you have the Speeduino connected via serial you will need to connect a display to the device. Follow the instructions for your display to connect it to your Raspberry Pi. This may include editing the config.txt file on the SD card to add a custom HDMI setting using settings such as hdmi_cvt, hdmi_group, and hdmi_mode. Your display’s instructions should tell you what you need to do. There is extensive documentation on the Raspberry Pi Configuration Website - Video Settings

There are three types of display supported by SDC:

  • An HDMI screen with optional capacitive touchscreen, of which there are many to choose. For these, the touchscreen must be USB HID based.
  • The official Raspberry Pi 7” touchscreen. The resolution on these is probably as low as you’d want to go for some sort of main cluster, as they are only 800x480, whereas many HDMI 7” touchscreens are typically 1024x600.
  • The TinySDC 1.28” Round LCD. This is a 240x240 pixel round LCD display. SDC supports controlling the brightness of this display via its backlight control. These are useful for supplementary screens and can fit into 52mm gauge pods.

Displays that use the GPIO pins to connect (such as the HyperPixel monitor or any SPI screen) are not supported. Resistive touchscreens are not supported.

Brightness control is supported on the official Raspberry Pi touchscreen and the TinySDC device.

To control the backlight on those devices that support it, you can send in a canbus message from another device, or you can use the setting ‘screenbrightness’ locally which you will find defined in the SDC.INI file shipped with the software. Whenever this setting is updated by a touch action, the brightness of the display will be set to match if it is supported.

Note that when you change any setting on multi-node canbus system, the value will be replicated across the network. One exception for this is the ‘screenbrightness’ setting. This value is not replicated so that each node on the network can have its own brightness. You can synchronise them all by updating the setting id of ‘screenbrightness’ using your own canbus message if you so desire but that is not necessarily useful unless all screens are of the same type and have the same gamma profiles.

Configuring the screen type

In the \kernel folder of the SD card is a file called cmdline.txt. This file allows parameters to be specified which SDC can see very early in its boot sequence (before access to the SD Card has been initialised). In order for things like the boot screen to be displayed properly on all screen types, you must tell SDC what he screen type is using this file, rather than using SDC.ini.

At or near the beginning of the first and only line in the file you will find the parameter

SDCDISPLAYTYPE=HDMI

This parameter will be followed by a load of other settings, which you must keep. You can change HDMI to any of these other 2 values to select that screen type:

  • PIOFFICIAL
  • TINYSDC

This file is not normally changed, and there are some specific rules about changing it. The primary rule is that the entire content of this file MUST be on a single line. Therefore do not use any editors that may split the file up into multiple lines, and do not add a carriage return and/or line feed at the end of the first line (do not press Return at the end of the line in your editor).

Controlled Shutdown

Controlled shutdown enables some key features to be safely enabled including the ability to remember certain settings between power downs, and the ability to safely close datalogs after the ignition is turned off when data logging is enabled. For further details please see the Controlled Shutdown section