MAX7219 7-Segment Display Library for Proteus V1.0: an Arduino UNO V4.0 with the 8-digit module counting, and the Advance pop-up showing the clock 12-00-07 with the MAX7219 registers and frames

MAX7219 7-Segment Display Library for Proteus V1.0 (8-Digit Module)

2.5K Views
40
700
60
25
60
PCBWay

Hello friends, I hope you all are doing great. Today, I am going to share the new MAX7219 7-Segment Display Library for Proteus V1.0. The long blue board with eight red digits is the quickest way to give an Arduino a real display: a counter, a clock, a voltmeter reading, a score. One MAX7219 on the back does all the multiplexing, the Arduino needs only three pins, and with the LedControl library a number is one line of code. Now this 8-digit 7-segment module is ready for your Proteus simulations too, every segment glowing as on the real board.

Behind the digits sits our own model of the MAX7219, written from the Maxim datasheet: the 16-bit serial packets, the digit, Code B decode, intensity, scan-limit, shutdown and display-test registers, DOUT for the next module, and the digit order of the real board, where digit 0 is the rightmost one. You get two devices, a Simple one with a live STATUS panel and an Advance one with a pop-up window and four test tools, and the demo runs LedControl on our Arduino UNO V4.0 with its serial monitor built into the board.

NOTICE: a 7-segment module looks like the easiest display there is, and yet the same questions come back again and again: why does my display stay dark, why are my numbers backwards, why does it show strange characters? We built this model to show the answers on the screen, and we checked it against the real LedControl library, digit by digit. It took our team a lot of hard work. Your feedback is the fuel that keeps us going, so please tell us what you think in the comments below or in the LCD Library board of our forum. And if our free libraries help you, you can buy us a coffee. So, let's get started with the MAX7219 7-Segment Display Library for Proteus V1.0:

MAX7219 7-Segment Display Library for Proteus V1.0: an Arduino UNO V4.0 with the 8-digit module counting, and the Advance pop-up showing the clock 12-00-07 with the MAX7219 registers and frames
Figure: The MAX7219 7-segment demo in Proteus 8.5: SEG1 (Simple) counts tenths of a second under its UNO; the pop-up of SEG2 (Advance) shows its clock, the registers and every frame the MAX7219 latched.

What is a MAX7219 8-Digit 7-Segment Display Module?

The MAX7219 is an LED display driver from Maxim. It was made for exactly this job: up to 8 digits of a common-cathode 7-segment display, each with 7 segments and a decimal point. It lights one digit at a time, about 800 times a second, so the eye sees all eight at once, and a single resistor (RSET) sets the current of every segment. An Arduino talks to it over three wires, DIN, CLK and CS (called LOAD in the datasheet), and every message is a 16-bit packet: a register address and a data byte.

The module everybody buys is a blue board of about 82 x 15 mm with two 0.36" 4-digit red displays side by side and the MAX7219 on the back. The IN header (VCC, GND, DIN, CS, CLK) is on the left end and the OUT header (VCC, GND, DOUT, CS, CLK) on the right end, so the next module can be chained.

The MAX7219 8-digit 7-segment display module
MAX7219 8-digit 7-segment module
Driver1 x MAX7219 (on the back)
Displays2 x 0.36" 4-digit, red, common cathode = 8 digits
Boardabout 82 x 15 mm
Digit orderDIG0 = the RIGHTMOST digit, DIG7 = the leftmost
SegmentsDP A B C D E F G = data bits D7 ... D0
HeadersIN: VCC GND DIN CS CLK (left), OUT: VCC GND DOUT CS CLK (right)
Devices in this libraryMAX7219SEG8TEP (Simple) / MAX7219SEG8ADVTEP (Advance)

The MAX7219 Registers

What each 16-bit packet can set (D11 - D8 = the address, D7 - D0 = the data)
AddressRegisterWhat it does on a 7-segment module
0NO-OPNothing: lets a packet pass a chip in the chain
1 - 8DIGIT 0 - 7The segments of each digit (or a Code B value)
9DECODE MODECode B: the chip draws 0 - 9, -, E, H, L, P itself; 00 = raw segments
AINTENSITY0 - 15: the duty from 1/32 to 31/32
BSCAN LIMITDigits 0 to n are shown; 7 shows all 8
CSHUTDOWN00 dark, 01 normal operation (the chip starts in shutdown)
FDISPLAY TEST01 lights every segment and point, over everything else

