CHAPTER 10 SERIAL INTERFACE FUNCTION
User’s Manual U15195EJ5V0UD
470
(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 PRSCM1 register (1
≤
m
≤
256
Note
)
k: Value set by bits BGCS1, BGCS0 of PRSM1 register (k = 0, 1, 2, 3)
Note
The setting of m = 256 is performed by writing 00H to the PRSCM1 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 PRSCM1 register (1
≤
m
≤
256
Note
)
k: Value set by bits BGCS1, BGCS0 of PRSM1 register (k = 0, 1, 2, 3)
Note
The setting of m = 256 is performed by writing 00H to the PRSCM1 register.
<3> Formula for calculating error
Error [%] =
×
100
Example (9,520
−
9,600)/9,600
×
100 =
−
0.833 [%]
Remark
Actual baud rate: Baud rate with error
Target baud rate: Normal baud rate
f
XX
2
×
m
×
2
k
×
16
f
XX
2
×
m
×
2
k
Actual baud rate
−
Target baud rate
Desired baud rate
Содержание PD703114
Страница 2: ...2 User s Manual U15195EJ5V0UD MEMO ...