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.
Hi Wayne Jeong and Thomas,
Have you successfully able to implement ISO7816 interface in QN908x
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.
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.
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
Dear Gerardo~
Is USART0 Tx a Smartcard CK? Is USART0 Rx the Smartcard data?
Is USART0 CLK a Smartcard CK? Is USART0 Rx the Smartcard data?
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,
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.