
RL78/G11 UART Reception in STOP Mode Using Middle-speed On-chip Oscillator IAR
R01AN3634EJ0100 Rev.1.00 Page 2 of 85
Feb. 15, 2017
Contents
1. Specification ...................................................................................................................................... 3
2. Conditions for Confirming Operations ............................................................................................... 4
3. Related Application Notes ................................................................................................................. 4
4. Hardware Explanation ....................................................................................................................... 5
4.1 Hardware Structure Example ........................................................................................................ 5
4.2 Pin List ........................................................................................................................................... 6
5. Software Explanation ........................................................................................................................ 7
5.1 Operation Outline .......................................................................................................................... 7
5.2 Correction Processing ................................................................................................................. 13
5.3 UART How to Receive UART Data in STOP Mode .................................................................... 16
5.4 Optional Byte Settings ................................................................................................................. 16
5.5 Constants .................................................................................................................................... 17
5.6 Global Variables .......................................................................................................................... 17
5.7 Functions ..................................................................................................................................... 18
5.8 Function Specifications ............................................................................................................... 19
5.9 Flowcharts ................................................................................................................................... 25
5.9.1 Main processing .................................................................................................................... 26
5.9.2 Initialization ........................................................................................................................... 28
5.9.2 Peripheral function initialization ............................................................................................ 28
5.9.3 Port initialization .................................................................................................................... 29
5.9.4 CPU clock initialization .......................................................................................................... 29
5.9.5 TAU0 initialization ................................................................................................................. 30
5.9.6 SAU0 initialization ................................................................................................................. 47
5.9.7 UART0 initialization ............................................................................................................... 50
5.9.8 INTP initialization .................................................................................................................. 59
5.9.9 Main initialization ................................................................................................................... 63
5.9.10 UART0 reception status initialization .................................................................................... 63
5.9.11 UART0 operation start function ............................................................................................. 64
5.9.12 TAU0 baud rate setting ......................................................................................................... 66
5.9.13 INTP11 operation start function ............................................................................................ 70
5.9.14 TAU0 channel 3 operation start function .............................................................................. 71
5.9.15 TAU0 channel 1 operation start function .............................................................................. 73
5.9.16 TAU0 channel 1 operation stop function ............................................................................... 75
5.9.17 TAU0 channel 3 operation stop function ............................................................................... 77
5.9.18 Wait function for LED blinking ............................................................................................... 79
5.9.19 TAU0 channel 3 count complete interrupt function ............................................................... 79
5.9.20 INTP11 interrupt processing ................................................................................................. 80
5.9.21 UART0 reception complete interrupt processing .................................................................. 81
5.9.22 UART0 receive data number overrun processing function ................................................... 81
5.9.23 UART0 reception complete processing ................................................................................ 82
5.9.24 UART0 error interrupt function .............................................................................................. 82
5.9.25 UART0 reception error processing ....................................................................................... 83
6. Sample Code ................................................................................................................................... 84
7. Reference Documents .................................................................................................................... 84