Documente Academic
Documente Profesional
Documente Cultură
..............................................................................................
User Guide
Section 1
1.1 References................................................................................................1-1
1.2 Abbreviations ............................................................................................1-1
1.3 Overview ...................................................................................................1-1
Section 2
2.1 I2C command............................................................................................2-3
2.2 AT83C26 Driver Interface .........................................................................2-4
Section 3
3.1 Read commands .......................................................................................3-5
3.2 Write commands .......................................................................................3-7
Section 4
4.1 smartcard interface ...................................................................................4-9
4.2 DCDC Control .........................................................................................4-11
4.3 smartcard Clocks ....................................................................................4-15
4.4 IO control ................................................................................................4-15
4.5 Slew Rate Control ...................................................................................4-17
4.6 Conclusion ..............................................................................................4-17
The AT83C26 is a multi smartcard reader interface IC for smartcard reader/writer appli-
cations such as EFT/POS terminals and set top boxes.
The AT83C26 needs TWI commands to configure its registers.
The AT83C26 has:
29 registers
12 different write commands
8 different read commands
A driver is mandatory to help the user to configure and use the AT83C26.
This document describes the software driver developed to easily interface a microcon-
troller (with a master TWI) and the AT83C26.
1.2 Abbreviations EFT: Electronic Funds Transfer (Credit / Debit Card Processing Systems)
POS: Point-Of-Sale
TWI: Inter-Integrated Circuit (Idem I2C)
1.3 Overview The AT83C26 is a multi smartcard reader interface IC. This component is used to con-
nect up to 5 SIM/SAM/SC interfaces to a microcontroller. The AT83C26 manages the
ISO7816 bus and the DC/DC conversion.
The AT83C26 is controlled by a microcontroller with TWI master interface. The
AT83C26 TWI address is programmable by reading electrical levels on A2 and A1 at
reset. Up to 4 AT83C26 can be connected on the same TWI bus.
Two DC/DC converters and LDO regulators allow to have an independent electrical con-
trol of each of the 5 SIM/SAM/SC interfaces.
The DC/DC A is used for SC1 interface. The DC/DC B and LDO regulators are used for
SIM/SAM/SC2, SIM/SAM3, SIM/SAM4 and SIM/SAM5 interfaces.
The microcontroller calls API module functions. Those functions contain TWI
commands.
at83c26_api.c
at83c26_api.h
at83c26_lib.c
at83c26_lib.h at83c26.h
twi_lib
slave_adr: This byte corresponds to the 7 MSB bits of address. The MSB bit is the
R/W bit.
A2 A1
b7 b6 b5 b4 b3 b2 b1 b0
0 1 0 0 0 0 1 R/W
bit rw: This bit corresponds to the LSB bit of the address byte (0 for write and 1 for
read)
nbbytes: This byte indicates the number of byte following the address byte. If this byte
is equal to 0, a stop condition follows the address byte.
*info: This pointer indicates the address of the buffer. The buffer contains the data to
send (if write operation) or the data to read (if read operation).
2.2 AT83C26 Driver The AT83C26 driver is developed with C51 microcontroller. The Atmel software TWI
Interface library is used.
If the user wants to interface the AT83C26 driver with another TWI library (on ARM
microcontroller for example), the twi_send_message_polling function must be
included.
Idem for software delays.
wait() microcontroller
TWI_send_command()
{ {
twi_send_message_polling() tempo() AT83C26 driver
} }
c26_read_cmd1_status() (length: 1)
c26_read_cmd1_sc1_cfg0() (length: 2)
c26_read_cmd1_sc1_cfg1() (length: 3)
c26_read_cmd1_sc1_cfg2() (length: 4)
c26_read_cmd1_sc1_cfg3() (length: 5)
1 c26_read_cmd1() (length: 11) c26_read_cmd1_sc1_cfg4() (length: 6)
c26_read_cmd1_sc1_interface() (length: 7)
c26_read_cmd1_sc1_timer_msb() (length: 8)
c26_read_cmd1_sc1_timer_lsb() (length: 9)
c26_read_cmd1_sc1_capture_msb() (length: 10)
c26_read_cmd1_sc1_capture_lsb() (length: 11)
c26_read_cmd2_statusb() (length: 1)
c26_read_cmd2_io_select() (length: 2)
2 c26_read_cmd2() (length: 4)
c26_read_cmd2_interface_b() (length: 3)
c26_read_cmd2_itdis() (length: 4)
c26_read_cmd3_sc2_cfg0() (length: 1)
3 c26_read_cmd3() (length: 3) c26_read_cmd3_sc2_cfg1() (length: 2)
c26_read_cmd3_sc2_cfg2() (length: 3)
c26_read_cmd4_sc3_cfg0() (length: 1)
4 c26_read_cmd4() (length: 2)
c26_read_cmd4_sc3_cfg1() (length: 2)
c26_read_cmd5_sc4_cfg0() (length: 1)
5 c26_read_cmd5() (length: 2)
c26_read_cmd5_sc4_cfg1() (length: 2)
c26_read_cmd6_sc5_cfg0() (length: 1)
6 c26_read_cmd6() (length: 2)
c26_read_cmd6_sc5_cfg1() (length: 2)
c26_read_cmd7_dcdcb() (length: 1)
7 c26_read_cmd7() (length: 2)
c26_read_cmd7_ldo() (length: 2)
c26_read_cmd8_slew_ctrl_1() (length: 1)
8 c26_read_cmd8() (length: 3) c26_read_cmd8_slew_ctrl_2() (length: 2)
c26_read_cmd8_slew_ctrl_3() (length: 3)
Note: The last register of a command can be read with 2 functions:
based on read command
based on register
The two functions are identical and only developed to simplify the use of driver.
3. Write config SC1 0100 XX10 (10 + SC1_CFG0 6 bits) SC1_CFG1 SC1_CFG2 SC1_CFG3 SC1_CFG4
6.Write Config SC on DCDCB 0100 XX10 1111 1000 IO_SELECT INTERFACE_B ITDIS
7. Write SC2 interface 0100 XX10 1111 1001 SC2_CFG0 SC2_CFG1 SC2_CFG2
10. Write SC5 interface 0100 XX10 1111 1101 SC5_CFG0 SC5_CFG2
11. Write DCDCB config 0100 XX10 1111 1110 DCDCB LDO
12. Write SLEW_CTRL config 0100 XX10 1111 0111 SLEW_CTRL_1 SLEW_CTRL_2 SLEW_CTRL_3
Note: The command 3 and the command 5 have a format with data in the command
byte. The reason is to access quickly to the register.
1 c26_write_cmd1() (length: 1)
2 c26_write_cmd2() (length: 1)
c26_write_cmd3_sc1_cfg0() (length: 1)
c26_write_cmd3_sc1_cfg1() (length: 2)
3 c26_write_cmd3() (length: 5) c26_write_cmd3_sc1_cfg2() (length: 3)
c26_write_cmd3_sc1_cfg3() (length: 4)
c26_write_cmd3_sc1_cfg4() (length: 5)
c26_write_cmd4_timer_msb() (length: 2)
4 c26_write_cmd4() (length: 3)
c26_write_cmd4_timer_lsb() (length: 3)
c26_write_cmd6_io_select() (length: 2)
6 c26_write_cmd6() (length: 4) c26_write_cmd6_interface_b() (length: 3)
c26_write_cmd6_itdis() (length: 4)
c26_write_cmd7_sc2_cfg0() (length: 2)
7 c26_write_cmd7() (length: 4) c26_write_cmd7_sc2_cfg1() (length: 3)
c26_write_cmd7_sc2_cfg2( )(length: 4)
c26_write_cmd8_sc3_cfg0() (length: 2)
8 c26_write_cmd8() (length: 3)
c26_write_cmd8_sc3_cfg2() (length: 3)
c26_write_cmd9_sc4_cfg0() (length: 2)
9 c26_write_cmd9() (length: 3)
c26_write_cmd9_sc4_cfg2() (length: 3)
c26_write_cmd10_sc5_cfg0() (length: 2)
10 c26_write_cmd10() (length: 3)
c26_write_cmd10_sc5_cfg2() (length: 3)
c26_write_cmd11_dcb_dcdcb() (length: 2)
11 c26_write_cmd11() (length: 3)
c26_write_cmd11_dcb_ldo() (length: 3)
c26_write_cmd12_slctrl_slewctrl_1() (length: 2)
12 c26_write_cmd12() (length: 4) c26_write_cmd12_slctrl_slewctrl_2() (length: 3)
c26_write_cmd12_slctrl_slewctrl_3() (length: 4)
Note: The last register of a command can be write with 2 functions:
based on write command
based on register
The two functions are identical and only developed to simplify the use of the driver.
4.1 Smartcard Due to the 2 multiplexed pins (CRST3/CC82 and CIO3/CC42), the SC2 interface and
Interface the SC3 interface share 2 pins.
If the SC2 interface uses CC4 and CC8 (full interface), SC3 is not usable.
If the SC2 interface does not use CC4 and CC8, SC3 is usable.
A smartcard interface can be used for a SIM/SAM interface. In this case CC4, CC8 and
CPRES are not used.
Several configurations are studied:
CONFIG 1: 1 full smartcard + 4 SIM/SAM
CONFIG 2: 2 full smartcards + 2 SIM/SAM
CONFIG 3: 1 full smartcard + 1 smartcard + 3 SIM/SAM
All functions to control the 3 configurations are developed.
smart
card
connector smartcard
TWI bus
SIM
connector
microcontroller
AT83C26 SIM
IOs connector
SIM
connector
SIM
ISO7816 connector
smart
card
connector smartcard
TWI bus
smart
card
connector smartcard
microcontroller
AT83C26 with
IOs CC4 and CC8
SIM
connector
SIM
connector
ISO7816
Figure 4-3. CONFIG 3: 1 Full smartcard interface, 1 smartcard interface and 3 SIM/SAM
smart
card
connector smartcard
TWI bus
smart
card
connector smartcard
microcontroller
AT83C26 without
IOs CC4 and CC8
SIM
connector
SIM
connector
SIM
connector
ISO7816
Uchar c26_config1_init()
Uchar c26_config2_init()
Uchar c26_config3_init()
4.2 DCDC Control The DCDCA and DCDCB outputs the CVCCx signals.
The DCDCA output is connected to CVCC1. The DCDCA voltage is controlled by
VCARD1[1:0] bits.
The DCDCB output is connected to 4 LDOs. The DCDCB voltage is controlled by
VDCB[1:0] bits. Each LDO output is controlled by VCARDn[1:0] (n = 2, 3, 4, 5).
The DCDCA and DCDCB need a 4MHz clock. Two internal oscillators provide this clock.
Internal
Oscillator DC/DC A
Internal
Oscillator DC/DC B
The DC/DC A Converter can work in two different modes which are selected by
STEPREGA bit:
Pump Mode (STEPREGA = 0): an external inductance of 10µH must be connected
between pins LIA and VCC. VCC can be higher or lower than CVCC1.
Regulator mode (STEPREGA = 1): no external inductance is required but VCC must
be always higher than CVCC+0.3V.
The DC/DC B Converter can work in two different modes which are selected by
STEPREGB bit:
Pump Mode (STEPREGB = 0): an external inductance of 10µH must be connected
between pins LIB and VCC. VCC can be higher or lower than selected voltage.
Regulator mode (STEPREGB = 1): no external inductance is required but VCC must
be always higher than selected voltage+0.3V.
4.2.1 DCDCA Init The DCDCA output is connected to CVCC1. The startup of the DCDCA needs to follow
Procedure the procedure below.
DEMBOOSTA[1:0]=[0:0]
Set Time-out to 3 ms
VCARD_OK1=1
Decrement
DEMBOOSTA[1:0]
to adjust the
Time-out current overflow
Expired
END
Increment
DEMBOOSTA[1:0]
DEMBOOSTA[1:0]
is at Maximum?
DC/DC A Converter
Initialization Failure
END
4.2.2 DCDCB The DCDCB output is connected to 4 LDOs. The DCDCB must be started (VDCBOK =
1) before starting LDOs.
DEMBOOSTB[1:0]=[0:0]
Set Time-out to 3 ms
VDCB_OK=1
Decrement
DEMBOOSTB[1:0]
to adjust the
Time-out current overflow
Expired
END
Increment (ready to start LDO)
DEMBOOSTB[1:0]
DEMBOOSTB[1:0]
is at Maximum?
DC/DC B Converter
Initialization Failure
END
4.3 smartcard The AT83C26 clock frequency range is between 4MHz and 48MHz. This signal is used
Clocks for logic unit and (if selected) for smartcard clock and DC/DC clock. Each SC interface
has a prescaler.
DCK[2:0] and CLKn[2:0] are used to configure the clock format cards.
If selected, a transparent mode on A2 pin is available for SC1 and SC2.
A2/CK
smartcard CCLK
Analog drivers
Clock
CLK
Prescaler
4.4 I/O control Due to the 2 multiplexed pins (CRST3/CC82 and CIO3/CC42), the SC2 interface and
the SC3 interface share 2 pins.
If the SC2 interface uses CC4 and CC8 (full interface), SC3 isn’t usable.
If the SC2 interface doesn’t use CC4 and CC8, SC3 is usable.
A smartcard interface can be used for a SIM/SAM interface. In this case CC4, CC8 and
CPRES are not used.
Several configurations are studied:
1 full smartcard + 4 SIM/SAM
2 full smartcards + 2SIM/SAM
1 full smartcard + 1 smartcard + 3 SIM/SAM
I/O1, I/O2, AUX1 and AUX2 are used to connect data to smartcard I/O pins.
The IOSEL[3:0] bits and IODISn bits are used to select the IO configuration. The user
must configure this register before to switch of SC interface.
0000 CIO1
0001 CIO2
0010 CIO3
0011 CIO4
0100 CIO5
microcontroller AT83C26
CIO IO1
CRST A1/RST
CC4 AUX1
CC8 AUX2
IO2 - - - - -
4.5 Slew Rate The slew rate control is to adapt CCLK, CIO, CC4 and CC8 if a long cable is used
Control between AT83C26 outputs and the smartcard connector.
The reset value is the automatic mode.
4.6 Conclusion The AT83C26 allows a large range of configurations. The software driver provides func-
tions on the most logic configurations and gives to the user an example of use of the
component.
If the application needs a different configuration, the library functions are easy to use.
CLK
CPRES1, 2:
= 1 if no card
SDA
SCL
Disclaimer: The information in this document is provided in connection with Atmel products. No license, express or implied, by estoppel or otherwise,to anyintellectu-
alproperty right is granted by this document or in connection with the sale of Atmel products. EXCEPT AS SET FORTH IN ATMEL’S TERMS AND CONDI-TIONS OF
SALE LOCATED ON ATMEL’S WEB SITE, ATMEL ASSUMES NO LIABILITY WHATSOEVER AND DISCLAIMS ANY EXPRESS, IMPLIED OR STATUTORYWAR-
RANTY RELATING TO ITS PRODUCTS INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICU-
LARPURPOSE, OR NON-INFRINGEMENT. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE, SPECIAL
OR INCIDEN-TAL DAMAGES (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF PROFITS, BUSINESS INTERRUPTION, OR LOSS OF INFORMA-
TION) ARISING OUTOF THE USE OR INABILITY TO USE THIS DOCUMENT, EVEN IF ATMEL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAM-
AGES. Atmel makes norepresentationsor warranties with respect to the accuracy or completeness of the contents of this document and reserves the right to make
changes to specificationsand product descriptions at any time without notice. Atmel does not make any commitment to update the information contained herein.
Unless specifically provided otherwise, Atmel products are not suitable for, and shall not be used in, automotive applications. Atmel’s products are not intended,
authorized, or warranted for useas components in applications intended to support or sustainlife.
© Atmel Corporation 2005. All rights reserved. Atmel®, logo and combinations thereof, are registered trademarks, and Everywhere You Are SM
are the trademarks of Atmel Corporation or its subsidiaries. Other terms and product names may be trademarks of others.