Part # Application Notes Smartcard And Secure Solutions General Purpose Products STM8S103K3 STM8S205C6 STM8S102F2 STM8S102F3 STM8S102K3 datasheet

Part Manufacturer: ST Microelectronics

ST Microelectronics

Part Description: Smartcard interface with the STM8S microcontroller


Part Details:

AN2646 Application note Smartcard interface with the STM8S microcontroller Introduction This document describes a firmware and hardware smartcard interface solution based on the STM8 UART1 peripheral. The main purpose of this firmware and hardware package is to provide resources that facilitate the development of an application using the UART1 peripheral in smartcard mode. The firmware interface consists of library source files developed so as to support the ISO 7816-3/4 specification. An application example is also provided. This document and its associated firmware are available for download from the STMicroelectronics website: www.st.com. August 2008 Rev 2 1/43 www.st.com Contents AN2646 - Application note Contents 1 Smartcard interface description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.2 External interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.3 Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.4 Smartcard clock generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2 Smartcard reader hardware connection . . . . . . . . . . . . . . . . . . . . . . . . . 6 3 ISO 7816 ­ protocol overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 3.2 ISO 7816-2 ­ pin location . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 4 ISO 7816-3 ­ electronic signal and transmission protocol . . . . . . . . . 10 4.1 Card power-up and reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 4.2 Data transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 4.3 Answer to reset (ATR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 5 ISO 7816-4 ­ smartcard commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 5.1 T0 protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 5.2 Application-level protocols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 5.2.1 The ISO 7816-4 APDU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 5.2.2 File system API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 5.2.3 ISO 7816-4 functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 5.2.4 Security API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24


Please click the following link to download the datasheet:

Application Notes Smartcard And Secure Solutions General Purpose Products STM8S103K3 STM8S205C6 STM8S102F2 STM8S102F3 STM8S102K3.pdf Datasheet