4.2.4. User interface ....................................................................................................................................... 80
4.2.5. Testing .................................................................................................................................................... 80
Chapter 10 UART: Universal Asynchronous Receiver Transmitter ...................................................... 82
1. Introduction to UART...................................................................................................................................... 82
2. Module Presentation ....................................................................................................................................... 82
3. Configuration ...................................................................................................................................................... 83
3.1. Signal Configuration .............................................................................................................................. 83
3.2. LINFlex Module Configuration .......................................................................................................... 83
3.3. UART Mode Configuration .................................................................................................................. 84
3.4. Baud Rate Configuration ...................................................................................................................... 84
3.5. Status Registers and Interrupt Configuration ............................................................................. 85
3.6. Data Transmit/Receive ........................................................................................................................ 86
4. Developing a general purpose UART Driver ......................................................................................... 87
5. Using the UART Driver for a terminal interface ................................................................................... 88
5.1. System initialisation .............................................................................................................................. 88
5.2. SIUL configuration .................................................................................................................................. 88
5.3. ADC configuration................................................................................................................................... 89
5.4. eMIOS configuration .............................................................................................................................. 90
5.5. Main procedure and use of the driver ............................................................................................ 90
5.6. Results ......................................................................................................................................................... 92
Chapter 11 I²C: Inter-Integrated Circuit Bus Controller ............................................................................ 94
1. Presentation of I²C protocol ......................................................................................................................... 94
1.1. Description ................................................................................................................................................ 94
1.2. Baud rate .................................................................................................................................................... 95
1.3. Pull-up resistor calculation ................................................................................................................. 96
2. Using the I²C module ....................................................................................................................................... 96
2.1. Module Presentation ............................................................................................................................. 96
2.2. Module Registers ..................................................................................................................................... 97
2.3. Communication ........................................................................................................................................ 99
2.4. Developing a general purpose I²C Driver .................................................................................. 101
Chapter 12 CAN: Controller Area Network .................................................................................................. 102
6. CAN protocol ................................................................................................................................................... 102
1.1. Introduction ........................................................................................................................................... 102
1.2. Frame Description ............................................................................................................................... 103
1.3. Physical Layer ....................................................................................................................................... 104