Skip to content

14. Embedded Networking and Communications

This week I learned how to use different wireless and wired networking techniques and used a milled board to demonstrate types of networking

Considerations

Networking Types

Because I’m already familiar with I2C, I decided that for wired networking I’m going to focus on the 2 other types of networking that the RP2040 is compatable with, UART and SPI. I plan on milling a board with a rasberry pi pico W and a seeed studio rp2040, with the 2 boards connected via UART and SPI. I’ll use the pico w and network it wirelessly with my computer over wifi.

Understanding Uart

UART is an asynchronous communicaton protocol, which means that there is no clock signal to synchronize the data. Instead of a clock signal, the transmitting signal adds start and stop bits to the data being transferred, so that the recieving device knows when to start and when to stop reading. Uart uses 2 wires. One wire transmits signal, and one recieves signal. The transmitting signal on one device connects to the recieving signal on the other device and vice versa. UART data travels in packets, which means that bits of data are sent in groups, rather than bit by bit. Every UART packet contains 1 bit that signals the start of transmission, an optional 1 parity bit, which is used for error detection, and then 1 or 2 stop bits to signal the ending of transmission. The advantages of UART are that you only need 2 wires, there is error checking capability’s, and no clock signal is required. However some disadvantages are the the amount of data per packet is limited to 9 bits, and you can’t have more than 1 master or slave controller, unlike I2C. https://www.circuitbasics.com/basics-uart-communication/ is where I got all of this information from, and has usefull graphics that helped me better understand UART.

Understanding SPI

SPI is a Synchronous communication protocol which needs 4 wires to function. SPI is commonly used to send data between microcontrollers, but can also be used for communication between peripherals like sensors and sd cards. Like I2C, SPI has a clock line that keeps both sides of the data line in sync. The clock signal is only generated from one side, and this side is designated as the controller, and the side that recieves the clock signal is the peripheral, (Outdated terms are Master and Slave, respectively). Unlike I2C, there are 2 lines to send data, data send from the controller to the peripheral is called PICO (Peripheral In / Controller Out), Data sent vice-versa is sent on the POCI line (Peripheral Out / Controller in). This allows in some cases for data to be transmitted and recieved at the same time. The last line that’s a part of SPI is the Chip Select, or (CS) line. The CS line activates the device connected to it when it is brought low, this allows different chips to be designated, so multiple peripherals can be used at the same time. This is similar to an XSHUT or shutoff pin when using I2C. Some advantages of SPI are that no start and stop bits need to be sent as there is the synch line, it can run at extremely high speeds, and data can be sent and recieved at the same time. Some of the disadvantages are that it needs 4 wires to run, less devices support SPI than other interfaces like UART and I2C, and programming for SPI can be a little more complicated. I got all my information about SPI from https://learn.sparkfun.com/tutorials/serial-peripheral-interface-spi/all

The Basics of Wifi Networking

Wi-Fi is the first type of wireless networking I want to try. Even though I’m constantly using it, I’ve never took the time to understand the basics of it until now. WiFi is technically a standardized protocol for creating a wireless local network. Wifi broadcasts radio waves over unlicensed channels. Wifi on it’s own is not the internet, but just a way of broadcasting the information recieved from it. Because I will just be using WiFi as a networking tool, I could use a WiFi network not connected to the internet, as all I really need is to use the communication standared. One feature of wifi that makes it slightly different than other communication types is that information is sent through waves, which means that it is initially an analog signal. That means that any device that has Wifi capabilities must have an Analog-to-digital converter (or be an analog processor). Because of this, the signal needs to be filtered and processed before it is able to be used by a microcontroller.

13. Embedded Networking and Communications

This week I learned how to use different wireless and wired networking techniques and used a milled board to demonstrate types of networking

Considerations

Networking Types

Because I’m already familiar with I2C, I decided that for wired networking I’m going to focus on the 2 other types of networking that the RP2040 is compatable with, UART and SPI. I plan on milling a board with a rasberry pi pico W and a seeed studio rp2040, with the 2 boards connected via UART and SPI. I’ll use the pico w and network it wirelessly with my computer over wifi.

Understanding Uart

UART is an asynchronous communicaton protocol, which means that there is no clock signal to synchronize the data. Instead of a clock signal, the transmitting signal adds start and stop bits to the data being transferred, so that the recieving device knows when to start and when to stop reading. Uart uses 2 wires. One wire transmits signal, and one recieves signal. The transmitting signal on one device connects to the recieving signal on the other device and vice versa. UART data travels in packets, which means that bits of data are sent in groups, rather than bit by bit. Every UART packet contains 1 bit that signals the start of transmission, an optional 1 parity bit, which is used for error detection, and then 1 or 2 stop bits to signal the ending of transmission. The advantages of UART are that you only need 2 wires, there is error checking capability’s, and no clock signal is required. However some disadvantages are the the amount of data per packet is limited to 9 bits, and you can’t have more than 1 master or slave controller, unlike I2C. https://www.circuitbasics.com/basics-uart-communication/ is where I got all of this information from, and has usefull graphics that helped me better understand UART.

Understanding SPI

SPI is a Synchronous communication protocol which needs 4 wires to function. SPI is commonly used to send data between microcontrollers, but can also be used for communication between peripherals like sensors and sd cards. Like I2C, SPI has a clock line that keeps both sides of the data line in sync. The clock signal is only generated from one side, and this side is designated as the controller, and the side that recieves the clock signal is the peripheral, (Outdated terms are Master and Slave, respectively). Unlike I2C, there are 2 lines to send data, data send from the controller to the peripheral is called PICO (Peripheral In / Controller Out), Data sent vice-versa is sent on the POCI line (Peripheral Out / Controller in). This allows in some cases for data to be transmitted and recieved at the same time. The last line that’s a part of SPI is the Chip Select, or (CS) line. The CS line activates the device connected to it when it is brought low, this allows different chips to be designated, so multiple peripherals can be used at the same time. This is similar to an XSHUT or shutoff pin when using I2C. Some advantages of SPI are that no start and stop bits need to be sent as there is the synch line, it can run at extremely high speeds, and data can be sent and recieved at the same time. Some of the disadvantages are that it needs 4 wires to run, less devices support SPI than other interfaces like UART and I2C, and programming for SPI can be a little more complicated. I got all my information about SPI from https://learn.sparkfun.com/tutorials/serial-peripheral-interface-spi/all

The Basics of Wifi Networking

Wi-Fi is the first type of wireless networking I want to try. Even though I’m constantly using it, I’ve never took the time to understand the basics of it until now. WiFi is technically a standardized protocol for creating a wireless local network. Wifi broadcasts radio waves over unlicensed channels. Wifi on it’s own is not the internet, but just a way of broadcasting the information recieved from it. Because I will just be using WiFi as a networking tool, I could use a WiFi network not connected to the internet, as all I really need is to use the communication standared. One feature of wifi that makes it slightly different than other communication types is that information is sent through waves, which means that it is initially an analog signal. That means that any device that has Wifi capabilities must have an Analog-to-digital converter (or be an analog processor). Because of this, the signal needs to be filtered and processed before it is able to be used by a microcontroller.


Last update: April 3, 2024