Beginner
10 min

Maximize the impact of your visuals with dual green 5x7 displays using MAX7219 and dsPIC33FJ256GP710A

Double the display, double the impact: Green 5x7 magic!

Matrix G Click with UNI Clicker

Published Sep 10, 2023

Click board™

Matrix G Click

Development board

UNI Clicker

Compiler

NECTO Studio

MCU

dsPIC33FJ256GP710A

With a focus on efficiency and versatility, we aim to empower developers with a dual green matrix solution that delivers synchronized control over two displays, allowing for dynamic and captivating visuals

A

A

Hardware Overview

How does it work?

Matrix G Click is based on two MAX7219, serially interfaced, 8-digit LED display drivers from Analog Devices. The MAX7219 over 10MHz serial interface can address each LED of the two onboard green 5x7 matrices individually or all simultaneously. It has digital and analog brightness control, blanked display on Power-Up sequence, low-power shutdown with data retained, and more features. It also includes a BCD code-B decoder, multiplex scan circuitry, segment and digit drivers, and an 8x8 static RAM that stores each data. Users can get four-character displays if they double

up on a board with two adjacent mikroBUS™ sockets, such as Fusion, Clicker 2, or Flip&Click. The Matrix R Click uses an SPI serial interface to communicate to the host microcontroller, with speeds of up to 10MHz. Each MAX7219's chip select pin is connected to the appropriate pin on the mikroBUS™ socket. The MAX7219 that controls the left display is connected to the pin labeled CSL, while the right is connected to the pin labeled CSR. Serial data is loaded into the shift register while the corresponding chip select pin is in a low logic state. The peak segment current is set to

around 40mA with an external resistor. The display's brightness can be controlled by the internal PWM by the software. This Click board™ can be operated only with a 5V logic voltage level. The board must perform appropriate logic voltage level conversion before using MCUs with different logic levels. Also, it comes equipped with a library containing functions and an example code that can be used as a reference for further development.

Matrix G Click top side image
Matrix G Click bottom side image

Features overview

Development board

UNI Clicker is a compact development board designed as a complete solution that brings the flexibility of add-on Click boards™ to your favorite microcontroller, making it a perfect starter kit for implementing your ideas. It supports a wide range of microcontrollers, such as different ARM, PIC32, dsPIC, PIC, and AVR from various vendors like Microchip, ST, NXP, and TI (regardless of their number of pins), four mikroBUS™ sockets for Click board™ connectivity, a USB connector, LED indicators, buttons, a debugger/programmer connector, and two 26-pin headers for interfacing with external electronics. Thanks to innovative manufacturing technology, it allows you to build

gadgets with unique functionalities and features quickly. Each part of the UNI Clicker development kit contains the components necessary for the most efficient operation of the same board. In addition to the possibility of choosing the UNI Clicker programming method, using a third-party programmer or CODEGRIP/mikroProg connected to onboard JTAG/SWD header, the UNI Clicker board also includes a clean and regulated power supply module for the development kit. It provides two ways of board-powering; through the USB Type-C (USB-C) connector, where onboard voltage regulators provide the appropriate voltage levels to each component on the board, or using a Li-Po/Li

Ion battery via an onboard battery connector. All communication methods that mikroBUS™ itself supports are on this board (plus USB HOST/DEVICE), including the well-established mikroBUS™ socket, a standardized socket for the MCU card (SiBRAIN standard), and several user-configurable buttons and LED indicators. UNI Clicker is an integral part of the Mikroe ecosystem, allowing you to create a new application in minutes. Natively supported by Mikroe software tools, it covers many aspects of prototyping thanks to a considerable number of different Click boards™ (over a thousand boards), the number of which is growing every day.

UNI clicker double image

Microcontroller Overview

MCU Card / MCU

default

Type

8th Generation

Architecture

dsPIC

MCU Memory (KB)

256

Silicon Vendor

Microchip

Pin count

100

RAM (Bytes)

30720

Used MCU Pins

mikroBUS™ mapper

Right Display SPI Chip Select
RB10
AN
NC
NC
RST
Right Display SPI Chip Select
RG9
CS
SPI Clock
RG6
SCK
SPI Data OUT
RG7
MISO
SPI Data IN
RG8
MOSI
NC
NC
3.3V
Ground
GND
GND
NC
NC
PWM
NC
NC
INT
NC
NC
TX
NC
NC
RX
NC
NC
SCL
NC
NC
SDA
Power Supply
5V
5V
Ground
GND
GND
1

Take a closer look

Schematic

Matrix G Click Schematic schematic

Step by step

Project assembly

UNI Clicker front image hardware assembly

Start by selecting your development board and Click board™. Begin with the UNI Clicker as your development board.

UNI Clicker front image hardware assembly
Thermo 28 Click front image hardware assembly
SiBRAIN for STM32F745VG front image hardware assembly
Prog-cut hardware assembly
UNI Clicker MB 1 - upright/with-background hardware assembly
Necto image step 2 hardware assembly
Necto image step 3 hardware assembly
Necto image step 4 hardware assembly
Necto image step 5 hardware assembly
Necto image step 6 hardware assembly
Necto image step 7 hardware assembly
Necto No Display image step 8 hardware assembly
Necto image step 9 hardware assembly
Necto image step 10 hardware assembly
Debug Image Necto Step hardware assembly

