A high-reliability communication framework bridging the RP2040 (Master) and ATmega328P (Slave). This project implements a hardware-level dual-bus architecture designed to decouple high-bandwidth display data from time-critical sensor telemetry.
The system utilizes the RP2040's dual hardware I2C controllers to optimize the Bit-Rate and prevent bus congestion:
0x0A) using onRequest interrupt handlers for sub-millisecond data retrieval.| Subsystem | Engineering Specification |
|---|---|
| Master Microcontroller | Raspberry Pi Pico (Dual-Core ARM Cortex-M0+) |
| Slave Microcontroller | Arduino Nano (ATmega328P) |
| Communication Protocol | Synchronous Serial (I2C) @ 100/400 kHz |
| Interrupt Routine | ISR-based Wire.onRequest() (Arduino-side) |
| Addressing Scheme | 7-bit (0x0A Slave / 0x3C Primary OLED) |
To prevent Race Conditions, display updates are strictly prohibited within the Slave's interrupt context. This architecture centralizes the UI rendering on the Pico Master, ensuring the Arduino remains dedicated to high-precision sensor polling.
The Arduino operates a local asynchronous polling loop for the MaxSonar sensor. It populates a data buffer that is served instantly upon a Master request, reducing the "Wait-State" of the main robot control loop.