30.11.2012 Views

AN4453, Smart Card Operation Using Freescale Microcontrollers ...

AN4453, Smart Card Operation Using Freescale Microcontrollers ...

AN4453, Smart Card Operation Using Freescale Microcontrollers ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Hardware Circuit<br />

Each card has only one MF, which is the root of the file system. The MF may contain DFs and EFs. A DF can be an<br />

application DF that is hosting an application, or a parent that contains DFs. It can also contain zero or more EFs. The EF is<br />

the unit to store application data. Each file has a unique identifier that can be used to select it. The MF has a reserved<br />

identifier 0x3F00. It can be referenced directly anywhere in the file structure.<br />

When compared with the DOS file system, MF is like the root directory, DF is like the directory and EF is like the file within<br />

the directory.<br />

The file can be operated by issuing APDU commands. For example, the command Read Binary can be used to read back the<br />

contents of a specific file referenced by file ID.<br />

APDU command for Read Binary EF: 00 B0 90 00 10:<br />

• CLA 00: indicates it is an inter-industry class.<br />

• INS B0: it is the ISO command code for binary file reading.<br />

• P1 90: 0b10010000, bit8 is set to 1, which makes bit5 to bit 1 the short file ID 0x10.<br />

• P2 00: read start from offset 00.<br />

• Le 10: number of bytes expected to be returned.<br />

4 Hardware Circuit<br />

4.1 Hardware Introduction<br />

The hardware circuit for the smart card reader is based on the demo board DEMOJM. The MCU is MC9S08JM60. SCI1 is<br />

configured as single-wire mode, and TxD1 is used to communicate with the card’s I/O. In design practice, a parity error<br />

rarely happens when an MCU communicates with a smart card, so the retransmission of a character on parity error is not<br />

implemented in this example. TPM1 channel 0 is used to provide a clock to the card. All wires connected to the smart card<br />

slot are from jumper J1.<br />

<strong>Smart</strong> <strong>Card</strong> <strong>Operation</strong> <strong>Using</strong> <strong>Freescale</strong> <strong>Microcontrollers</strong>, Rev. 0, 2/2012<br />

12 <strong>Freescale</strong> Semiconductor, Inc.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!