Communications Fundamentals

Serial communication: Classical and Traditional Way

Before Internet technology TCP/IP, asynchronous serial communication was often used. In embedded control system area, it is used at the present time.

Key words
- Asynchronous serial communication
- Control Code and Character, Ascii
- Command Answer Protocol
- Physical Layer

Asynchronous Serial Communication

Synchronous communication requires a set of synchronous signal and data signal. Asynchronous communication needs no synchronous signal, so it is a simple way to communicate.
Sender and receiver agree with communication speed, bit rate each other. Receiver waits start bit then decides one or zero of the bit received by own timer.

Timing

One character consists of bits like below.

BitNumber of BitRemarks
Start1
Data7 or 8Ascii code
Parity1Option
Stop1
Total9 to 11 bit

See also
Wiki: Asynchronous serial communication

Control Code and Character

This is Ascii (American Standard Code for Information Interchange) code table. Characters are assigned to 8 or 7 bit like below.

ASCII CODE Table

b3b2b1 b0
b7 0000 0000 11
b6 0000 1111 00
b5 0011 0011 00
b4 0101 0101 01
0000 NULDE0 @Pp
0001 SHD1!1 AQaq
0010 STXD2"2 BRbr
0011 ETXD3#3 CScs
0100 ETD4$4 DTdt
0101 ENQNAK%5 EUeu
0110 ACKSN&6 FVfv
0111 BLEB'7 GWgw
1000 BSCN(8 HXhx
1001 HTEM)9 IYiy
1010 LFSB*: JZjz
1011 HMEC+; K[k{
1100 FF+ L\l|
1101 CR M]m}
1110 S0. N^n
1111 S1/? O_o

Protocol

1 Control Code

A example of using control code is below.

Protocol

Receiver send back ACK, 0x06 if it received message correctly. ACK means ACKnowledge.

2 Message Frame

Detail of the protocol is entrusted to the designer of the system. So many protocols are present. Typical organization of message transfered is like below.


ElementCodeRemarks
STX0x02Start of Text
TextAscii exclusive of control codeMessage Body
ETX0x03End of Text
BCC-Block Check Code

3 Protocol

Most often used protocol is command/reply or command/answer protocol. There are one master and slave(s) in this case. Master starts communication and slave wait STX of master's message. The slave sends a reply to master when slave receives a command from master correctly.

4 Timer

Some timers are used to manage communication. They are
- Wait reply
- Inter character

Physical Layer

RS232C or RS485 are hardwares which allow asynchronous serial communication. TXD(Transfer Data) is a port of send data and RXD(Receive Data) is a port of received data. TXD is connected to RXD of opposite side each other.

Phisical layer