What's New in MAX7219 7-Segment Display Library for Proteus V1.0

  • The real 8-digit module: the blue board with two 4-digit displays, the IN header on the left and the OUT header on the right, drawn at 2 x its real size.
  • Our MAX7219 model from the datasheet: 16-bit packets on DIN and CLK, latched by CS, every register, the power-up state and DOUT for chaining.
  • Real digits: slanted segments and decimal points that glow as bright as the intensity and the scan limit make them, in red, green, blue, yellow or white.
  • Code B decode: the MAX7219's own font for 0 - 9, -, E, H, L, P, and the classic mistake of switching it on with LedControl.
  • The current estimate: what the segments draw from the supply.
  • Problems named on the panel: a dark display in shutdown, a short scan limit, Code B on segment patterns, display test, frames of the wrong size.
  • Four test tools on the Advance device: Init check, Serial bus, Digits and Power.
  • A LedControl demo on our Arduino UNO V4.0: a counter, a clock, numbers and text, and commands that switch every register.
  • A compact package: about 1.26 MB, without the C++ source code.

Two Devices: Simple and Advance

MAX7219 7-Segment Display Library for Proteus devices: the 8-digit module Simple with its STATUS panel and Advance with OPEN PANEL, as they appear in Proteus
Figure: The two devices as the library draws them: Simple with its STATUS panel above, Advance with OPEN PANEL below.
The two devices (search "MAX7219" in Pick Devices; category Optoelectronics > 7-Segment Displays)
SimpleAdvance
DeviceMAX7219SEG8TEPMAX7219SEG8ADVTEP
On the schematicThe module + the STATUS panelThe module only
StatusBanner, 10 readouts, the last 6 framesA pop-up window: Display, Bus log, Tests
Test tools-Init check, Serial bus, Digits, Power

Download MAX7219 7-Segment Display Library for Proteus

Click the button below to download MAX7219-7-Segment-Display-Library-for-Proteus-v1.0.zip (about 1.26 MB, without the C++ source code):

MAX7219 7-Segment Display Library for Proteus V1.0
  • README.txt: the devices, installation, the demo, wiring, chaining, the test tools and real hardware.
  • Proteus Library Files: TEPMAX7SEG.LIB and ArduinoV4TEP.LIB from our Arduino Library for Proteus V4.0.
  • Proteus Model Files: TEPMAX7SEG.DLL and TEPARDUINO.DLL.
  • Proteus Simulation: MAX7219-7Segment-ArduinoUnoV4.pdsprj, MAX7219_7Seg_Demo.hex and copies of both DLLs.
  • Arduino Code: MAX7219_7Seg_Demo.ino (needs "LedControl" from the Library Manager).

No Proteus yet? Read How to Download and Install Proteus 7 and 8. New to libraries? Follow How to Install a New Library in Proteus.

How to Install MAX7219 7-Segment Display Library for Proteus

  1. Close Proteus and extract the whole zip file, for example to your Desktop.
  2. Copy the two files from Proteus Library Files into the LIBRARY folder of Proteus (usually C:\Program Files (x86)\Labcenter Electronics\Proteus 8 Professional\LIBRARY).
  3. Copy TEPMAX7SEG.DLL and TEPARDUINO.DLL from Proteus Model Files into the MODELS folder.
  4. Delete TEPMAX7SEG.IDX from the LIBRARY folder if there is one.
  5. Start Proteus, press P and search for MAX7219. Proteus's own MAX7219 chip shows up too; ours is the module.

Tip: keep the Proteus Simulation folder together, because the project needs its .hex file and the DLLs beside it. The library is tested in Proteus 8.5; Proteus 7 is not supported.

The MAX7219 7-Segment Module in Proteus

MAX7219 7-segment display in Proteus: the Simple module counting tenths of a second, its IN header wired with net labels and the STATUS panel saying READY
Figure: SEG1, the Simple device: the IN header on the left, the counter on the right-hand digits, and the panel: READY, what the digits read and the intensity.

