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:
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.
| MAX7219 8-digit 7-segment module | |
|---|---|
| Driver | 1 x MAX7219 (on the back) |
| Displays | 2 x 0.36" 4-digit, red, common cathode = 8 digits |
| Board | about 82 x 15 mm |
| Digit order | DIG0 = the RIGHTMOST digit, DIG7 = the leftmost |
| Segments | DP A B C D E F G = data bits D7 ... D0 |
| Headers | IN: VCC GND DIN CS CLK (left), OUT: VCC GND DOUT CS CLK (right) |
| Devices in this library | MAX7219SEG8TEP (Simple) / MAX7219SEG8ADVTEP (Advance) |
The MAX7219 Registers
| Address | Register | What it does on a 7-segment module |
|---|---|---|
| 0 | NO-OP | Nothing: lets a packet pass a chip in the chain |
| 1 - 8 | DIGIT 0 - 7 | The segments of each digit (or a Code B value) |
| 9 | DECODE MODE | Code B: the chip draws 0 - 9, -, E, H, L, P itself; 00 = raw segments |
| A | INTENSITY | 0 - 15: the duty from 1/32 to 31/32 |
| B | SCAN LIMIT | Digits 0 to n are shown; 7 shows all 8 |
| C | SHUTDOWN | 00 dark, 01 normal operation (the chip starts in shutdown) |
| F | DISPLAY TEST | 01 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
| Simple | Advance | |
|---|---|---|
| Device | MAX7219SEG8TEP | MAX7219SEG8ADVTEP |
| On the schematic | The module + the STATUS panel | The module only |
| Status | Banner, 10 readouts, the last 6 frames | A 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.LIBandArduinoV4TEP.LIBfrom our Arduino Library for Proteus V4.0. - Proteus Model Files:
TEPMAX7SEG.DLLandTEPARDUINO.DLL. - Proteus Simulation:
MAX7219-7Segment-ArduinoUnoV4.pdsprj,MAX7219_7Seg_Demo.hexand 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
- Close Proteus and extract the whole zip file, for example to your Desktop.
- 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). - Copy
TEPMAX7SEG.DLLandTEPARDUINO.DLLfrom Proteus Model Files into the MODELS folder. - Delete
TEPMAX7SEG.IDXfrom the LIBRARY folder if there is one. - 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
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.
Pinout
| Pin | Function | Arduino UNO (demo) |
|---|---|---|
| VCC / GND | The 5 V supply (the MAX7219 runs from 4 - 5.5 V) | 5V / GND |
| DIN | Serial data in | D12 |
| CLK | Serial clock: DIN is read on its rising edge | D11 |
| CS | LOAD: its rising edge latches the packet | D10 |
| DOUT (OUT header) | The data leaving the chip, for the next module | open in the demo |
| Property | Values | What it does |
|---|---|---|
| PANEL | OPEN (default), CLOSED | Simple device only: the STATUS panel at the start |
| COLOUR | RED (default), GREEN, BLUE, YELLOW, WHITE | The 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.
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);
}
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));
Brightness, Scan Limit, Display Test and Shutdown
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);
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);
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);
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);
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
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
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:
2. Serial Bus
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
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
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
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
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
| Command | What it does |
|---|---|
| HELP / STATUS | The 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|OFF | Dark / back, every segment lit |
| DECODE ON|OFF | Code B on LedControl's patterns: the classic mistake, and back |
How to Run the Demo
- Press Run; move the monitor windows and SEG2's pop-up aside.
- In ARD1's monitor type STATUS, NUMBER -12.345, TEXT HELP, INTENSITY 15, TEST ON and TEST OFF.
- Try the mistakes: SCAN 3 (then SCAN 7), DECODE ON (then DECODE OFF), SHUTDOWN ON (then SHUTDOWN OFF).
- 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 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
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 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
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!