0

I am trying to read data from a two-way I/O uart pin of a sim card on Arduino. It is attached to the GPRS Arduino shield (with SIM900 modem). I believe I have a baud rate issue.

I am supposed to receive ATR (Answer to Reset) bytes which should be easily recongnized but all I get is a almost-random stream of bytes.

I soldered a wire on the SIM I/O pin and attached it to arduino's software serial RX, I set the baud rate to the same baud rate of the modem which goes up to 115,2K and read. Here's my code

#include <SoftwareSerial.h>
SoftwareSerial IO(9, 10); 
void setup() {
Serial.begin(115200); 
IO.begin(115200); // my said wire on SIM card's I/O    enter code here
}
void loop() { 
if (IO.available())
Serial.print(IO.read(),HEX); 
}

and here's the output after a cold reset : enter image description here

I also tried other baud rate within the SIM900 range of baud rates, still almost same.

Any idea why it's not showing bytes correctly? I appreciate it if anyone could help.

  • what is "GPRS Arduino shield (with SIM900 modem)"? – Juraj Apr 16 at 8:57
  • why do you print it as HEX and without spaces between? the print(,HEX) doesn't add leading zeros – Juraj Apr 16 at 9:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.