The module is drawn at 2 x its real size, which keeps its five header pins on the Proteus grid. While the simulation runs, each segment and decimal point glows on its own, slanted like the real 0.36" digits. Under the board, a TEP strip holds the SIMPLE / ADVANCE badge, a PWR LED, a DATA LED that flashes on every LOAD, the LED COLOUR selector and the panel button. The strip, its LEDs and the panels are TEP additions; a real module has none of them.

MAX7219 8-digit 7-segment module Advance in Proteus showing a clock 12-00-06, the IN header on the left wired with net labels and the TEP strip with OPEN PANEL
Figure: SEG2, the Advance device, showing the demo's clock: HH-MM-SS on all 8 digits.

Pinout

The pins of the MAX7219 7-segment module
PinFunctionArduino UNO (demo)
VCC / GNDThe 5 V supply (the MAX7219 runs from 4 - 5.5 V)5V / GND
DINSerial data inD12
CLKSerial clock: DIN is read on its rising edgeD11
CSLOAD: its rising edge latches the packetD10
DOUT (OUT header)The data leaving the chip, for the next moduleopen in the demo
Component properties (double-click the part, Edit Properties)
PropertyValuesWhat it does
PANELOPEN (default), CLOSEDSimple device only: the STATUS panel at the start
COLOURRED (default), GREEN, BLUE, YELLOW, WHITEThe digit colour; the selector on the strip changes it at Run

Digit 0 is on the Right: How the MAX7219 Counts

The MAX7219 calls its digits DIG0 to DIG7, and on this module DIG0 drives the rightmost digit. That suits numbers, because the ones always sit on the right, and LedControl counts the same way: lc.setDigit(0, 0, 5, false) puts a 5 on the rightmost digit. Write a number from the left and it comes out backwards, which is the first surprise for many beginners.

MAX7219 7-segment Advance Display page in Proteus: the 8 digits reading 12-00-07 with DIG7 to DIG0 under them, the tiles and the registers of the MAX7219
Figure: The Display page labels every digit with its register: DIG7 on the left, DIG0 on the right. The registers read 30 6D 01 7E 7E 01 7E 70 for "12-00-07".

Each digit register holds one byte: bit D7 is the decimal point and D6 to D0 are the segments A to G. The demo shows any text with LedControl's setChar(), from the rightmost digit for numbers and from the leftmost for text:

  for (byte digit = 0; digit < 8; digit++) {
    int k = rightAligned ? n - 1 - digit : 7 - digit;      // which character goes on this digit
    if (k >= 0 && k < n) lc.setChar(0, digit, cells[k], dots[k]);
    else lc.setChar(0, digit, ' ', false);
  }
MAX7219 7-segment display in Proteus showing the number -12.345 right-aligned with the decimal point lit
Figure: NUMBER -12.345: the minus sign, the digits and the decimal point, right-aligned like a calculator.
MAX7219 7-segment display in Proteus showing the text HELP on the four left digits
Figure: TEXT HELP: a 7-segment digit can show 0 - 9, A, b, c, d, E, F, H, L, P, minus and underscore, so HELP works.

The counter and the clock are just formatted strings. The counter shows tenths of a second with the decimal point, the clock uses the minus sign between hours, minutes and seconds:

  snprintf(b, sizeof b, "%lu.%lu", tenths / 10, tenths % 10);   // 1234.5 = 1234.5 s
  snprintf(b, sizeof b, "%02u-%02u-%02u", unsigned(t / 3600), unsigned(t / 60 % 60), unsigned(t % 60));
MAX7219 7-segment clock in Proteus rolling over midnight to 00-00-02
Figure: CLOCK 23:59:55 on ARD2: a few seconds later the clock rolls over midnight to 00-00-02.

Brightness, Scan Limit, Display Test and Shutdown

MAX7219 7-segment display intensity 15 in Proteus: the counter at full brightness with a stronger glow
Figure: INTENSITY 15: the duty goes from 17/32 to 31/32 and the segments glow brighter.

The INTENSITY register sets the duty cycle from 1/32 to 31/32 in 16 steps, and the model shows it the way the eye sees it: intensity 0 is dim but clearly visible, 15 is bright with a wide glow. LedControl's setIntensity() writes it:

    intensity = constrain(atoi(arg), 0, 15); lc.setIntensity(0, intensity);
