LPC546xx iso7816 driver

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC546xx iso7816 driver

1,301 Views
yy0824_2006
Contributor I

Hello.

 

I want to implement ISO7816 interface using LPC54608 smartcard interface. According to UM10912 , lpc546xx series can support ISO7816 interface. I found there were no ISO7816 driver example in SDK_2.x_LPC54608,  so I decided to do it by myself. so  configure  sci0_io, sci0_sclk ,gpio reset and gpio VCC .  In the end ,it didn't work. so If there is the ISO7816 driver example code under lpc546xx platform, please let me know. thanks.

/* pin configs */

CLOCK_EnableClock(kCLOCK_SmartCard0);

CLOCK_SetClkDiv(kCLOCK_DivSmartCard0Clk, 3U, false);     /* main clk  12M */

smartcard interface:

base->OSR =  0 | SMARTCARD_OSR_OSFRAC(0b111)| SMARTCARD_OSR_OSINT(0b1111) | SMARTCARD_OSR_FDINT(0b0010111);

base->DLL = SMARTCARD_DLL_DLLSB(0x74); /* The SCIn Divisor Latch LSB Register(DLAB = 1) */

base->DLM = SMARTCARD_DLM_DLMSB(0x01); /* The SCIn Divisor Latch LSB Register(DLAB = 1) */

base->LCR = SMARTCARD_LCR_WLS(3)  /* 8-bit character length */

| SMARTCARD_LCR_SBS(0) /* 1 stop bit */

| SMARTCARD_LCR_PE(1) /* Enable parity generation and checking */

| SMARTCARD_LCR_PS(1) /* Even Parity. */

| SMARTCARD_LCR_DLAB(1); /* Enable access to Divisor Latches */

base->FCR = SMARTCARD_FCR_FIFOEN(0) /* FIFO Enable */

| SMARTCARD_FCR_RXFIFORES(0) /* RX FIFO Reset.

1: Writing a logic 1 to SCInFCR[1] will clear all bytes in SCIn Rx FIFO, reset the pointer logic. This bit is self-clearing

        0: No impact on either of SCIn FIFOs

        */

| SMARTCARD_FCR_TXFIFORES(0) /* TX FIFO Reset.

0: No impact on either of SCIn FIFOs.

1: Writing a logic 1 to SCInFCR[2] will clear all bytes in SCIn TX FIFO, reset the pointer logic. This bit is self-clearing.

        */

| SMARTCARD_FCR_DMAMODE(0) /* DMA Mode Select. When the FIFO enable (bit 0 of this register) is set */

| SMARTCARD_FCR_RXTRIGLVL(0x02); /* RX Trigger Level. Trigger level 2 (8 characters or 0x08).*/

base->IER = SMARTCARD_IER_RBRIE(1) /* RBR Interrupt Enable */

| SMARTCARD_IER_THREIE(1) /* THRE Interrupt Enable */

| SMARTCARD_IER_RXIE(1); /* Enable the RX line status interrupts */

base->SCICTRL =  SMARTCARD_SCICTRL_SCIEN(1) /* Smart Card Interface Enable */

| SMARTCARD_SCICTRL_NACKDIS(1) /* A NACK response is enabled */

| SMARTCARD_SCICTRL_PROTSEL(1) /* T=0 */

| SMARTCARD_SCICTRL_TXRETRY(2) /* tx retry times: 0 */

| SMARTCARD_SCICTRL_GUARDTIME(0xff); /* Extra guard time */

Tags (3)
0 Kudos
2 Replies

1,065 Views
soledad
NXP Employee
NXP Employee

Hi,

LPC5460X still don't have the smart card sample code, although the LPC5460X already have the smart card interface.
But we have some smart card sample code for LPC11 series, this is the application note:
https://www.nxp.com/docs/en/application-note/AN11121.zip?fsrch=1&sr=1&pageNum=12.

There is a document and the sample code for your reference ISO7816 for kinetis
Please check the following post:
 https://community.nxp.com/docs/DOC-332373


Have a great day,
Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

1,065 Views
yy0824_2006
Contributor I

 I already read it. it uses uart interface. 

thank you all the same.

0 Kudos