Electronic – GSM Module resets SIM card

gsmiso7816

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.

Best Answer

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.