Receiving Serial Data: The receiving procedure in smart card mode is the same as the normal
SCI procedure. Figure 14-7 shows a flowchart for receiving.
1.
Initialize the smart card interface by the procedure given in Initialization at the beginning of
this section.
2.
Check that the ORER and PER error flags are cleared to 0 in SSR. If either flag is set, carry
out the necessary error handling, then clear both the ORER and PER flags to 0.
3.
Check that the RDRF flag is set to 1. Repeat steps 2 and 3 until this check passes.
4.
Read receive data from RDR.
5.
To continue receiving data, clear the RDRF flag to 0 and return to step 2.
6.
To terminate receiving, clear the RE bit to 0.
Figure 14-7 Receive Flowchart (Example)
515
ORER = 0 and
PER = 0 ?
RDRF = 1 ?
All data received ?
Initialize
Read RDR and clear RDRF
flag to 0 in SSR
Clear RE bit to 0
Start
Error handling
Start receiving
No
No
No
Yes
Yes
www.DataSheet4U.com