Communication

Communication in embedded systems refers to the exchange of data between different components, devices, or subsystems within an embedded system. Embedded systems are specialized computing systems designed to perform specific functions or tasks, and they often consist of multiple interconnected components that need to share information.
Communication in embedded systems can take various forms, depending on the requirements of the system and the nature of the devices involved.
Common Aspects
- Inter-Component Communication:
- Embedded systems typically comprise various components, such as microcontrollers, sensors, actuators, memory modules, and communication interfaces.
- Sensor-Processor Communication:
- Sensors are essential components in many embedded systems, providing data about the system’s environment or parameters.
- Communication between sensors and the processing unit (microcontroller or processor) involves transmitting sensor data to the processor for analysis and decision-making.
- Actuator-Control Communication:
- Actuators are devices that carry out physical actions based on the instructions from the embedded system’s processing unit.
- Communication from the processing unit to actuators involves sending control signals to trigger specific actions in response to the system’s requirements.
- Bus Communication:
- Many embedded systems use buses (communication channels) to facilitate data transfer between different components.
- Buses can be parallel or serial, and communication protocols like I2C, SPI, or UART are often used to manage data exchange over these buses.
- Wireless Communication:
- In some embedded systems, wireless communication methods such as Bluetooth, Wi-Fi, or Zigbee may be employed.
- Wireless communication enables flexibility and mobility in applications like IoT (Internet of Things), where devices need to communicate without physical connections.
- Real-Time Communication:
- Certain embedded systems require real-time communication to meet strict timing constraints.
- Real-time communication protocols and techniques ensure that data is exchanged within specified time limits, critical for applications like control systems and robotics.
- Networked Communication:
- Embedded systems may be part of larger networks, requiring communication protocols at the network level.
- Network communication allows embedded systems to share data with other systems, servers, or cloud services.
Selecting the appropriate communication methods and protocols is crucial in designing efficient and reliable embedded systems. The choice depends on factors such as data rate, distance, power consumption, and the specific requirements of the application. Common communication protocols, as mentioned earlier, include UART, I2C, SPI, CAN, Ethernet, and various wireless standards.
Communication methods
- Synchronous Communication: Based on clock pulse
- Asynchronous Communication: No clock pulse, based upon the register configuration (Internal clock pulse)
Diff types in Embedded systems are as follows
- Synchronous Serial Communication Interface: I2C, SPI, SSC and ESSI (Enhanced Synchronous Serial Interface)
- Asynchronous Serial Communication Interface: UART
Communication methods can segregated as follow in general term
- Simplex
- Duplex or Full Duplex
- Half Duplex
Duplex
- What is a duplex?: duo – double and plex – part of
Full-duplex communication
What is full-duplex communication?
The transmission of the data in two directions simultaneously.
- Eg: Telephone communication (Both users can talk at once),
- Wired communication protocols: SPI, UART,
Half-duplex communication?
What is half-duplex communication?
The transmission of the data in two directions simultaneously.
- Eg: Walkie-talkie communication (a single user can talk at once, another should wait a minute).
- Wired communication protocols: I2C, One WIre.
Real-Time Examples
- Simplex: One-way communications (TV Telecasting), Eg: IR Remote (Only transmit)
- Half-Duplex, Eg: I2C, One Wire and
- Full-Duplex, Eg: SPI, UART
Communication Protocol
What is a communication protocol?
In telecommunications, a communications protocol is a system of digital rules for data exchange within or between computers. Communicating systems use well-defined formats (protocol) for exchanging messages. Serial Communication Interfaces (SCI) are RS-232, RS-422, RS-485 etc.
Communication Categories
| Communication Type | Protocols/ Categories |
|---|---|
| Network | Ethernet, LonWorks, etc |
| Timers | PLL(s), Capture/Compare and Time Processing Units. |
| Discrete IO | aka General Purpose Input/Output (GPIO) |
| Fieldbuses | CAN-Bus, LIN-Bus, PROFIBUS, etc. |
| Analog to Digital/Digital to Analog | ADC DAC |
| Debugging | JTAG, ISP, ICSP, BDM Port, BITP and DP9 ports |
Type of Communications
Simplex Communication: One-way communication. The receiver can’t resend data back to the transmitter.
Duplex Communication: Two or both-way communication.
- Half Duplex: Two or both-way communication. But Can’t exchange the data same time. Ex : Like Walkie Talkie.
- Full Duplex: Two or both-way communication and can exchange data same time. Ex: Like Phone Call.
What is Baud Rate?
- Baud rate is about how many Bits can be able to transmit/receive within each second.
Wireless Protocol
| Type | Technology | Description |
|---|---|---|
| Wireless | 6LowPAN Standard: | RFC6282 Frequency: (adapted and used over a variety of other networking media including Bluetooth Smart or (2.4GHz) or ZigBee or low-power RF (sub-1GHz) Range: N/A Data Rates: N/A |
| Wireless | Bluetooth Standard | Bluetooth 4.2 core specification Frequency: 2.4GHz (ISM) Range: 50-150m (Smart/BLE) Data Rates: 1Mbps (Smart/BLE) |
| Wireless | GSM (Cellular)Standard | GSM/GPRS/EDGE (2G), UMTS/HSPA (3G), LTE (4G) Frequencies: 900/1800/1900/2100MHz Range: 35km max for GSM; 200km max for HSPA Data Rates (typical download): 35-170kps (GPRS), 120-384kbps (EDGE), 384Kbps-2Mbps (UMTS), 600kbps-10Mbps (HSPA), 3-10Mbps (LTE) |
| Wireless | GPS | |
| Wireless | LoRa WAN Standard | Frequency: Various Range: 2-5km (urban environment), 15km (suburban environment) Data Rates: 0.3-50 kbps. |
| Wireless | NFC Standard: | ISO/IEC 18000-3 Frequency: 13.56MHz (ISM) Range: 10cm Data Rates: 100–420kbps |
| Wireless | Neul | Standard: Neul Frequency: 900MHz (ISM), 458MHz (UK), 470-790MHz (White Space) Range: 10km Data Rates: Few bps up to 100kbps |
| Wireless | Sigfox | Standard: Sigfox Frequency: 900MHz Range: 30-50km (rural environments), 3-10km (urban environments) Data Rates: 10-1000bps |
| Wireless | Thread | Standard: Thread, based on IEEE802.15.4 and 6LowPAN Frequency: 2.4GHz (ISM) Range: N/A Data Rates: N/A |
| Wireless | WiFi | Standard: Based on 802.11n (most common usage in homes today) Frequencies: 2.4GHz and 5GHz bands Range: Approximately 50m Data Rates: 600 Mbps maximum, but 150-200Mbps is more typical, depending on channel frequency used and number of antennas (latest 802.11-ac standard should offer 500Mbps to 1Gbps) |
| Wireless | Zigbee | Standard: ZigBee 3.0 based on IEEE802.15.4 Frequency: 2.4GHz Range: 10-100m Data Rates: 250kbps |
| Wireless | Z-Wave | Standard: RFC6282 Frequency: (adapted and used over a variety of other networking media including Bluetooth Smart (2.4GHz) or ZigBee or low-power RF (sub-1GHz) Range: N/A Data Rates: N/A |
Wireless Protocols Standards
- 802.1 – Inter connection(bridging)
- 802.2 – Logical link control
- 802.3 – Ethernet(CSMA/CD)LAN
- 802.4 – Token bus LAN
- 802.5 – Token ring LAN
- 802.6 – Metropolitan Area Networks (DQDB)
- 802.7 – Broad band TAG
- 802.8 – Fiber optic TAG
- 802.9 – Isochronous LAN
- 802.10 – Security
- 802.11 – Wireless LAN/Wi Fi
- 802.12 – Demand priority
- 802.14 – Cable modem
- 802.15 – Wireless personal aread network(PAN)
- 802.15.1 – Bluetooth
- 802.15.3 – Light rato wireless PAN
- 802.15.4 – ZigBee
- 802.15.6 – Body area network
- 802.16 – Broad band wireless(Wi max)
- 802.17 – Resilient Packet Ring
- 802.18 – Radio regulatory WG(Mobile broad band wireless access)
- 802.19 – Coexistence TAG
- 802.20 – Mobile broadband wireless
- 802.21 – Media independent handoff
- 802.22 – Wireless regional area network
OSI Layers
- Application (7)
- Presentation (6)
- Session (5)
- Transport (4)
- Network (3)
- Data Link (2)
- Physical (1)
TCP/IP Layer
- Application (7,6,5)
- Transport (4)
- Internet(3)
- Network Interface(2,1)
Wired Communication Protocols
Synchronous – Clock signal synchronous
- I2C
- SPI
Asynchronous – No Clock signal synchronous
- UART
- BSPI
- CAN
- EMI
- ENET
- 2CUAR
- I2S
- Infrared
- HDLC
- One-Wire(1 wire)
- RJ-45
- RS-232
- RS-485
- SSI
- USB
Networking Protocol
- TCP/IP
- HTTP
- MQTT
- CoAP
Frequency
What is the frequency? The frequency of a wave the number of waves that pass by each second, and is measured in Hertz (Hz).
- Eg: 50hz (AC power in India)
- Sound (450hz).
- Light()Electromagnetic wave
Types
- Radio waves.
- Microwaves.
- infrared waves.
- ultraviolet waves.
- x-rays.
- gamma rays.
Ethernet Protocol
Pinout Reference
| Pin | Description | 10Base-T | 100Base-T | 1000Base-T |
|---|---|---|---|---|
| 1 | Transmit Data+ or BiDirectional | TX+ | TX+ | BI_DA+ |
| 2 | Transmit Data- or BiDirectional | TX- | TX- | BI_DA- |
| 3 | Receive Data+ or BiDirectional | RX+ | RX+ | BI_DB+ |
| 4 | Not connected or BiDirectional | n/c | n/c | BI_DC+ |
| 5 | Not connected or BiDirectional | n/c | n/c | BI_DC- |
| 6 | Receive Data- or BiDirectional | RX- | RX- | BI_DB- |
| 7 | Not connected or BiDirectional | n/c | n/c | BI_DD+ |
| 8 | Not connected or BiDirectional | n/c | n/c | BI_DD- |
Ethernet Frame Formats (IEEE 802.3)
| Field | Size (Bytes) | Description |
|---|---|---|
| Preamble | 7 | Synchronization pattern 55h pattern for synchronization between sender & receiver. |
| Start of Delimiter (SFD) | 1 | Marks start of frame 5Dh value, marks start of frame. |
| Destination Address (DA) | 6 | Receiver MAC address. Discards if not matching. |
| Source Address (SA) | 6 | Sender MAC address. |
| Data Length | 2 | Number of bytes in data Length/Type field: number of data bytes or protocol identifier. |
| Data | 46–1500 | Payload data. If less than 46 bytes, padded to 46 before adding FCS. Max MTU = RXMAXLEN – 18. |
| Pad | 0–46 (RXMAXLEN – 18) | Padding to meet min length If data is less than 46 bytes |
| Checksum (FCS) Frame Check Sequence | 4 | CRC for error detection. Covers bytes 60–1514 of frame. |
Overhead: 22 bytes (before payload starts).
Ethernet TCP & UDP
Common use of Ethernet has reduced the cost of implementation
- Ethernet UDP (User Datagram Protocol) and TCP (Transmission Control Protocol) are the basic communication languages or protocols of the internet. They can also be used as communications protocol in private networks.
- UDP is best suited for applications requiring fast, efficient transmission
- TCP is a very forgiving protocol when transmission reliability is low, giving it a good reputation for error handling; however, the advantage of error handling limits the speed and synchronous behavior of data exchange
- What is Different casting Methods.
- A single host –Unicast = (TCP and UDP)
- All hosts -Broadcast – (UDP only)
- A group of hosts – Multicast -(UDP only)
| Comparison of different addressing methods | Uni-cast | Broadcast | Multicast | Anycast |
| Association | One to One | One to All | One to Many | One to one of many |
| Address | Sender and receiver hae unique Address | MAC: FF:FF:FF:FF:FF:FF IP : 255.255.255.255 | Layer 2 : Least-SIgnificant bit of the first octet IP : Leading address bits of 1110 | Similar to unicast |
| Usage Example | HTTP, SMTP, FTP | ARP, DHCP | UDP | DNS |
| Note | – | Not Supported in IPV6 | – | Not specifically supported in IPV4 |
Bluetooth Module
- Modules
- HM-10 Bluetooth Module (Texas Instruments CC2541 Chipset)
- NRF51822 Bluetooth BLE4 2.4GHz Wireless Communication Module
- HC-05 Bluetooth Module with TTL Output