
V PeRiPheRaL MoDuLes 3 (inteRFaCe): GeneRaL-PuRPose seRiaL inteRFaCe (eFsio)
V-1-36
ePson
s1C33L17 teChniCaL ManuaL
(4) Receive errors
Three types of receive errors can be detected when receiving data in ISO7816 mode.
Since an interrupt can be generated by setting the interrupt controller, the error can be processed using an inter-
rupt processing routine. For details on receive error interrupts, refer to Section V.1.7, “Serial Interface Interrupts
and DMA.”
Parity error
In ISO7816 mode, the parity is checked when data is received.
This parity check is performed when the data received in the shift register is transferred to the receive data buf-
fer.
In T = 1 mode, if any nonconformity between the received data and parity bit is found in this check, a parity er-
ror is assumed and the parity error flag PER1 (D3/0x300B12) is set to 1.
PeR1: Serial I/F Ch.1 Parity Error Flag in the Serial I/F Ch.1 Status Register (D3/0x300B12)
Even when this error occurs, the received data in error is transferred to the receive data buffer and the receive
operation is continued in T=1 mode. However, the content of the received data for which a parity error is
flagged cannot be guaranteed.
In T = 0 mode, the received data in error is not loaded to the receive data buffer and a parity error cannot be de-
tected. The parity error flag PER1 (D3/0x300B12) will not be set to 1.
PER1 (D3/0x300B12) is reset to 0 by writing 0.
As described above, if a parity error occurs in T = 0 mode, the interface returns a low-level error signal (NACK)
to the transmitter (see Figure V.1.6.3.7).
In T = 1 mode, the interface does not return an error signal even if a parity error occurs.
Framing error (asynchronous mode)
If data with a stop bit = 0 is received, the serial interface assumes that the data is out of synchronization and
generates a framing error.
If two stop bits are used, only the first stop bit is checked.
When this error occurs, the framing-error flag FER1 (D4/0x300B12) is set to 1.
FeR1: Serial I/F Ch.1 Framing Error Flag in the Serial I/F Ch.1 Status Register (D4/0x300B12)
Even when this error occurs, the received data in error is transferred to the receive data buffer and the receive
operation is continued. However, the content of the received data for which a framing error is flagged cannot be
guaranteed, even if no framing error is found in the following data received.
FER1 (D4/0x300B12) is reset to 0 by writing 0.
overrun error
Even when the receive data buffer is full (4 data have been received), the next (5th) data can be received into
the shift register. If there is no space in the buffer (data has not been read) when the 5th data has been received,
the 5th data in the shift register cannot be transferred to the buffer. If one more (6th) data is transferred to this
serial interface, the shift register (5th data) is overwritten with the 6th data and an overrun error is generated.
When an overrun error is generated, the overrun error flag OER1 (D2/0x300B12) is set to 1.
oeR1: Serial I/F Ch.1 Overrun Error Flag in the Serial I/F Ch.1 Status Register (D2/0x300B12)
Even when this error occurs, the receive operation is continued.
OER1 (D2/0x300B12) is reset to 0 by writing 0.
(5) terminating receive operation
When a data receive operation is completed, write 0 to the receive-enable bit RXEN1 (D6/0x300B13) to disable
receive operations. This operation clears (initializes) the receive data buffer (FIFO), therefore, make sure that
there is no data that has not been read in the receive data buffer before setting RXEN1 (D6/0x300B13) to 0.
To disable clock output, first reset CLKOEN1 (D4/0x300B1A) to 0 and then CLKOL1 (D3/0x300B1A) to 0.