Transmit Data Formats; Transmit Nacks - Motorola DragonBall MC9328MX1 Reference Manual

Integrated portable system processor
Table of Contents

Advertisement

character is written before beginning transmission. Clearing the XMT_EN bit in the ENABLE register
while the transmitter is in operation halts any transmission in progress, flushes the transmit FIFO, and
resets the transmit state machine.
Data can be written to the transmit FIFO at any time.
The TDTF bit in the XMT_STATUS register (see page 25-27) can determine when the transmit FIFO has
reached a given threshold value. This flag creates an interrupt when the TDTFM bit in the INT_MASK
register (see page 25-31) is clear. To control the point at which the TDTF bit is set, program the transmit
data threshold, TDT, in the XMT_THRESHOLD register (see page 25-35). When the number of bytes
remaining in the transmit FIFO is equal to or less than the value set by TDT, the TDTF bit is set.
A value of 0x0 in TDT implies that the transmit FIFO must be empty to trigger the TDTF bit.
The value in TDT can be changed at any time to alter this threshold level. The comparison between the
number of remaining bytes in the transmit FIFO and the value set by TDT is continuously updated so that
any change in either is immediately reflected in the state of the TDTF bit. Like the RDRF flag for the
receive FIFO, the TDTF bit is latched and remains set until the TDT value is less than the number of
remaining bytes in the transmit FIFO. For instance, when TDT is set to 5, and there are 6 bytes remaining
in the FIFO, changing TDT to 6 immediately sets the TDTF bit. Setting TDT back to 5 clears the TDTF
bit.
The standard flow for transmitting bytes from the SmartCard is to set TDT to the appropriate value, write
up to 16 bytes to the transmit FIFO, enable the transmitter, wait for the TDTF bit to cause an interrupt
(TDTFM clear), and then write additional bytes to the transmit FIFO.
For the SIM to transmit successfully, the transmit pin must be connected
to the receive pin of the same port. This connection is required for the SIM
to decode transmit NACKs sent to it by the SmartCard. When operating in
3 V mode (3VOLT), this connection is made internal to the MC9328MX1.

25.9.1 Transmit Data Formats

There are two possible data formats that the SIM uses when transferring data to the SmartCard—inverse
convention or direct convention (see Figure 25-12 on page 25-13). The format used depends on the state of
the IC bit in the CNTL register. Software can set the IC bit, or it can be set automatically by hardware
when in initial character mode.

25.9.2 Transmit NACKs

The SIM transmitter can respond to NACKs created by the SmartCard. A NACK is decoded when the
SmartCard creates a logic low level on the SIM receive pin during the STOP bit time at the end of a
transmitted byte (see Figure 25-5 on page 25-8). To prevent a situation where the SIM interface is stalled
by an infinite number of NACK pulses on a given byte, the SIM can be configured to limit the number of
times it responds to NACKs. The XTH control field in the XMT_THRESHOLD register (see page 25-35)
allows software to set a threshold on the number of times a given byte is retransmitted. When the threshold
is reached, a transmit threshold error, XTE in the XMT_STATUS register (see page 25-27), is asserted.
When XTE is set, the SIM transmitter is halted, and all pending transfers are aborted, and the TC, ETC,
and TFE flags are set. All bytes remaining in the transmit FIFO are lost. There is no way to restart the
transmission on the next byte in the FIFO. The transmitter remains frozen until XTE is cleared by software.
The only way to clear XTE is to write 1 to the XTE bit in the XMT_THRESHOLD register (see page
25-35). The XTE flag can create an interrupt when the XTM mask in the XMT_THRESHOLD register is
clear.
MOTOROLA
NOTE:
SmartCard Interface Module (SIM)
Using the SIM Transmitter
25-49

Advertisement

Table of Contents
loading

Table of Contents