A complete embedded systems project for controlling a 32ร16 LED matrix display using ATmega16 microcontroller with scrolling text, button controls, and UART communication.
This project implements a professional-grade LED matrix display controller that can:
- Display scrolling text messages
- Accept new messages via UART/Serial communication
- Control scroll speed, direction, and text position using physical buttons
- Maintain smooth 250Hz refresh rate for flicker-free display
- Support real-time message updates without interrupting display operation
- Real-time Text Display: Smooth scrolling text with customizable speed and direction
- UART Communication: Send new messages via serial terminal
- Button Controls: 5 physical buttons for speed, direction, and position control
- High Performance: Hardware SPI communication for optimal display refresh
- User-Friendly: Clear feedback via UART for all button operations
- Professional Code: Well-documented, beginner-friendly codebase
Complete hardware setup showing ATmega16 microcontroller, VMA419 LED matrix display, control buttons, and wiring connections
VMA419 LED matrix display showing scrolling text in operation
Video.mp4
Complete demonstration showing scrolling text, button controls, UART communication, and all features in action
Note: If the video doesn't play directly in GitHub, you can download it from the
image/Video.mp4file to view locally.
- Microcontroller: ATmega16 (or compatible AVR)
- Display: VMA419 32ร16 LED Matrix Display
- Buttons: 5x Push buttons for user controls
- Communication: UART/USB-to-Serial adapter
- Power Supply: 5V DC power source
| VMA419 Pin | ATmega16 Pin | Function |
|---|---|---|
| VCC | +5V | Power supply |
| GND | GND | Ground |
| A | PA1 | Row select A |
| B | PA2 | Row select B |
| LATCH | PA4 | Data latch |
| OE | PD7 | Output enable |
| MOSI | PB5 | SPI data (hardware SPI) |
| SCK | PB7 | SPI clock (hardware SPI) |
| Button Function | ATmega16 Pin | Description |
|---|---|---|
| Speed Up | PC0 | Increase scroll speed |
| Speed Down | PC1 | Decrease scroll speed |
| Direction Toggle | PC2 | Change scroll direction |
| Text Up | PC6 | Move text up |
| Text Down | PC7 | Move text down |
| Signal | ATmega16 Pin | Function |
|---|---|---|
| TXD | PD1 | Serial transmit |
| RXD | PD0 | Serial receive |
Note: All buttons should be connected with pull-up resistors (10kฮฉ) and debouncing capacitors (100nF) for reliable operation.
- Connect the VMA419 display according to the pin connection table
- Wire all 5 control buttons with proper pull-up resistors
- Connect UART pins for serial communication
- Apply 5V power to the system
- Clone or download this project
- Open the project in MPLAB X IDE
- Configure your programmer (USBASP, STK500, etc.)
- Build and upload the firmware to ATmega16
- Power on the system
- The display should show "WELCOME ERASMUS STUDENTS"
- Open a serial terminal (9600 baud, 8N1)
- Test button controls and UART communication
- PC0 (Speed Up): Makes text scroll faster (minimum: 5ms delay)
- PC1 (Speed Down): Makes text scroll slower (maximum: 100ms delay)
- PC2 (Direction): Toggles between left-to-right and right-to-left scrolling
- PC6 (Text Up): Moves text up (Y position 0-15)
- PC7 (Text Down): Moves text down (Y position 0-15)
- Send any text: Replace the scrolling message with your custom text
- Maximum length: 31 characters per message
- Real-time update: Message changes immediately without stopping the display
- Baud Rate: 9600
- Data Bits: 8
- Parity: None
- Stop Bits: 1
- Flow Control: None
Final_Project.X/
โโโ main.c # Main program with button handling and UART
โโโ vma419.c # VMA419 display driver implementation
โโโ vma419.h # VMA419 driver header and API
โโโ VMA419_Font.h # 5ร7 pixel font definitions and text rendering
โโโ fesb_logo.h # FESB logo bitmap data
โโโ Makefile # Build configuration
โโโ README.md # This documentation
โโโ nbproject/ # MPLAB X project files
โโโ configurations.xml
โโโ project.xml
โโโ Makefile-*.mk
- Resolution: 32ร16 pixels (512 total LEDs)
- Color: Monochrome red LEDs
- Refresh Rate: 250Hz (flicker-free)
- Multiplexing: 4-phase row scanning
- Memory Usage: 64 bytes frame buffer
- SPI Interface: Hardware SPI for optimal performance
- Clock Speed: Maximum (fosc/4) for fastest data transfer
- Data Format: MSB first, compatible with VMA419 shift registers
- Display Update: ~250ฮผs per full scan cycle
- Button Debouncing: 200ms debounce period
- UART Buffer: Circular buffer with overflow protection
- Memory Footprint: ~2KB flash, ~100 bytes RAM
- MPLAB X IDE: v6.00 or later
- XC8 Compiler: v2.40 or later
- Serial Terminal: PuTTY, Tera Term, or Arduino Serial Monitor
- Open MPLAB X IDE
- Open the project folder
- Select your target device (ATmega16)
- Configure programmer settings
- Build project (Build โ Build Project)
- Program device (Run โ Run Project)
- Use UART output for debugging (all button presses send feedback)
- Check power supply stability (5V ยฑ0.25V)
- Verify SPI connections for proper display operation
- Ensure proper button debouncing circuit
vma419_init() // Initialize display system
vma419_clear() // Clear all LEDs
vma419_set_pixel() // Control individual LEDs
vma419_scan_display_quarter() // Refresh display (call continuously)vma419_font_draw_char() // Draw single character
vma419_font_draw_string() // Draw text string
vma419_font_draw_string_centered() // Center text on displayUSART_Init() // Initialize serial communication
USART_SendString() // Send text via UART
USART_Receive() // Receive characters from UARTscroll_text[32] // Current display message
scroll_position // Horizontal text position
scroll_speed // Delay between scroll steps
scroll_direction // -1 (left) or +1 (right)
text_y_offset // Vertical text position- Edit
VMA419_Font.hto modify character patterns - Each character is 5ร7 pixels stored as bitmap data
- Add new characters by extending the font array
- Modify scroll speed range in button handlers
- Change refresh rate by adjusting delay in main loop
- Optimize SPI speed in
vma419.c
- Extend UART protocol for more commands
- Add more button functions
- Implement different text effects (blink, fade, etc.)
Display not working:
- Check 5V power supply
- Verify SPI pin connections (MOSI=PB5, SCK=PB7)
- Ensure ground connections
Buttons not responding:
- Check pull-up resistors (10kฮฉ)
- Verify debouncing capacitors (100nF)
- Test button debounce timing
UART communication issues:
- Confirm baud rate (9600)
- Check TX/RX pin connections
- Verify serial terminal settings
Flickering display:
- Ensure stable power supply
- Check refresh rate timing
- Verify SPI signal integrity
This project demonstrates key embedded systems concepts:
- Hardware Interfacing: SPI, GPIO, UART communication
- Real-time Systems: Continuous display refresh with user interaction
- Memory Management: Efficient frame buffer usage
- User Interface Design: Button debouncing and feedback
- Modular Programming: Clean separation of display, font, and main logic
Perfect for embedded systems courses, microcontroller programming learning, or portfolio projects!
This project is open-source and available for educational use. Feel free to modify and improve the code for your own projects.
Authors: Arnold Dsouza & Miลosz Markiewicz
Embedded Systems Project
Date: June 2025
For questions or improvements, please create an issue or submit a pull request.