PIC microcontroller communication protocol

When people are lost in the wild at night, they often have only one flashlight. If a helicopter passes overhead, they can use the flashlight to send an SOS signal by flashing three short flashes, followed by three long ones, and then three more short ones. This is the internationally recognized distress signal used to alert pilots or rescuers that help is needed. The pattern of light—three short, three long, three short—represents the Morse code for "SOS," serving as a communication protocol between the person in need and the pilot. The way a microcontroller processes a communication protocol is similar, though instead of light, it uses electrical levels. For example, we can replicate the SOS signal using high and low voltage levels. A high level could represent a flash of light, while a low level represents darkness. We can define a short pulse as 10 milliseconds and a long pulse as 20 milliseconds. A microcontroller can output these levels through its I/O pins, sending a sequence of three short, three long, and three short pulses. On the receiving end, another microcontroller can detect these levels and interpret the signal based on the program it's running. The meaning of the signal can be anything—like triggering a device, activating a light, or even sending a message. As long as both devices agree on the protocol beforehand, communication becomes possible. ![PIC microcontroller communication protocol](http://i.bosscdn.com/blog/26/55/91/3-1G12509411U01.png) In reality, communication protocols are arbitrary, but they must be agreed upon by both the sender and receiver. However, if every company or individual created their own unique protocol, it would lead to confusion and incompatibility. That’s why standardized protocols like USART, I2C, and SPI were developed. These common standards ensure that different devices can communicate effectively without confusion. Now, let’s briefly explain some key terms related to communication protocols: **Serial Communication vs. Parallel Communication** Imagine you have eight apples and want to pass them to someone else. You could throw one at a time, which is serial communication. Alternatively, you could throw all eight at once, which is parallel communication. In the context of microcontrollers, instead of apples, we're dealing with bits. Serial communication uses a single data line, so only one bit is sent at a time. Parallel communication, on the other hand, uses multiple data lines to send several bits simultaneously. **Full-Duplex vs. Half-Duplex Communication** Think of two people chatting. In half-duplex communication, only one person can speak at a time. While A is talking, B can only listen, and vice versa. They can’t communicate simultaneously. In full-duplex communication, both parties can talk and listen at the same time, like a normal phone call. Both can send and receive data concurrently. **Asynchronous vs. Synchronous Communication** In synchronous communication, both devices share the same clock signal, ensuring they operate in sync. This allows for precise timing when sending and receiving data. In asynchronous communication, there is no shared clock, so the devices rely on start and stop bits to synchronize. If two microcontrollers are communicating synchronously, they are connected via a clock line. If not, the communication is considered asynchronous.

T10 Series Terminal Blocks

Withstand high voltage up to 750V (IEC/EN standard)

UL 94V-2 or UL 94V-0 flame retardant housing

Anti-falling screws

Optional wire protection

1~12 poles, dividable as requested

Maximum wiring capacity of 10 mm2

10 amp Terminal Blocks,high quality terminal connectors,10 mm² terminal blocks,BELEKS T10 series connector strips

Jiangmen Krealux Electrical Appliances Co.,Ltd. , https://www.krealux-online.com