Pular para o conteúdo principal
Knowledgebase
Home
Renesas Brasil - Knowledgebase

Difference Between Serial Communication Function With and Without Clock

Last Updated:05/25/2018

Question:

Some serial communication functions that are built into microcontrollers have a clock while others do not. What accounts for the difference?

Answer:

In serial communication, 1-byte data, for example, is split into multiple bits of data and sent bit by bit. The receiving side must reassemble the data that has been sent in this way into the original data. During this process, the original data cannot be restored if there is no way to tell what part of the received signal contains valid data and where coherent data (byte data) begins and ends.

e1006916_1.png

(a) Synchronous communication
A simple method for indicating which part represents valid data is to simultaneously exchange a signal for that purpose. The signal for this purpose is the (serial) clock signal. As shown in the synchronous communication example below, if you set the serial data to change at the falling edges of the clock, you can fetch the correct data at the rising edges of the clock.

e1006916_2.png

Now, the position of the correct data (bits) has become clear. This state is expressed as "bit synchronization has been achieved." A communication method that synchronizes bits by exchanging clock signals in this way is called (clock) synchronous communication. Normally, the synchronous communication function that is built into a microcontroller exchanges clock signals only during data transfer. Therefore, if no mistake is made in the startup sequence, it becomes clear where the beginning of the data is and where the data for one character ends (this is called character synchronization or byte synchronization).
In this method, the transfer rate is determined by the clock signals that are exchanged simultaneously with data, and therefore it can be set relatively freely and high. However, since clock signals are exchanged, data will end up being shifted if receiving of even a single clock signal is missed. Consequently, if receiving starts in the middle of the data being sent, for example, the data bit position will end up being shifted, and from then on, correct data cannot be reproduced (received). To avoid this problem, it is necessary to initialize the serial controller when communication is paused.

Remarks
In the case of synchronous communication used as a general communication method, the clock signal is continuous. Therefore, it is not possible to tell where data starts and ends. To solve this issue, character synchronization is achieved by exchanging synchronous characters, making the start and end of data clear. In this method, synchronous characters are being sent when no data is being sent. As explained here, the operation can differ even for the same synchronous communication.
 
(b) Start-stop synchronous communication (asynchronous communication)
Start-stop synchronous communication (asynchronous communication) is a communication method that exchanges data without using serial clock signals. In this method, since only data signals are exchanged, the transfer rate must be matched between the transmitting side and receiving side in advance. The data (bit) interval has now been determined, but this alone cannot indicate the timing that shows where the correct data is.

e1006916_3.png

In order to reproduce the correct timing from the data signals themselves, a part for determining the timing is needed besides the data portion. For this reason, control areas called start bits and stop bits are added to the signals and exchanged.

e1006916_4.png

As shown in the above figure, adding a start bit at the head makes the start of the signal clear, making it possible to synchronize bits and characters. Additionally, to enable the start bit of each character, it is necessary to add a stop bit to the end of the data and set the serial data high once data is completed, and to maintain the high state while there is no communication data.
To detect the start bit at the correct timing, the receiving side needs to monitor the serial data at an interval that is shorter than the bit interval. For this reason, it is not possible to achieve a communication speed that is as high as that in synchronous communication.

Note that there is essentially no difference between a start bit and a bit in which the data is 0. Consequently, if receiving starts in the middle of the data being sent, incorrect data will end up being received. In this case, if there is a part not containing 1-character worth of data in the middle, it will become possible to receive data correctly from there on.

Remarks
Basically, in start-stop synchronous communication, the transfer rate must be matched between the transmitting side and receiving side in advance. However, by sending certain data (normally 55H) at the head of communication, the transfer rate can be matched. It is also possible for the receiving side to determine the transfer rate by using a timer counter to measure the signal amplitude of the serial data. Furthermore, if the transfer rate to be used is somewhat limited, such as 9,600, 19,200, or 38,400 baud, the highest transfer rate possible is used for receiving. The transfer rate is estimated based on the number of data segments received and the data values.

Suitable Products
RL78/G10
RL78/G11
RL78/G12
RL78/G13
RL78/G14
RL78/G1A
RL78/G1C
RL78/G1D
RL78/G1E
RL78/G1F
RL78/G1G
RL78/G1H
RL78/I1A
RL78/I1C
RL78/I1D
RL78/I1E
RL78/L12
RL78/L13
RL78/L1A
RL78/L1C
78K Family