Data Sheet
4D SYSTEMS 4DPi-32-II Primary Display – Raspberry Pi Compatible
© 2018 4D SYSTEMS Page 8 of 18 www.4dsystems.com.au
4DPi
-32
-II Primary Display
– Raspberry
Pi
4.5. Change the SPI Freq and Compression
The 4DPi-32-II can be adjusted to work with a range
of SPI Frequencies and levels of compression,
depending on the requirements of the end
product/project.
Increasing the frequency can result in a higher
Frame Rate (FPS), however will use more power
and processor time.
Increasing the level of the compression can also
result in a higher FPS, but may cause the display to
corrupt.
By default, a SPI Frequency of 48Mhz is used, with
a Compression level of 7.
The following parameters are the defaults in the
/boot/cmdline.txt file, and can be edited to adjust
the Frequency and Compression level.
4dpi.sclk=48000000
4dpi.compress=7
Setting compress to be 1 will enable the kernel to
control the level of compression based on the
frequency selected. This however is not guaranteed
to have a good end result, and may require
manually setting the compression level if
corruption on the display is experienced.
If corruption or display anomalies occur at any
given compression level, try to lower it by 1 value
and check if this has improved.
Note, changing the frequency and compression
require a restart of the Raspberry Pi.
4.6. Backlight Control
The backlight is controllable in two possible ways.
One is using simple on/off control, which is done by
sending a GPIO command to the on-board
processor, which then turns the backlight on and
off. The other is using a DMA -PWM output from
the Raspberry PI and controlling the backlight
brightness.
The control of the backlight is selected using the
Jumper J1, selecting ON/OFF or DMA control. For
the simple ON/OFF control GPIO18 is used.
The backlight brightness can be controlled from
the terminal, or from a bash script.
Controlling the backlight using ON/OFF control
requires root access.
$ sudo su
Executing the following command will control the
backlight:
To turn the backlight OFF:
# echo 0 > /sys/class/backlight/4d-
hats/brightness
To turn the backlight ON:
# echo 1 > /sys/class/backlight/4d-
hats/brightness
To control the backlight using DMA-PWM, ensure
that the Jumper J1 is on PWM.
The following command can be used to set the
backlight from 0 to 100%.
# echo 80 > /sys/class/backlight/32-hat-
pwm/brightness
The above will set the backlight to 80%. Simply
change the ‘echo 80’ to be anything from 0 to 100.
4.7. Parameters Listing
The following is a list of all the custom parameters
used by the 4DPi-32-II.
rotate: Screen rotation 0/90/180/270 (int)
compress: SPI compression 0/1/2/3/4/5/6/7 (int)
sclk: SPI clock frequency (long)
Valid SPI Frequency values (4dpi.sclk):
Values can be almost anything. This has been tested
up to 64Mhz. Common values would include
64000000 (64MHz), 48000000 (Default), 32000000,
24000000 etc.
Valid Compression values (4dpi.compress):
0 (compression off)
1 (compression on, auto set based on sclk value)
2 (lowest), 3, 4, 5, 6, 7 (highest compression)
These parameters can be set or read from the
/boot/cmdline.txt file, and they can be read from
the /sys/modules/4dpi/parameters directory.
For example:
$ cat /sys/modules/4dpi/parameters/rotate
Will display the current rotation saved.