SPI Dot-Matrix

ODROID-C1/C1+/C2

img_20150805_163924.jpg

ODROID-XU4 W/ Shifter Shield

xu4_spi_dot_matrix.jpg

ODROID-N2

n2_spi_dot_matrix.jpg

ODROID-C4

c4_spi_dot_matrix.jpg

You have to enable SPI feature first to use this shield.

Please refer to this guide.

Make sure that the SPI feature on your Odroid is enabled correctly. A short way to check out is finding spidev file under /dev directory.

See the following.

root@odroid:~# ll /dev/spidev*
crw------- 1 root root 153, 0 Apr  3 09:17 /dev/spidev0.0

Download our example code and run that.

wget https://dn.odroid.com/Accessory/examples/Dot-Matrix/dot_test.c
gcc -o dot_test dot_test.c

Execute that built file, and you can see the results like the below.

odroid@odroid64:~$ sudo ./dot_test
spi mode: 0
bits per word: 8
max speed: 500000 Hz (500 KHz)
  • In Odroid-C2, although you set to 500 KHz, it actually operates at 390KHz since C2 runs SPI in the bit-banging method.

Another example: Scrolling text

Download our example code and run that.

wget https://dn.odroid.com/Accessory/examples/Dot-Matrix/dot_shift_test.c
wget https://dn.odroid.com/Accessory/examples/Dot-Matrix/dotfont.h
gcc -o dot_shift_test dot_shift_test.c

Execute that built file, and you can see the results like the below.

odroid@odroid64:~$ sudo ./dot_shift_test
max speed: 1000000 Hz (1000 KHz)
  • Check this out if it doesn't work. Here is the help for WiringPi SPI APIs to edit the example file.
1. Uncomment this line first.
#define USE_WIRING_PI_LIB

2. Change spidev node path if you need.
dot_shift_test.c line 68-69 (Uncomment each model like the below)
    #define SPIDEV_NODE_NAME    "/dev/spidev0.0"    // ODROID-C1/C1+/C2/N2/C4
    //#define SPIDEV_NODE_NAME    "/dev/spidev1.0"    // ODROID-XU3/XU4

3. Build that example with a proper library option.
if defined USE_WIRING_PI_LIB
      Compile : gcc -o <create excute file name> <source file name> -lwiringPi -lwiringPiDev -lpthread
else
      Compile : gcc -o <create excute file name> <source file name>