1
\$\begingroup\$

I'm working on a SIM Card Emulator. For this purpose I use GSM Module Huawei EM770W that is connected to USB adapter. I soldered wires from SIM card holder to MCU (TM4C123XL) and from MCU to SIM Card appropriately (MCU acts like a buffer between modem and SIM Card) and am quite sure that hardware probably is okay. I succesfully get Answer To Reset from SIM Card, GSM module sends back PPS bytes, I even get several instructions, however, after getting response to GET RESPONSE instruction (00 C0 00 00 26), SIM Card is reset by modem.

I've already tried listening to successful transmission when card is inserted straight into USB adapter, compared with bytes in my case and they are the same but modem resets SIM in my case while communication without using MCU as a buffer is succesful and I can interface it with AT commands.

What might be my mistake made?

To give more information, I'm adding chars after ATR:

  • GSM module sends FF 10 96 79
  • Card send back FF 10 11 FE (meaning 9600 Baud rate)
  • GSM module sends 00 A4 00 04 02 (selecting file)
  • Card send back A4 (ACK byte)
  • GSM module: 3F 00 (data from Select File command)
  • CARD: 61 26 (number of bytes still available)
  • GSM MODULE: 00 C0 00 00 26 (GET RESPONSE command)
  • Card: C0 62 24 82 02 78 21 83 02 3F 00 A5 07 80 01 79 (ACK and 14 data bytes)

After last instruction GSM resets card.

\$\endgroup\$
6
  • \$\begingroup\$ can it be due to the delay caused by the MCU acting as buffer in response? \$\endgroup\$
    – User323693
    Jan 13, 2017 at 12:39
  • \$\begingroup\$ It might though seems unlikely. I set up baud rate of 9600, so there should be timeout of approximately one second. If my buffer would stop it, I wouldn't probably get to PPS because timing constraints instantly after reset are much tighter than after sending ATR. I am using receive timeout interrupts to answer to requests from SIM card \$\endgroup\$ Jan 13, 2017 at 12:44
  • \$\begingroup\$ is the issue repeatable always? what is the timing requirement and what is it currently with the MCU buffered option? \$\endgroup\$
    – User323693
    Jan 13, 2017 at 13:01
  • \$\begingroup\$ I want to buffer data so that SIM card could be carried away from GSM module. Issue always repeats at the same time after the same operation. According to ISO7816-3 "Waiting time" is defined as WI x 960 x Fi/f. WI is 10, Fi is 372 and f is 3846000 which calculated is 929 ms \$\endgroup\$ Jan 13, 2017 at 13:09
  • \$\begingroup\$ SIM voltage level? (which can be changed during the identification process) \$\endgroup\$
    – pjc50
    Jan 13, 2017 at 13:34

1 Answer 1

2
\$\begingroup\$

As noone pointed answer, I'm answering this myself. Problem was quite silly and marks that I haven't thought my application through. UART was setup without proper buffering so it led to overflow. I sent the same instructions straight to SIM Card without using interrupts and got proper answer. Case closed.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.