English
Language : 

K60P100M100SF2RM Datasheet, PDF (1560/1809 Pages) Freescale Semiconductor, Inc – K60 Sub-Family Reference Manual
Application information
51.8.2.2 Transmission procedure for (C7816[TTYPE] = 1)
When the protocol selected is C7816[TTYPE] = 1, data is transferred in blocks. Prior to
starting a transmission software should write the size (number of bytes) for the
Information Field portion of the block in to the TLEN register. If a CRC is being
transmitted for the block the value in TLEN should be one more than the size of the
information field. Software should then set C2[TE] = 1, and C2[RE] = 1. Software should
then monitor the S1[TDRE] flag / interrupt and write the prologue, Information and
epilogue field to the transmit buffer. The TLEN register will automatically decrement
(except for prologue bytes and the final epilogue byte). When the final epilogue byte has
been transmitted the UART automatically clears the C2[TE] bit to 0, and the UART
automatically starts capturing the response to the block that was transmitted. Once
software has detected the receipt of the response, the transmission process should be
repeated as needed with sufficient urgency to ensure that the block wait time and
character wait times are not violated.
51.8.3 Initialization sequence (non ISO-7816)
To initiate an UART transmission:
1. Configure the UART:
a. Select a baud rate. Write this value to the UART baud registers (BDH/L) to
begin the baud rate generator. Remember that the baud rate generator is disabled
when the baud rate is zero. Writing to the BDH register has no effect without
also writing to BDL register.
b. Write to C1 register to configure word length, parity, and other configuration bits
(LOOPS, RSRC, M, WAKE, ILT, PE, PT). Write to C4, MA1 and MA2 register
to configure.
c. Enable the transmitter, interrupts, receiver, and wakeup as required by writing to
the C2 register bits (TIE, TCIE, RIE, ILIE, TE, RE, RWU, SBK), S2 register bits
(MSBF, BRK13) and C3 register bits (ORIE, NEIE, PEIE, FEIE). A preamble or
idle character is then shifted out of the transmitter shift register.
2. Transmit procedure for each byte:
a. Monitor the S1[TDRE] flag by reading the S1 or responding to the TDRE
interrupt. Or monitor the amount of free space in the transmit buffer directly
using TCFIFO[TXCOUNT].
1560
K60 Sub-Family Reference Manual, Rev. 6, Nov 2011
Freescale Semiconductor, Inc.