SparkFun Qwiic Alphanumeric Display Application
Overview
This application demonstrates integration between NetBurner's RTOS platform and the SparkFun Qwiic Alphanumeric Display (COM-16919). The program initializes both network services and the I2C display, then continuously shows a running seconds counter on the 4-digit alphanumeric display.
Hardware Requirements
- NetBurner development board with I2C/Wire support
- SparkFun Qwiic Alphanumeric Display (COM-16919)
- Qwiic connector cable or appropriate I2C wiring connections
Key Features
- Network Integration: Full network stack initialization with HTTP web server
- I2C Communication: Direct interface with HT16K33 display controller
- Real-time Display: Live system uptime counter (0-9999 seconds, cycling)
- Connection Verification: Automatic display connectivity checking
- Development Diagnostics: Built-in system diagnostics for debugging
Application Architecture
Initialization Sequence
- Network Setup
- Initialize NetBurner network stack
- Enable system diagnostics for development
- Wait up to 25 seconds for active network connection
- Start HTTP web server on default port 80
- Display Configuration
- Initialize I2C Wire interface
- Configure HT16K33 display controller
- Verify display connection status
- Display initial "NBRN" message
- Pause 1 second before entering main loop
- Main Operation Loop
- Monitor system seconds counter continuously
- Update display with current seconds (modulo 10000)
- Output status indicators to console
Core Components
SerialIf Serial;
HT16K33 disp;
Wire interface class.
Definition Wire.h:43
Display Operations
The application utilizes the SparkFun Alphanumeric Display library:
begin() - Initialize display hardware
isConnected(0) - Verify I2C connection
print() - Display text and numeric values
Usage Instructions
Hardware Setup
- Connect the SparkFun Qwiic Alphanumeric Display to your NetBurner board
- Use either Qwiic connector cable or manual I2C wiring (SDA/SCL)
- Ensure proper power connections
Software Deployment
- Compile the application using NetBurner development tools
- Upload the compiled firmware to your NetBurner board
- Monitor serial console for initialization status
Expected Behavior
Serial Console Output:**
Web Application: SparkFunAlphaDisplay
NNDK Revision: [version number]
Begin True/false
Connected True/false
. . . . (status dots every second)
Display Sequence:**
- Initial display shows "NBRN" for 1 second
- Continuous seconds counter (0000-9999, then cycles back to 0000)
- Updates every second with current system uptime
Code Structure
Main Function Flow
void UserMain(void *pd)
{
Wire.begin();
disp.begin();
disp.isConnected(0);
while (1) {
}
}
#define TICKS_PER_SECOND
System clock ticks per second.
Definition constants.h:49
void StartHttp(uint16_t port, bool RunConfigMirror)
Start the HTTP web server. Further documentation in the Initialization section Initialization - Syste...
void init()
System initialization. Ideally called at the beginning of all applications, since the easiest Recover...
void EnableSystemDiagnostics()
Turn on the diagnostic reports from the config page.
bool WaitForActiveNetwork(uint32_t ticks_to_wait=120 *TICKS_PER_SECOND, int interface=-1)
Wait for an active network connection on at least one interface.
Timing Considerations
- Network timeout: 25 seconds maximum wait
- Display update rate: Every 1 second
- Initial display pause: 1 second
- Console status output: Every second
Development Notes
Production Considerations
Display Limitations
- 4-digit alphanumeric format limits counter to 0-9999
- Counter automatically cycles back to 0000 after reaching 9999
- Display uses modulo arithmetic:
Secs % 10000
Network Features
- HTTP web server runs on port 80
- Network diagnostics enabled for development
- Connection monitoring with timeout protection
Troubleshooting
Common Issues
Display Not Initializing**
- Check I2C connections (SDA/SCL pins)
- Verify power supply to display
Confirm I2C address conflicts
Connection Status False**
- Verify proper I2C wiring
- Check display power connections
Ensure correct I2C address (default for HT16K33)
Network Timeout**
- Verify network configuration
- Check Ethernet cable connections
Confirm network settings in NetBurner configuration
No Display Updates**
- Verify main loop execution
- Check that seconds counter is incrementing
- Confirm I2C communication is functioning
Debug Information
The application provides comprehensive debug output:
- Application name and NNDK revision
- Display initialization status
- Connection verification results
- Real-time status indicators (dots every second)
Dependencies
Required Libraries
- NetBurner RTOS core libraries
- SparkFun Alphanumeric Display library
- Standard I2C/Wire communication libraries
- Network stack libraries
Technical Specifications
Display Controller
- Chip: HT16K33 LED controller
- Interface: I2C communication
- Display Type: 4-digit alphanumeric
- Update Rate: 1 Hz (every second)
Network Services
- Web Server: HTTP on port 80
- Connection Timeout: 25 seconds
- Diagnostics: Development mode enabled
System Integration
- Platform: NetBurner RTOS
- Communication: I2C (Wire library)
- Timing: RTOS tick-based scheduling
Related Documentation
- SparkFun Qwiic Alphanumeric Display (COM-16919) datasheet
- NetBurner RTOS documentation
- HT16K33 LED controller specifications
- I2C communication protocols