Using the SIM Transmitter
MOTOROLA
SmartCard Interface Module (SIM)
25-49
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.
NOTE:
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.
Summary of Contents for DragonBall MC9328MX1
Page 68: ...1 12 MC9328MX1 Reference Manual MOTOROLA Introduction ...
Page 86: ...2 18 MC9328MX1 Reference Manual MOTOROLA Signal Descriptions and Pin Assignments ...
Page 116: ...3 30 MC9328MX1 Reference Manual MOTOROLA Memory Map ...
Page 126: ...4 10 MC9328MX1 Reference Manual MOTOROLA ARM920T Processor ...
Page 160: ...8 8 MC9328MX1 Reference Manual MOTOROLA System Control ...
Page 272: ...13 32 MC9328MX1 Reference Manual MOTOROLA DMA Controller ...
Page 281: ...Programming Model MOTOROLA Watchdog Timer Module 14 9 ...
Page 282: ...14 10 MC9328MX1 Reference Manual MOTOROLA Watchdog Timer Module ...
Page 300: ...15 18 MC9328MX1 Reference Manual MOTOROLA Analog Signal Processor ASP ...
Page 438: ...18 16 MC9328MX1 Reference Manual MOTOROLA Serial Peripheral Interface Modules SPI 1 and SPI 2 ...
Page 478: ...19 40 MC9328MX1 Reference Manual MOTOROLA LCD Controller ...
Page 574: ...21 32 MC9328MX1 Reference Manual MOTOROLA Memory Stick Host Controller MSHC Module ...
Page 598: ...23 16 MC9328MX1 Reference Manual MOTOROLA Real Time Clock RTC ...
Page 670: ...24 72 MC9328MX1 Reference Manual MOTOROLA SDRAM Memory Controller ...
Page 726: ...25 56 MC9328MX1 Reference Manual MOTOROLA SmartCard Interface Module SIM ...
Page 736: ...26 10 MC9328MX1 Reference Manual MOTOROLA General Purpose Timers ...
Page 854: ...29 18 MC9328MX1 Reference Manual MOTOROLA I2C Module ...
Page 900: ...30 46 MC9328MX1 Reference Manual MOTOROLA Synchronous Serial Interface SSI ...
Page 942: ...32 26 MC9328MX1 Reference Manual MOTOROLA GPIO Module and I O Multiplexer IOMUX ...