1
\$\begingroup\$

I am currently using an STM32F401RE that I have to interface with a SIM800L GSM module via UART. In a first "toy example" I used Arduino and found no problems, but passing to the STM MCU I am unable to receive any kind of answer from the module. I am starting to suspect that the output voltage levels of the board are incorrect for the GSM module. SIM800L requires an input signal between 2.5 and 2.8 Volts, that Arduino (5V) can easily provide, and that I was able to provide also with a converter from my PC USB. Trying to dig into the MCU datasheet I got stuck into this table. enter image description here Honestly speaking I am not properly an electronics guy so I am not able to fully understand my MCU UART TX pins to which line of the table belong, but however it is quite obvious that potentially in none of the reported cases I can really get the voltage required by GSM board. So my questions are:

  • May my suspect about wrong logic levels really be the fault in my connection?
  • If so, how can I adjust my MCU pin voltage to adapt to the GSM module?

EDIT: I connected the MCU to the GSM module as suggested by the datasheet of the productor for 3.3 interfaces (obviously rx-tx, tx-rx the image is faulty). The only pins involved in my case are transmission and reception and ground and supply, so ignore the rest for the UART protocol.

enter image description here

For what concerns the code there is not so much to speak about, simple transmit and wait for a response in polling or interrupt mode. UART is set in 8N1, as Arduino SoftwareSerial that I successfully used does by default. Peripherals initialization code was automatically generated by CubeMX. Messages are correctly send by the MCU, just by checking with a terminal. Doubting about hardware is my last idea, but in this case I can't see other options for my short experience.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ While electrical concerns to avoid damage are indeed important, the issue you face is most likely a software problem - you're provided no evidence that you are successfully using the STM32 UART (or at least the correct one with correctly configured pins) to do the same things that the Arduino sketch does. Nor have you documented how you currently have things connected in a way that might show an adjustment needed for lower drive voltage into a divider, or even demonstrated that your program is running at all. \$\endgroup\$ Commented Jul 24, 2019 at 18:40
  • \$\begingroup\$ Have you got the answer?? Because i am doing the same thing there. I am not recieving any reply from sim800l. \$\endgroup\$ Commented Aug 13, 2021 at 10:07

3 Answers 3

1
\$\begingroup\$

I had the same problem. I solved it by setting the pulldown in the UART's pins' configuration.

\$\endgroup\$
1
  • \$\begingroup\$ While a pulling resistor is not a bad idea, this would not be the cause of the problem unless the software is getting stuck due to an uncleared UART error flag. \$\endgroup\$ Commented Nov 9, 2019 at 22:33
0
\$\begingroup\$

I could only find one video that showed a possible solution. This one shows how to establish communication between STM32F4 and SIM800L.

https://www.youtube.com/watch?v=K1HLapbGv4U

Here is also a thread. Somebody solved this problem by changing a faulty resistor. You can check the answers:

http://www.embeddedadvice.com/t/interfacing-stm32f4-with-simcom-800l-gsm-module/1574/5

\$\endgroup\$
1
  • 1
    \$\begingroup\$ While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review \$\endgroup\$ Commented Jun 4, 2023 at 16:57
-1
\$\begingroup\$

This should work even though its not the correct way to interface.Can you try reducing the baud rate and just sent a single byte.If that doesn't work can you post a picture of the tx and rx lines so we know whats exactly happening.enter image description here

\$\endgroup\$
2
  • 1
    \$\begingroup\$ My MCU has no 5V UART \$\endgroup\$
    – user362759
    Commented Jul 24, 2019 at 18:54
  • \$\begingroup\$ @user362759 the resistor ratio depicted is for 3.3 v to 2.8 v, at least if that is a 5.6 K resistor. \$\endgroup\$ Commented Aug 18, 2020 at 10:21

Your Answer

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

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