[QN9083 ]: To use ISO7816 with QN908x

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

[QN9083 ]: To use ISO7816 with QN908x

1,460 Views
waynejeong
Contributor II

Hello.

I want to implement ISO7816 interface using QN9083 with smart card IC. According to UM11023, QN908x series can support ISO7816 interface. I had try to find ISO7816 driver example in SDK_2.2_QN908XCDK, but I could not find it.

If there is the ISO7816 driver example code, please let me know how can I get.

Labels (1)
Tags (1)
7 Replies

973 Views
kishansaralaya
Contributor III

Hi Wayne Jeong and Thomas,

 Have you successfully able to implement ISO7816 interface in QN908x

0 Kudos

973 Views
kishansaralaya
Contributor III

Hi All,
Am able to get a response from the smart card using the config settings mentioned in this thread. While configuring the QN9080 for a bidirectional communication (ISO7816 - half duplex) need to know what additional configurations need to be added apart from the below steps: 
    //Interrupt driven USART config used to Read the Smart card response. 

 
  step 1.  flexCom0->IOMODE = FLEXCOMM_IOMODE_DIO_MODE(1)|FLEXCOMM_IOMODE_DIO_OEN(0);

  step 2. CardReset();

  step 3.  //Read ATR value in the IRQ method.

  step 4.  //Config Rx port for Sending APDU command.

  step 5.   flexCom0->IOMODE = FLEXCOMM_IOMODE_DIO_MODE(1)|FLEXCOMM_IOMODE_DIO_OEN(1); 

  step 6.  USART_WriteBlocking(SMARTCARD_USART, apdu, sizeof(apdu) / sizeof(apdu[0]));

  step 7.  //Some configurations need to done here ?

  step 8.    flexCom0->IOMODE = FLEXCOMM_IOMODE_DIO_MODE(1)|FLEXCOMM_IOMODE_DIO_OEN(0);

  step 9.    //Read APDU response in the IRQ handler

   

Need to know what specific function/configuration I need to call at step 7?, kindly do the needful.

0 Kudos

973 Views
kishansaralaya
Contributor III

Am able to successfully configure the QN908x with ISO7816 mode and communicate, the only step missing in the above list is the FIFOCFG configuration. After setting that everything worked as needed.

0 Kudos

973 Views
gerardo_rodriguez
NXP Employee
NXP Employee

Hello Wayne Jeong,

The QN908x USART only supports the bidirectional/half-duplex communication needed by the 7816 protocol.

Unfortunately, there is no example application for this feature, but it shouldn't be very hard to implement. In the FLEXCOMx_IOMODE register, you need to enable the DIO_MODE bit to enable bidirectional mode and the DIO_OEN bit indicates if the pin will act as a receiver or as a transmitter.

Let me know any question you may have.

Regards,

Gerardo

973 Views
thomasyoun
Contributor II

Dear Gerardo~

I'm going to make a card reader through the ISO7816.
For other manufactures, MCU pins are required for ISO7816 communication.
Please refer to the following...
   (LINK : ST 7816 )
   1. USART_CK(Smartcard clock), 
   2. USART_TX(IO serial data: open drain),  
   3.Any GPIO(Reset to card),
   4. Any GPIO(Supply voltage),
   5.Any GPIO(Programming voltage)
I have a question~
For Qn908x MCU, 
Is USART0 Tx a Smartcard CK? Is USART0 Rx the Smartcard data?     
=> PA04 : Smartcard CLK(?), PA05 : Smartcard DATA(FC0_RXD_SDA_MOSI)
if not,
If the pin description in the QN908x datasheet says USART Clock
Is USART0 CLK a Smartcard CK? Is USART0 Rx the Smartcard data? 
 => PA18 : Smartcard CLK(?), PA18 : Smartcard DATA(FC0_RXD_SDA_MOSI)
pastedImage_41.png   
I want to circuit first.
If you have a sample program, please share it.
Thank you.
0 Kudos

973 Views
gerardo_rodriguez
NXP Employee
NXP Employee

Hello Thomas,

When 7816 mode is enabled, the USART RX (FCn_RXD) is the bidirectional I/O data pin. The USART SCK (FCn_SCK) could be used as the smart card clock, but you should verify with the smartcard specification about the required clock frequency. If you need a higher frequency than what the USART SCK generates you could use a separate timer for generating this clock.

The USART pins on Flexcomm 0 are: 

- PA05 or PA17 for FC0_RXD.

- PA18 or PA19 for FC0_SCK.

As reference, you can use the application note AN4453 which describes a smart card interface implemented in a different MCU.

Regards,

0 Kudos

973 Views
kishansaralaya
Contributor III

Dear Gerado Rodriguez,

Need few suggestions on implementing ISO7816 interface using QN908x controller,
1. Can we make use USART polling mechanism as a interface between Smart card and the controller.
2. Is there a way to increase the Rx buffer size.if am not wrong by default buffer size is limited to 16 bytes.

0 Kudos