MAX7219 scan limit 3 in Proteus: only the four rightmost digits 5678 shown and brighter, the banner says SCAN LIMIT 3
Figure: NUMBER 12345678, then SCAN 3: only DIG0 - DIG3, the four rightmost digits, are scanned; they show 5678 and get brighter.

The SCAN LIMIT register decides how many digits the chip multiplexes, always counted from DIG0, the right. With fewer digits each one is on for a bigger share of the time, so it gets brighter and draws more current. That is why the datasheet warns against using it to blank digits; write a blank instead. LedControl's constructor sets it to 7, and so does the demo:

    scanLimit = constrain(atoi(arg), 0, 7); lc.setScanLimit(0, scanLimit);
MAX7219 display test in Proteus: all 8 digits showing 8 with every decimal point lit and the amber banner DISPLAY TEST ON
Figure: TEST ON: the DISPLAY TEST register lights every segment and point, "8.8.8.8.8.8.8.8.", whatever the digits hold.

LedControl has no call for the DISPLAY TEST and DECODE MODE registers, so the demo sends those packets itself, exactly the way LedControl sends its own:

void writeRegister(byte reg, byte value) {
  digitalWrite(CS_PIN, LOW);
  shiftOut(DIN_PIN, CLK_PIN, MSBFIRST, reg);
  shiftOut(DIN_PIN, CLK_PIN, MSBFIRST, value);
  digitalWrite(CS_PIN, HIGH);
}
    writeRegister(0x0F, testing ? 1 : 0);
MAX7219 shutdown in Proteus: the 8 digits dark, the chip in shutdown with its registers kept, the amber banner
Figure: SHUTDOWN ON: the digits go dark, but the registers keep their data; SHUTDOWN OFF brings the same number back.

A MAX7219 wakes up in shutdown, and LedControl's constructor leaves it there on purpose. That is why every LedControl sketch starts with lc.shutdown(0, false); forget it and the display stays dark. The demo's start-up does exactly what the LedControl examples do:

void startDisplay() {             // what every LedControl sketch does first
  lc.shutdown(0, false);          // the MAX7219 starts in shutdown: without this the display stays dark
  lc.setIntensity(0, intensity);  // brightness 0 - 15
  lc.setScanLimit(0, 7);          // all 8 digits
  lc.clearDisplay(0);
}

Code B Decode: The MAX7219's Own Font, and a Classic Mistake

The MAX7219 has a small font built in. With the DECODE MODE register set, a digit register no longer holds segments but a value, and the chip draws Code B for it: 0 - 9, minus, E, H, L, P or a blank, with D7 still the decimal point. Some libraries use it. LedControl does not: it writes 00 to DECODE MODE and sends its own segment patterns, which gives it more characters.

Switch Code B on while LedControl is running and the chip reads those patterns as values. The demo's DECODE ON does exactly that:

    writeRegister(0x09, decoding ? 0xFF : 0x00);
MAX7219 Code B decode on LedControl patterns in Proteus: 12345678 turned into wrong characters and the red banner CODE B ON SEGMENT PATTERNS - WRONG CHARACTERS
Figure: DECODE ON with 12345678 on the display: Code B turns LedControl's patterns into other characters, and the red banner says CODE B ON SEGMENT PATTERNS - WRONG CHARACTERS.
MAX7219 Digits tool in Proteus with Code B on: every digit register, its segments, what it reads and the note a segment pattern under Code B: wrong character
Figure: The Digits tool during DECODE ON on SEG2: each register, the segments Code B makes of it and what it reads; the 1s are LedControl's minus signs (01), which Code B reads as a 1.

The model spots it: a decoded digit that holds bits D4 to D6, which Code B ignores, can only be a segment pattern, so the panel, the log and the Digits tool all name the mistake. DECODE OFF brings the right characters back at once, because the digit registers never changed.

MAX7219 Simple: The STATUS Panel

Under the Simple device a live MAX7219 7-SEGMENT STATUS panel shows the banner (READY with what the digits read, or the problem in amber or red), ten readouts - DISPLAY, INTENSITY, SCAN LIMIT, DECODE, TEST, VCC, CLOCK, FRAMES, SEGMENTS ON and CURRENT - and the last six frames with their bits and packets. The red X closes the panel; PANEL on the strip opens it again.

