CMS32L051 User Manual |Chapter 15 IrDA
www.mcu.com.cn 571 / 703
15.3 Operation of IrDA
15.3.1 Operating steps for IrDA communication
(1) Initial setup process for IrDA communication
Follow the steps below to initialize IrDA.
1. Set the IRDAEN bit of the PER0 register to "1".
2. Set the IRCR register.
3. Set the relevant registers for SCI (refer to the setting steps of the UART mode).
(2) Stop process for IrDA communication
1. Set the IrTxD pin state after IrDA communication stops by setting the port register and the port
mode register.
Note: When performing an IrDA reset via step 3, the IrTxD pin may change the output state by switching
to the data output of the usual serial interface UART.
Output low level from the IrTxD pin
Set the port register to 0. Immediately after this setting, the IrTxD pin is fixed low.
Output high level from the IrTxD pin
Set the port register to 1. With this setting, the IrTxD pin is fixed to high immediately after the IrDA reset
in step 3.
Set the IrTxD pin to the Hi-Z state to set the port mode register to 1. Immediately after this setting,
the IrTxD pin changes to the Hi-Z state.
2. Set the STm0 and STm1 bits of the STm register (SCI's associated register) to "1" (to stop the
operation of SCI's channel 0 and channel 1).
3. Reset IrDA by setting IRDAEN to "0" in PER0 register.
You cannot set the STm0 and STm1 bits of the STm register to "1" or the IRE bit of the IrDA to "0" in
cases other than the above steps.
(3) To send an IrDA frame error
When a frame error occurs during IrDA communication, the following settings must be made in order to
set the state in which subsequent data can be received.
1. Set the STm1 bit of SCI's STm register to "1" (to stop the operation of SCI's channel 1).
2. Set the SSm1 bit of the SSm register of SCI to "1" (start the operation of channel 1 of SCI).
Remark m: Unit number (m=0).
For frame error handling for SCI, refer to Chapter 14, Universal Serial Communication Unit.