EasyManua.ls Logo

Renesas RL78 - Page 15

Renesas RL78
88 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
RL78/G11 UART Reception in STOP Mode Using Middle-speed On-chip Oscillator IAR
R01AN3634EJ0100 Rev.1.00 Page 15 of 85
Feb. 15, 2017
(2) Baud rate correction
In this application, UART is MOCO driven, with the frequency set to: f
CLK
= 4MHz or f
MCK
= CK00 = f
CLK
/ 2 =
2MHz. The target baud rate is 9600bps; the values for the upper 7 bits of the SDR register (SDR[15:9]) are calculated
by the following expressions.
SDR01[15:9] + 1 = f
MCK
/ (2 * 9600)
= 2 MHz / (2 * 9600)
In addition, the following expression is used to reflect the accuracy of the MOCO frequency.
SDR[15:9] + 1 = 2 MHz * (
ideal count value / capture value of CH3) / (2 * 9600)
= 2 MHz * (6.000N /
capture value of CH3) / (2 * 9600)
= 2 MHz * (6 * 9516 /
capture value of CH3) / (2 * 9600)
= 5947500 / (
capture value of CH3)
To simplify the calculation, the right side is divided by 256, and the final expression is as shown below. The sample
program states this expression in the r_tau0_baudrate_correction function. Note that the left side value SDR[15:9] is
described here as the local variable k.
= 23232 / (
capture value of CH3 for the upper 8 bits)

Related product manuals