0
\$\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\$
  • \$\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\$ – Chris Stratton Jul 24 at 18:40
-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\$
  • \$\begingroup\$ My MCU has no 5V UART \$\endgroup\$ – user362759 Jul 24 at 18:54

Your Answer

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

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