CHAPTER 10 SERIAL INTERFACE FUNCTION
User’s Manual U14492EJ3V0UD
477
(f) Baud rate setting value
The formulas for calculating the baud rate in the asynchronous mode and the synchronous mode and the
formula for calculating the error are as follows.
<1> Formula for calculating baud rate in asynchronous mode
Baud rate = [bps]
f
XX
= Internal system clock frequency [Hz]
= CPU clock/2 [Hz]
m: Setting value of PRSCMn register (1
≤
m
≤
256
Note
)
k: Value set with bits BGCS1, BGCS0 of PRSMn register (k = 0, 1, 2, 3)
Note
The setting of m = 256 is performed by writing 00H to the PRSCMn register.
<2> Formula for calculating the baud rate in synchronous mode
Baud rate = [bps]
f
XX
= Internal system clock frequency [Hz]
= CPU clock/2 [Hz]
m: Setting value of PRSCMn register (1
≤
m
≤
256
Note
)
k: Value set with bits BGCS1, BGCS0 of PRSMn register (k = 0, 1, 2, 3)
Note
The setting of m = 256 is performed by writing 00H to the PRSCMn register.
<3> Formula for calculating error
Error [%] =
×
100
Example
(9520
−
9600)/9600
×
100 =
−
0.833 [%]
Remark
Actual baud rate: Baud rate with error
Desired baud rate: Normal baud rate
f
XX
2
×
m
×
2
k
×
16
f
XX
2
×
m
×
2
k
Actual baud rate
−
Desired baud rate
Desired baud rate