Skip to content

Latest commit

Β 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”Œ RSL10-Arduino I2C Communication

C Arduino RSL10 License

Reliable bidirectional I2C communication between RSL10 (master) and Arduino (slave) using software I2C bit-bang implementation.

Embedded systems β€’ Low-level protocols β€’ 3.3V compatible β€’ 90%+ success rate


πŸ“‹ Overview

This project implements reliable I2C communication between an ON Semiconductor RSL10-002GEVB (master) and Arduino Nano (slave). The RSL10 uses a software I2C bit-bang implementation, allowing flexible GPIO selection and reliable communication at 30-40 kHz.

🎯 Key Features

Feature Description
πŸ”§ Software I2C Bit-bang implementation on RSL10 GPIO
βš™οΈ Hardware I2C Native Wire library on Arduino
↔️ Bidirectional Data transfer with acknowledgment
⚑ 3.3V Logic Direct connection without level shifters
πŸ”„ Error Handling Retry logic and status codes
βœ… 90%+ Success Tested and verified reliability

πŸ—οΈ System Architecture

sequenceDiagram
    participant RSL10 as RSL10 (Master)
    participant I2C as I2C Bus
    participant Arduino as Arduino (Slave)

    Note over RSL10,Arduino: Address: 0x55

    loop Communication Cycle
        RSL10->>I2C: START condition
        RSL10->>I2C: Send address + W (0xAA)
        I2C->>Arduino: Address match
        Arduino-->>I2C: ACK
        RSL10->>I2C: Send data byte
        Arduino-->>I2C: ACK
        RSL10->>I2C: STOP condition
        
        Note over Arduino: Process: data + 1
        
        RSL10->>I2C: START condition
        RSL10->>I2C: Send address + R (0xAB)
        Arduino-->>I2C: ACK + response byte
        RSL10->>I2C: NACK + STOP
        
        Note over RSL10: Verify: response == data + 1
    end
Loading

πŸ› οΈ Hardware Requirements

Components

Component Description Quantity
RSL10-002GEVB ON Semiconductor dev board 1
Arduino Nano 3.3V or 5V with level shifting 1
Resistors 2.7kΞ© for I2C pull-ups 2
Jumper Wires Male-to-male 4+
Breadboard For prototyping 1

Pin Connections

RSL10 Pin Signal Arduino Pin Notes
3.3V VCC 3.3V ⚠️ Use 3.3V only
GND Ground GND Common ground
DIO2 SDA A4 + 2.7kΞ© pull-up
DIO3 SCL A5 + 2.7kΞ© pull-up

Wiring Diagram

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        I2C BUS WIRING                           β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                 β”‚
β”‚    RSL10-002GEVB                         Arduino Nano           β”‚
β”‚    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”           β”‚
β”‚    β”‚      3.3Vβ”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€3.3V      β”‚           β”‚
β”‚    β”‚          β”‚                          β”‚          β”‚           β”‚
β”‚    β”‚     DIO2 β”œβ”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€A4 (SDA) β”‚           β”‚
β”‚    β”‚    (SDA) β”‚    β”‚                   β”‚   β”‚          β”‚           β”‚
β”‚    β”‚          β”‚   β”Œβ”΄β”                  β”‚   β”‚          β”‚           β”‚
β”‚    β”‚          β”‚   β”‚ β”‚ 2.7kΞ©            β”‚   β”‚          β”‚           β”‚
β”‚    β”‚          β”‚   β””β”¬β”˜                  β”‚   β”‚          β”‚           β”‚
β”‚    β”‚          β”‚    └───── 3.3V β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚          β”‚           β”‚
β”‚    β”‚          β”‚                            β”‚          β”‚           β”‚
β”‚    β”‚     DIO3 β”œβ”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€A5 (SCL) β”‚           β”‚
β”‚    β”‚    (SCL) β”‚    β”‚                   β”‚   β”‚          β”‚           β”‚
β”‚    β”‚          β”‚   β”Œβ”΄β”                  β”‚   β”‚          β”‚           β”‚
β”‚    β”‚          β”‚   β”‚ β”‚ 2.7kΞ©            β”‚   β”‚          β”‚           β”‚
β”‚    β”‚          β”‚   β””β”¬β”˜                  β”‚   β”‚          β”‚           β”‚
β”‚    β”‚          β”‚    └───── 3.3V β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚          β”‚           β”‚
β”‚    β”‚          β”‚                            β”‚          β”‚           β”‚
β”‚    β”‚      GND β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€GND       β”‚           β”‚
β”‚    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜           β”‚
β”‚                                                                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