Track your results in real time

Application Output

After loading the code example, pressing the "DEBUG" button builds and programs it on the selected setup.

Application Output Step 1

After programming is completed, a header with buttons for various actions available in the IDE appears. By clicking the green "PLAY "button, we start reading the results achieved with Click board™.

Application Output Step 3

Upon completion of programming, the Application Output tab is automatically opened, where the achieved result can be read. In case of an inability to perform the Debug function, check if a proper connection between the MCU used by the setup and the CODEGRIP programmer has been established. A detailed explanation of the CODEGRIP-board connection can be found in the CODEGRIP User Manual. Please find it in the RESOURCES section.

Application Output Step 4

Software Support

Library Description

This library contains API for Matrix G Click driver.

Key functions:

  • matrixg_display_characters - This function displays the specified characters on the L/R segments of the click

  • matrixg_set_csn_high - This function sets the CSN pin output to high

  • matrixg_set_csn_low - This function sets the CSN pin output to low.

Open Source

Code example

This example can be found in NECTO Studio. Feel free to download the code, or you can copy the code below.

/*!
 * @file main.c
 * @brief MatrixG Click example
 *
 * # Description
 * This example showcases how to prepare the logger and click modules for use and 
 * how to display ASCII characters on both of the LED segments of the click.
 *
 * The demo application is composed of two sections :
 *
 * ## Application Init
 * This function initializes and configures the logger and click modules. After the initialization of the logger module, 
 * communication, mikrobus and pin setup, some of the registers are configured in order for the click module to work properly.
 *
 * ## Application Task
 * This function displays two strings on each of the LED segments, showing one character every second. 
 * It should display " Mikroelektronika" on the left one and "Mikroelektronika " on the right.
 *
 * @note
 * The click has two chips, each controlling one of the LED segments, on and requires you to write data to both at the same time. 
 * Writing to one specific chip will not work. If you wish to display characters on a single segment, you have to send ' ' characters to the other segment.
 *
 * @author Jelena Milosavljevic
 *
 */

// ------------------------------------------------------------------- INCLUDES

#include "board.h"
#include "log.h"
#include "matrixg.h"

// ------------------------------------------------------------------ VARIABLES

static matrixg_t matrixg;
static log_t logger;

// ------------------------------------------------------ APPLICATION FUNCTIONS

void application_init ( ) {
   
    log_cfg_t log_cfg;
    matrixg_cfg_t cfg;

    /** 
     * Logger initialization.
     * Default baud rate: 115200
     * Default log level: LOG_LEVEL_DEBUG
     * @note If USB_UART_RX and USB_UART_TX 
     * are defined as HAL_PIN_NC, you will 
     * need to define them manually for log to work. 
     * See @b LOG_MAP_USB_UART macro definition for detailed explanation.
     */
    LOG_MAP_USB_UART( log_cfg );
    log_init( &logger, &log_cfg );
    log_info( &logger, "---- Application Init ----" );

    //  Click initialization.

    matrixg_cfg_setup( &cfg );
    MATRIXG_MAP_MIKROBUS( cfg, MIKROBUS_1 );
    matrixg_init( &matrixg, &cfg );
    Delay_ms( 100 );
    matrixg_default_cfg( &matrixg );
    Delay_ms( 100 );
}

void application_task ( ) {
   
    matrixg_display_characters( &matrixg, ' ', 'M' );
    Delay_ms( 1000 );
    matrixg_display_characters( &matrixg, 'M', 'i' );
    Delay_ms( 1000 );
    matrixg_display_characters( &matrixg, 'i', 'k' );
    Delay_ms( 1000 );
    matrixg_display_characters( &matrixg, 'k', 'r' );
    Delay_ms( 1000);
    matrixg_display_characters( &matrixg, 'r', 'o' );
    Delay_ms( 1000 );
    matrixg_display_characters( &matrixg, 'o', 'E' );
    Delay_ms( 1000 );
    matrixg_display_characters( &matrixg, 'E', 'l' );
    Delay_ms( 1000 );
    matrixg_display_characters( &matrixg, 'l', 'e' );
    Delay_ms( 1000 );
    matrixg_display_characters( &matrixg, 'e', 'k' );
    Delay_ms( 1000 );
    matrixg_display_characters( &matrixg, 'k', 't' );
    Delay_ms( 1000 );
    matrixg_display_characters( &matrixg, 't', 'r' );
    Delay_ms( 1000 );
    matrixg_display_characters( &matrixg, 'r', 'o' );
    Delay_ms( 1000 );
    matrixg_display_characters( &matrixg, 'o', 'n' );
    Delay_ms( 1000 );
    matrixg_display_characters( &matrixg, 'n', 'i' );
    Delay_ms( 1000 );
    matrixg_display_characters( &matrixg, 'i', 'k' );
    Delay_ms( 1000 );
    matrixg_display_characters( &matrixg, 'k', 'a' );
    Delay_ms( 100 );
    matrixg_display_characters( &matrixg, 'a', ' ' );
    Delay_ms( 100 );
}

void main ( ) {
    
    application_init( );

    for ( ; ; )
    {
        application_task( );
    }
}

// ------------------------------------------------------------------------ END

Additional Support

Resources