Skip to content

Week 11. Embedded Networking and Communications

Hero Shot

Assignments for the Week

Group Assignment:

  • Send a message between two projects.

Link to the group Assignment is here

key takeaways from this week

  • It was really delightful to communicate with two different boards with different medium of communication protocols available.

  • While making connection with the components, we need to check the continuity of jumper wires because in some cases I found that some of the jumper wires are not working which consumed my time unnecessarily debugging the issue..

Individual Assignment:

  • Design, build, and connect wired or wireless nodes with network or bus addresses and local input or output devices.

For this embedded networking and communication week, I used my own micro controller board which I had made during electronics design week for which the link is given here

  • Pin out diagram for xiao RP2040

  • Pin out diagram for xiao Esp32C3

Since this week being the networking and communication, I tried to communicate between Xiao RP2040 and Xiao ESP32C3 through I2C connection which means by connecting the SDA and SCL pins of one board(xiao RP2040) to another board(xiao Esp32C3) for the communicatio. I kept the Xiao Rp2040 as the master board and Xiao ESP32C3 as a slave board. After that I connected the external LED to Pin D2 of the pin in Xiao ESP32C3 and run the command “LED ON” and “LED OFF” in serial monitor of Xiao RP2040 and observed that the LED is blinking on and off.

  • I2C stands for Inter-Integrated Circuit. It’s a serial communication protocol that allows multiple devices to communicate with each other using just two wires:

  • SCL (Serial Clock Line): Carries the clock signal to synchronize data transfer.

  • SDA (Serial Data Line): Carries the actual data being transferred.

How It Works:

  • The master sends a start condition to begin communication.

  • It sends the address of the slave device it wants to communicate with.

  • Data is transferred one byte at a time, synchronized with clock pulses from the master.

  • The slave acknowledges each byte received.

  • Once done, the master sends a stop condition to end the communication.

Kind of network using?

  • An I2C connection operates over a bus system, specifically an I2C bus. The I2C bus is not a network of nodes communicating over a shared medium; rather, it’s a point-to-multipoint communication setup where multiple devices can share the same two wires (SCL for clock, SDA for data).

Protocol used in I2C connection

  • The protocol used in I2C (Inter-Integrated Circuit) is a serial communication protocol designed for communication between multiple devices over two wires (SCL for clock and SDA for data). Here’s a breakdown of the key components and structure of the I2C protocol:

  • Master-Slave Architecture:

Master: The device that controls the clock (SCL) and initiates communication. Typically a microcontroller (e.g., Arduino, Raspberry Pi).

Slave(s): Devices that respond to the master’s requests, such as sensors, displays, EEPROMs, etc.

Functions of SDA and SCL pins in I2C connection

  1. SDA (Serial Data Line): Role: The SDA line is used to send and receive data between devices.

It carries the actual message (the bits of data) from the master to the slave, or from the slave to the master.

Data Transfer: Data is transferred one bit at a time (8 bits = 1 byte). Every time the clock (SCL) ticks, one bit is sent on SDA.

  1. SCL (Serial Clock Line): Role: The SCL line provides the timing or clock signal.

The master device controls this clock. It “ticks” the clock, telling the devices when to send or receive a bit of data.

Clocking: Each clock pulse moves the data forward. So, for every tick of the SCL line, one bit is transmitted on the SDA line.

How the message is sent and address in I2C connection

  • Master starts the conversation, sends address + read/write bit, then data.

  • Slaves respond with Acknowledgement to confirm.

  • Communication ends with a Stop signal.

This was the mistake which I had made while uploading the code as I had selected the wrong port so the code was not uploading. Next I selected the right port, then only my code got uploaded.

Disclaimer: All the Assignments and Documentations are done and written by me and for understanding more regarding the I2C connection and protocol, I had referred Chatgpt and google for the assistance.

Files for the week:

It was really nice in learning embedded programing and especially while using Blynk app I was really interested in exploring many new things.