⚠️ Logic Level Warning

πŸ”΄ CRITICAL: Voltage mismatch can damage RSL10!

Configuration Status
Arduino powered by RSL10 3.3V βœ… Safe
Arduino USB + RSL10 connected ❌ Dangerous
Using level shifter (3.3V ↔ 5V) βœ… Safe
3.3V Arduino variant βœ… Safe

πŸš€ Quick Start

1️⃣ Clone Repository

git clone https://github.com/surbalo1/RSL10-Arduino-I2C-Communication.git
cd RSL10-Arduino-I2C-Communication

2️⃣ Upload Arduino Code

# Open arduino_slave/arduino_i2c_slave.ino in Arduino IDE
# Select: Tools > Board > Arduino Nano
# Select: Tools > Port > (your port)
# Click Upload
# Disconnect USB after upload

3️⃣ Setup RSL10 Project

  1. Import rsl10_master into Eclipse IDE
  2. Build the project
  3. Flash to RSL10 using J-Link

4️⃣ Wire Hardware

Follow the wiring diagram above with pull-up resistors.

5️⃣ Monitor Output

RSL10 (SEGGER RTT Viewer):

TX: 0x00 βœ“ | RX: 0x01 βœ“
[1] TX: 0x01 βœ“ | RX: 0x02 βœ“
--- Stats: Success=10, Fail=0 ---

Arduino (Serial Monitor @ 115200):

Listening on 0x55
RX: 0x00 (0)
TX: 0x01

πŸ“ Project Structure

RSL10-Arduino-I2C-Communication/
β”œβ”€β”€ πŸ“„ README.md              # Documentation
β”œβ”€β”€ πŸ“„ LICENSE                # MIT License
β”‚
β”œβ”€β”€ πŸ“ rsl10_master/          # RSL10 firmware
β”‚   β”œβ”€β”€ include/              # Header files
β”‚   β”‚   └── i2c_hal.h         # I2C driver interface
β”‚   └── source/               # Source files
β”‚       β”œβ”€β”€ main.c            # Main application
β”‚       └── i2c_hal.c         # Software I2C implementation
β”‚
β”œβ”€β”€ πŸ“ arduino_slave/         # Arduino firmware
β”‚   └── arduino_i2c_slave.ino # I2C slave implementation
β”‚
└── πŸ“ docs/                  # Additional documentation
    β”œβ”€β”€ wiring_guide.md       # Detailed wiring instructions
    └── troubleshooting.md    # Common issues & solutions

βš™οΈ How It Works

Communication Flow

  1. RSL10 (Master) sends a byte to Arduino at address 0x55
  2. Arduino (Slave) increments the byte and stores response
  3. RSL10 reads back the response
  4. RSL10 verifies: response == original + 1

Technical Details

Parameter Value
Slave Address 0x55
I2C Speed ~30-40 kHz
Implementation Software bit-bang (RSL10)
Read/Write Delay 100ms recommended

πŸ“Š Performance

Metric Value
I2C Clock 30-40 kHz
Success Rate 90%+ after initial sync
Recommended Delay 100ms between transactions
Wire Length <20cm recommended

πŸ”§ Configuration

Adjust I2C Speed

In i2c_hal.c:

#define I2C_DELAY 250  // Higher = slower, more reliable

Change Slave Address

File Line
Arduino #define SLAVE_ADDRESS 0x55
RSL10 #define ARDUINO_ADDR 0x55

πŸ› οΈ Development Environment

Tool Purpose
Eclipse IDE RSL10 development
RSL10 SDK ON Semiconductor libraries
J-Link Debugging & flashing
SEGGER RTT Debug output
Arduino IDE Arduino programming

πŸ› Troubleshooting

Issue Solution
No communication Check wiring, pull-ups, common ground
Intermittent failures Increase I2C_DELAY, shorten wires
NACK on all addresses Verify slave address matches
Noisy signal Add 100nF capacitor near Arduino

πŸ“„ License

MIT License - see LICENSE file.


πŸ™ Acknowledgments

  • ON Semiconductor RSL10 SDK
  • Arduino Wire library
  • Open-source I2C community

Built with ⚑ for embedded systems enthusiasts

GitHub

About

Reliable bidirectional I2C communication between RSL10-002GEVB (master) and Arduino Nano (slave). Features software I2C bit-bang implementation on RSL10, hardware I2C on Arduino, 3.3V logic compatibility, and tested data transfer with error handling. Includes complete working code, wiring diagrams, and troubleshooting guide.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages