Data Transmission
Microcontroller boards exchange data with connected modules or components (sensors, relays, actuators, communication modules, and so on) using one of three communication protocols.
It is important to know which protocol is used for each component so that you make the right connections and include the required libraries and configuration in your code.
All components exchange data with the Microcontroller board using one of three communication protocols (UART, SPI, or I2C) which can be understood by the pins on the component. Microcontroller boards have limited pins for each protocol so if multiple components using the same protocol have to be connected there may be some code changes required.
There are three main protocols, all of which are explained in detail in the lessons.
UART communication requires two dedicated pins per component, but almost all pins on a microcontroller board can be used for UART communication with the required code changes.
SPI communication requires four specific pins (COPI, CIPO, CS, and SCK). While mulitple SPI components can be connected to the same set of microcontroller board pins some code is required to select the component to exchange data with.
I2C communication requires two specific pins (SDA and SCL). But each I2C component is programmed with a specific address so multiple components can be managed with the same set of microcontroller board pins as long as they have different addresses.