Using Initial Character Mode And Resulting Receive Data Formats; Initial Character Mode Programming - Motorola DragonBall MC9328MX1 Reference Manual

Integrated portable system processor
Table of Contents

Advertisement

Using the SIM Receiver
When the ONACK control bit is clear, the existence of a high OEF flag indicates the loss of data. The OEF
flag can create an interrupt when the OIM bit in the INT_MASK register (see page 25-31) is clear.
To clear the OEF flag, software must simply write 1 to the OEF bit position in the RCV_STATUS register.
A high OEF flag has no effect on the operation of the SIM receiver other than to create an interrupt when
OIM is clear.
25.8.4 Using Initial Character Mode and Resulting Receive Data
Formats
The SIM receiver supports the detection of special characters that allow it to determine the data format
used by the connected SmartCard. When placed in initial character mode, the SIM expects to receive one
of two potential values that it uses to set the IC bit in the CNTL register (see page 25-23).
The two possible data formats are inverse convention and direct convention. Figure 25-12 on page 25-13
illustrates the differences between the two formats. Essentially, inverse convention differs from direct
convention in that the order of the data is flipped MSB for LSB, and the data bits and parity bit are
logically inverted. When receiving inverse convention data, the transformation of the data back to direct
convention format is performed by the hardware, including the inversion of the data and parity bits.
To place the SIM into initial character mode, set the ICM bit in the CNTL register (see page 25-23). Once
a valid initial character is received, the IC bit in the CNTL register (see page 25-23) is set accordingly by
the hardware, and the ICM bit is cleared. Software can read the state of the IC bit to determine the SIM's
current mode of operation.
Figure 25-11 on page 25-13 shows the two possible valid initial characters that can be received. The 0x3B
(as decoded by direct convention) with parity bit high specifies direct convention (IC set to logic 0), and a
0x3F (as decoded by inverse convention) with parity bit high specifies inverse convention (IC set to
logic 1).
When the receiver is in initial character mode, all received bytes are placed into the receive FIFO whether
they are valid initial characters or not. When a valid initial character is received that changes the data
format, all subsequent bytes are decoded with that format before being placed into the FIFO, including the
initial character byte itself. That is, when the IC bit is low, and the correct initial character for setting
inverse convention is received, that character and all subsequently received characters are decoded by
inverse convention and stored in the FIFO (the initial character is stored as 0x3F).
When the receiver is in initial character mode (ICM is high), and an invalid initial character is received, the
SIM can be configured to automatically request that the initial character be retransmitted by setting the
ANACK bit in the CNTL register (see page 25-23). When generating a NACK pulse, the SIM generates
the low pulse starting at 10.5 ETUs and lasting for 1 ETU (see Figure 25-5 on page 25-8). The invalid
initial character is placed into the receive FIFO and marked with a parity error to signify that this is an
invalid initial character.

25.8.5 Initial Character Mode Programming

Initial character mode requires close attention to the programming model to avoid a parity error condition
in which the initial byte for direct convention (0x3B) is decoded, as what appears to be, a valid initial
character for inverse convention (0x3F). The SIM does not recognize this as a valid initial character for
inverse convention and marks the character by setting the parity error flag. The software must check for the
existence of a parity error before recognizing a character as a valid initial character.
MOTOROLA
SmartCard Interface Module (SIM)
25-47

Advertisement

Table of Contents
loading

Table of Contents