MAX7219 Advance: The Pop-Up Window

The Advance device opens a TEP pop-up window at Run with three pages. The Display page (above) shows the digits in large with their DIG numbers, eight tiles - display, intensity, scan limit, decode, segments lit, current, colour and what the digits read - the registers and the latest frames.

The Bus Log Page

MAX7219 7-segment Advance bus log in Proteus: every 16-bit frame with its time, gap and the digit register written
Figure: The Bus log: every LOAD with its gap, its bits and the packet the MAX7219 latched; a frame of the wrong size is red.

Every clock tick of the demo writes all 8 digits, one 16-bit frame each, about 300 us apart. Filter the list to the digit writes, the control registers or the problems only; Pause freezes it.

Four Test Tools for the MAX7219

1. Init Check

MAX7219 Init check in Proteus: frame size 16 bits, shutdown off, decode off, scan limit 7, intensity 8, display test off, all green
Figure: Init check after LedControl's start-up: every line green, and below it the first frames after power-on.

The start-up against the datasheet: the frame size, shutdown, decode mode, scan limit, intensity and display test, a verdict, then the first frames as the sketch sent them - display test off, scan limit 7, decode 00, the 8 digits cleared, shutdown, then the sketch's own start-up. With Code B on, the decode line turns red:

MAX7219 Init check in Proteus with Code B on segment patterns: the decode mode line and the verdict in red
Figure: Init check during DECODE ON: Code B on digits that hold segment patterns, and the verdict asks to fix it.

2. Serial Bus

