PSoC5LP Lab 14: Walking Man on MAX7219 LED Dot Matrix Module

WalkingManVideo

Objectives

By completing this lab, you will be able to:

  1. Connect and control the MAX7219 LED Dot Matrix Module using the PSoC 5LP’s SPI interface.
  2. Configure the MAX7219 registers to operate in 8×8 dot-matrix mode, including scan limit, decode mode, shutdown mode, and brightness settings.
  3. Create 8×8 bitmap images and send them to the LED matrix using SPI row-data transfers.
  4. Implement a multi-frame “walking man” animation similar to the pedestrian symbol used in traffic light systems.
  5. Develop reusable firmware functions to write rows, display bitmap frames, and control animation timing.
  6. Adjust animation speed and verify smooth playback on the LED dot matrix display.

Overview

In this lab, you will create the familiar “walking man” animation used in pedestrian traffic light systems. These animated icons indicate when it is safe for pedestrians to cross and are typically implemented using LED matrix modules. By recreating this animation on an 8×8 LED Dot Matrix Display, you will learn how simple bitmap frames and timed transitions are combined to produce motion effects similar to real-world traffic signals.

The display is controlled by the MAX7219 LED Matrix Driver, a dedicated IC designed for 8×8 LED arrays. The MAX7219 manages multiplexing, LED current control, brightness, and row scanning, enabling you to display images without manually refreshing individual LEDs. Each row of the matrix corresponds to one of the MAX7219’s digit registers, making it simple to send 8-byte bitmap patterns.

Communication between the PSoC 5LP and the MAX7219 uses the SPI protocol, which operates as a high-speed shift-register interface. Data is clocked into the MAX7219 one bit at a time and then latched into internal registers when the Slave Select (SS) signal is toggled. By writing eight bytes—one per row—you can update a complete 8×8 image on the matrix.

To produce animation, multiple bitmap frames representing different walking poses are stored in firmware. These frames are sent to the MAX7219 sequentially, with a short delay between each one, creating a smooth walking movement similar to the pedestrian signals used at crosswalks.

Through this lab, you will gain practical experience with LED matrix display control, SPI serial communication, and rendering animation on embedded systems.

Required Reading Materials

Required Components

If you use the Cypress CY8CKIT-059 Kit, the onboard LED and button will be used in this lab.

The following components are required for this lab.

Button Small 64 MAX7219 LED Dot Matrix Module x 1
Resistor 64 Resistor 200ohm (if using an external LED) x 1
LED Red 64 Red LED (or onboard LED) x 1

Circuit / Schematic

Circuit 01 s

Procedure

Creating a New Project

  1. Launch PSoC Creator.
  2. Got to File ➤ Open Project ➤ Project/Workspace.
  3. Open the PSoC5LP workspace in the EE4450 folder.
  4. After PSoC Creator opens the workspace, right-click on Workspace 'PSoC5LP' in the Workspace Explorer and select Add ➤ New Project….
  5. Select the correct PSoC5LP device model number, use the "Empty schematic" template, and enter the project name 14_LedDotMatrix.

Adding Components in PSoC Creator

Open the "TopDesign.cysch" Schematic File, add the following components:

  1. Add an SPI Master (Full Duplex) Component:
    • In the Component Catalog, expand Communications → SPI.
    • Select SPI Master Full Duplex mode Macro and drag it into the schematic.
  2. Add Two Digital Output Pins:
    • In the Component Catalog, open Ports and Pins.
    • Drag two Digital Output Pin components into the schematic.
  3. Add a Logic Low '0' component:
    • Navigate to Digital → Logic in the Component Catalog.
    • Locate Logic Low '0' and place it onto the schematic.

After adding these components, you may proceed to configure each one as described below.

02 TopDesign Original s

Configuring the Components

  1. Configure the SPIM_1 Master Component:
    • Click the SPIM_1 component on the schematic.
    • Rename it to SPIM (indicating "SPI Master").
    • Set the SPI Mode to Mode 0:
      • CPHA = 0
      • CPOL = 0.
    Pin Wire1 s
  2. Configure Digital Output Pin (Pin_1):
    • Select the Pin_1 component.
    • Rename it to SPI_SS (Slave-Select signal).
    • Uncheck ☐ HW connection to ensure the pin is software-controlled.
    • Change the Initial drive state to High (1).
    Pin Wire1 s
  3. Configure the Digital Output Pin (Pin_2):
    • Select the Pin_2 component.
    • Rename it to LED1.
    • Uncheck ☐ HW connection so that firmware controls the LED output.
    Pin Wire1 s
  4. Rename All Pins Connected to the SPIM Component
    Rename the auto-generated SPI pins to meaningful signal names:
    Original Name New Name
    MISO_1 SPI_MISO
    MOSI_1 SPI_MOSI
    SCLK_1 SPI_SCLK

Wiring

Connect the Reset Pin

Attach the Logic Low '0' component to the Reset input pin of the SPIM block to ensure the SPI Master remains enabled during operation.

The new TopDesign.cysch file is shown below:

TopDesign

Pin Assignment

DevicePort.PinDirectionDrive Mode

Building and Programming the Firmware

Next, implement two functions that will handle communication with the SPI slave device:


Template Code for Walking Man Animation Array

Use the following template to create your own 8-frame animation. Each frame contains 8 rows, and each row is an 8-bit pattern (bit7 = left, bit0 = right). Replace the 0b00000000 rows with your custom pixel patterns.

These functions manage register-level read and write operations over the SPI interface at the register level.

© 2025 Air Supply Information Center (Air Supply BBS)