Displays_HDSP_Raw is an advanced, non-blocking hardware-interrupted driver developed for vintage alphanumeric LED matrix displays, specifically the Broadcom / HP / Agilent HDSP-2000, HDSP-2001, and HDSP-2003 series. These iconic smart displays do not contain an internal character ROM. Instead, they feature on-board shift registers that require constant pixel-by-pixel multiplexing. This library handles all the heavy lifting automatically.
Key Features
- Background Multiplexing (ISR): Display driving is completely offloaded to a hardware timer interrupt (Timer 1). This ensures a flicker-free refresh rate of ~500 Hz while leaving your main
loop()100% free for sensor readings or other logic. - Cascading & Dynamic Memory: The display buffer scales dynamically during initialization. You can easily daisy-chain multiple 4-digit modules together in series (e.g., 2, 4, or even 10 modules for up to 40 characters) without changing the core library code.
- RAM Stability Optimization: Built and hardened against stack corruption bugs. Functions like integer printing are heavily optimized to prevent Arduino Nano/Uno (ATmega168/328P) microcontrollers from freezing during long runtimes.
- UTF-8 Czech Diacritics Sanitization: Features a built-in character translation layer that strips 2-byte UTF-8 Czech accents (á, č, ř, ž, etc.) on the fly, rendering them as clean, visible single-byte ASCII characters.
Hardware Architectural Layouts
The library provides two dedicated classes tailored to your specific PCB layout:
Displays_HDSP_Raw– Columns are switched directly via Arduino GPIO pins (through external power transistors). Ideal for simple, low-component setups.Displays_HDSP_Raw_Shift– Matrix columns are offloaded to a 74HC595 shift register. This approach reduces the microcontroller pin count down to 5 pins total, which is highly recommended for driving long display rows.
Library API Reference (Command Description)
Both classes implement the Universal_Display interface, making it easy to migrate your code. Below is the detailed description of all available commands:
1. Initialization & Buffer Control
void begin()
Configures all assigned data, clock, and column pins asOUTPUT, clears the internal memory buffer, and activates the Hardware Timer 1 background interrupt service routine.
Example:display.begin();void clear()
Wipes the entire graphics buffer by setting all pixel columns to0x00(blanks the screen). Does not affect background timer execution.
Example:display.clear();
2. Text & Numerical Printing
void print(const char* text)
Writes a standard string into the display buffer. It automatically applies the UTF-8 sanitization filter to process any Czech characters safely.
Example:display.print("HELLO!");void print(int number)
Converts a standard signed integer into a string representation using a safe, isolated memory stack buffer and outputs it onto the screen.
Example:display.print(-154);void writeDigit(uint8_t position, char character)
Writes a single ASCII character to a specific absolute position on the display (indexed from 0 up tonumDigits - 1). Automatically fetches data rows from the Flash-stored PROGMEM font table.
Example:display.writeDigit(0, 'A'); // Writes 'A' to the far-left digit
3. Custom Graphics & Hardware Tuning
void createChar(uint8_t slot, const uint8_t rowData[])
Loads a custom 5-byte pixel column array directly into a specific digit slot. This allows you to bypass the built-in ASCII font map and draw custom logos, degree symbols, or custom icons generated by the companion tool.
Example:const uint8_t heart[] = {0x1C, 0x3E, 0x7C, 0x3E, 0x1C};display.createChar(0, heart); // Renders a heart symbol on digit 0void setGlowDelay(uint16_t usDelay)
Adjusts the software-based PWM dimming. It sets the active glow window duration in microseconds for each column during multiplexing phase. Lower values dim the screen and save power; higher values maximize brightness.
Example:display.setGlowDelay(500); // Set column glow time to 500 microseconds
Visual Matrix Glyph Generator Tool
Because the internal memory registers of the HDSP retro series require an offset bit-shift (2 << diodeNr), traditional online 5×7 font generators produce corrupted or shifted graphics.
To solve this, an interactive utility named Font Generator.html is included in the library’s extras/ folder. You can open this file in any web browser, click on the matrix pixels to draw your shape, and click the copy button to grab a pre-formatted C++ array that plugs straight into the createChar() method.