MAX7219 Serial bus test in Proteus: DIN, CLK and CS connected, about 60 kHz clock from LedControl, SPI mode 0, 16 bits every LOAD
Figure: Serial bus: the wiring, the clock (about 60 kHz from LedControl's shiftOut()), SPI mode 0 and 16 bits every LOAD.

Good for a dark or garbled display: which pins are wired, the clocks and loads since Start, the clock against the MAX7219's 10 MHz, the SPI mode, frames of the wrong size, clocks with CS high and bits waiting for a LOAD. LedControl drives the pins with shiftOut(), so its clock is slow, but the MAX7219 does not mind.

3. Digits

MAX7219 Digits tool in Proteus: every digit from left to right with its register DIG7 to DIG0, value, segments and the character it reads
Figure: Digits: the 8 digits from left to right, each with its register, the value, decoded or not, the segments it lights and what it reads.

Good for wrong characters, digits in the wrong place or a dark digit: it shows which register drives each position, whether Code B is on, the segments as letters (a to g and the point) and why a digit is dark - shutdown, the scan limit or a blank.

4. Power

MAX7219 Power tool in Proteus during the display test: 318 mA for 64 lit segments against a USB port's 500 mA
Figure: Power during TEST ON: 318 mA for all 64 segments and points.

Each lit segment gets about 40 mA while its digit is on (RSET is 10 kohm on these modules), shared over the 8 digits. The whole module at full duty draws about 318 mA: a USB port is enough for one module, but a chain of two at full brightness needs a 5 V supply.

MAX7219 7-Segment Display with Arduino in Proteus

MAX7219 7-segment Arduino UNO V4.0 circuit in Proteus: two Arduino UNO V4.0 boards, each with an 8-digit module under it, one counting and one showing the clock
Figure: The demo project: ARD1 + SEG1 (Simple, the counter) and ARD2 + SEG2 (Advance, the clock).

Open MAX7219-7Segment-ArduinoUnoV4.pdsprj. Two Arduino UNO V4.0 boards from our Arduino UNO Library for Proteus V4.0 run the same sketch: with D2 open it counts tenths of a second, with D2 tied to GND (ARD2) it starts as a clock. The monitors are built into the boards; our Introduction to Arduino UNO explains the pins.

Wiring

MAX7219 7-segment wiring with net labels in Proteus: the Arduino UNO V4.0 pins D12, D11, D10 and 5V joined to the module by labels of the same name
Figure: ARD1 and SEG1 joined by net labels: D12_1, D11_1, D10_1 and 5V_1, plus GND.

LedControl drives the pins itself, so any three pins work. The demo uses the pins of the LedControl examples: DIN on D12, CLK on D11 and CS on D10. VCC goes to 5V. The module sits under its UNO because it is wider than the board.

Chaining Modules in Proteus

For 16 digits, put the next module to the RIGHT and wire its DIN to this module's DOUT. Only DOUT is a Proteus pin on the OUT header: on a real module VCC, GND, CS and CLK pass straight through, so in Proteus you wire the next module's VCC, GND, CS and CLK to the same nets. Then tell LedControl the total, LedControl(12, 11, 10, 2); device 0 is the module at the Arduino.

The Arduino Code

The sketch uses the LedControl library 1.0.6 by Eberhard Fahle:

#include <LedControl.h>

One object for the module: the DIN, CLK and CS pins and the number of MAX7219 chips:

LedControl lc = LedControl(DIN_PIN, CLK_PIN, CS_PIN, 1);   // DIN, CLK, CS, one MAX7219

D2 decides what the sketch starts with:

  if (digitalRead(MODE_PIN) == LOW) mode = CLOCK;

SHUTDOWN in the demo is LedControl's own call:

    lc.shutdown(0, sleeping);

To change the sketch, export a new HEX and load it into the UNO; see How to get the HEX file from Arduino. New to Arduino? Start with our Arduino Tutorial for Beginners.

Serial Monitor Commands

Commands of the demo sketch, typed in the UNO's built-in monitor
CommandWhat it does
HELP / STATUSThe command list / the mode, the display, intensity, scan limit, decode, shutdown, test
COUNT / CLOCK [hh:mm:ss]The counter in tenths of a second / the clock, HH-MM-SS
NUMBER <n> / TEXT <text>A number right-aligned / text left-aligned
INTENSITY <0-15> / SCAN <0-7>The brightness / the scan limit
SHUTDOWN ON|OFF, TEST ON|OFFDark / back, every segment lit
DECODE ON|OFFCode B on LedControl's patterns: the classic mistake, and back

How to Run the Demo

  1. Press Run; move the monitor windows and SEG2's pop-up aside.
  2. In ARD1's monitor type STATUS, NUMBER -12.345, TEXT HELP, INTENSITY 15, TEST ON and TEST OFF.
  3. Try the mistakes: SCAN 3 (then SCAN 7), DECODE ON (then DECODE OFF), SHUTDOWN ON (then SHUTDOWN OFF).
  4. In ARD2's monitor type CLOCK 23:59:55 and watch midnight; on SEG2 open Tests and look at Digits and Power.

MAX7219 7-Segment Proteus Simulation Results

The Built-in Serial Monitor in Its Simple Interface

Each Arduino UNO V4.0 carries our TEP Serial Monitor Advance, wired inside the board to D0 / D1. The screenshots show its Simple interface (Ctrl+Shift+U; Esc for the full view). Read all about it in TEP Serial Monitor Advance for Proteus.

ARD1: STATUS

MAX7219 7-segment demo STATUS in the built-in serial monitor of the Arduino UNO V4.0 in Proteus, Simple interface
Figure: ARD1's monitor: the start lines and STATUS - the counter at 8.0 s, intensity 8, scan limit 7, decode off.
MAX7219 7-Segment V1.0 demo - The Engineering Projects
MAX7219 8-digit ready, counter
Type HELP for the commands
STATUS
Mode: count
Display: 8.0
Intensity 8, scan limit 7, decode off
Shutdown off, test off

ARD1: The Registers and the Mistakes

MAX7219 7-segment demo commands DECODE, SHUTDOWN, NUMBER and TEXT in the built-in serial monitor of the Arduino UNO V4.0
Figure: ARD1's monitor later: DECODE ON / OFF, SHUTDOWN ON / OFF, NUMBER -12.345 and TEXT HELP.
DECODE ON
OK - Code B on: LedControl's patterns now show wrong characters
DECODE OFF
OK - decode off (as LedControl needs)
SHUTDOWN ON
OK - shutdown on (dark)
SHUTDOWN OFF
OK - shutdown off
NUMBER -12.345
OK - number -12.345
TEXT HELP
OK - text HELP

ARD2: The Clock

MAX7219 7-segment clock demo in the built-in serial monitor of the Arduino UNO V4.0: ready clock, TEST, DECODE and CLOCK 23:59:55
Figure: ARD2's monitor: the clock at the start, the display test, Code B on and off, and CLOCK 23:59:55.
MAX7219 8-digit ready, clock
Type HELP for the commands
TEST ON
OK - display test on (all segments)
TEST OFF
OK - display test off
DECODE ON
OK - Code B on: LedControl's patterns now show wrong characters
DECODE OFF
OK - decode off (as LedControl needs)
CLOCK 23:59:55
OK - clock 23-59-55

The Simulation Log

MAX7219 7-segment Proteus simulation log: both modules powered, display on with what the digits read, and the lines for the display test, the scan limit, Code B on segment patterns and shutdown
Figure: The simulation log: each module introduces itself, reports the power-up state and the first reading, and the demo's deliberate mistakes leave one line each.

Each module writes a few lines to the simulation log: which board it is, the power-up state, the first reading with its intensity, scan limit and decode mode (" 0.0" and "12-00-00"), and one line the first time each classic mistake happens. Nothing repeats, so the log stays readable in a long run.

Troubleshooting

  • Dark digits with the PWR LED off: no power - check VCC and GND.
  • DARK - NOTHING ON THE BUS YET: check DIN on D12, CLK on D11 and CS on D10, and the pins in LedControl(DIN, CLK, CS, 1).
  • DARK - SHUTDOWN MODE: the chip starts in shutdown; lc.shutdown(0, false) ends it.
  • SCAN LIMIT n: only the rightmost digits show; lc.setScanLimit(0, 7).
  • CODE B ON SEGMENT PATTERNS: DECODE MODE is on while the sketch sends LedControl's patterns.
  • Numbers backwards: digit 0 is the rightmost one.
  • FRAMES OF n BITS: LedControl's device count does not match the chain.
  • No part or no monitor: TEPMAX7SEG.DLL or TEPARDUINO.DLL is missing from MODELS and the project folder; a closed monitor opens again with a click on the UNO's USB port.

Things to Know Before Using a Real MAX7219 7-Segment Module

  • lc.shutdown(0, false): not optional - without it the display stays dark.
  • Power: one module at full brightness draws about 320 mA; use a 5 V supply with a common GND for a chain.
  • Logic level: at 5 V the MAX7219 wants 3.5 V for a high; a 5 V UNO is fine, a 3.3 V board may need a level shifter.
  • Decode mode: leave it off with LedControl.
  • Memory: the demo needs 12,480 bytes of flash and 658 bytes of RAM.

Limitations of the Simulation

  • Not modelled: the MAX7221 (its CS blocks the clock), the 800 Hz multiplex itself (the segments show the average), the 250 us to leave shutdown, the effect of RSET on the current, the limit of a real supply, and damage from a reversed supply.
  • The strip, its LEDs and the panels are TEP additions.
  • The model is our own, written from the MAX7219 datasheet; MAX7219 is a part of Maxim Integrated (Analog Devices). This library is not made or endorsed by Maxim, Analog Devices, the LedControl author or Labcenter.
  • Licences: LedControl 1.0.6 (MIT) and the Arduino AVR core 1.8.6 with LGPL-licensed code are in the HEX file; the sketch is included so you can rebuild it.
  • Tested in Proteus 8.5 in October 2026 (the demo as shipped on two Arduino UNO V4.0 boards with their built-in monitors: the counter and the clock, STATUS, INTENSITY, TEST, SCAN, DECODE, SHUTDOWN, NUMBER, TEXT and CLOCK over midnight, the panel, the pop-up and the four tools; about 0.5 x real time with the pop-up and both monitors open). Proteus 7 is not supported.

Need more than digits? Our MAX7219 LED Matrix Library for Proteus V1.0 drives the 8x8 and 4-in-1 LED matrices with the same chip, and our ST7789 TFT LCD Library for Proteus V1.0 covers small colour screens.

So, that was all about the MAX7219 7-Segment Display Library for Proteus V1.0. I hope the digit order, the registers and the Code B trap are clear now, so your counter or clock works on the first real module you plug in. If you use the MAX7219 7-Segment Display Library for Proteus in a project, please share it in the comments or in our forum, and if you have any questions, ask in the comments and I will help you out. Till the next tutorial, take care and have fun!


Comments

0

Join the conversation