1
\$\begingroup\$

I am interfacing MAX232 with STM32F030k6. I have very recently found out that Max3232 would be a better choice, because it works with 3,3 volt. But I am eager to know if UART reciever pin of the mentioned MCU is 5 Volt tolerant. On the other side, I know that MAX232 recognizes any voltage higher that 2V as 5V. Therefore That wouldn't become a trouble. I have took a look at my MCU user manual but didn't find anything. I appreciate your ideas on this issue.

\$\endgroup\$
2
  • \$\begingroup\$ As is always the case, it depends. MAX3232 is the newer driver however and as you have said operates from 3V3 to 5V. This thread has some interesting information. edaboard.com/… \$\endgroup\$
    – ChrisD91
    Apr 1 '20 at 23:51
  • \$\begingroup\$ @Bornak: What is the size of your STM32, how many pins does it have, and which pins are you using as UART TX and RX? \$\endgroup\$ Apr 2 '20 at 10:21
2
\$\begingroup\$

The manual (https://www.st.com/resource/en/datasheet/stm32f030f4.pdf) on page 28 has the info about the I/O structure:
enter image description here

Page 29 tells you what you need to know about your PA3 pin:
enter image description here

I am sorry to inform you that it is not 5V tolerant.

You could use a simple voltage divider on the USART input (RX) to bring it down to a more compatible level.

Better yet, you could use UART on other pins as their alternate function. If you look at the same table 11 that starts on page 28, you will start seeing USART in the "Pin functions" > "Alternate functions" column. Match that with the "FT" or "FTf" abbreviations in the "I/O structure" column, and you've got yourself a 5V tolerant UART interface.
(Thanks to @Justme who kept on insisting that we dig for more information!)

\$\endgroup\$
2
  • \$\begingroup\$ Not a good answer. You don't know which UART the OP is using, so you don't know which pins are used for RX, and thus you can't know if it is 5V tolerant or not. Resistive dividers are also slow, they might not pass fast baud rates. \$\endgroup\$
    – Justme
    Apr 2 '20 at 5:23
  • \$\begingroup\$ @Justme: Thank you. I have updated my answer now. \$\endgroup\$ Apr 2 '20 at 11:23
0
\$\begingroup\$

Not all pins are 5V tolerant. You haven't mentioned which pin you are using, but the datasheet lists the IO pin type so when you know which pin is used you can see if it is 5V tolerant or not. PA3 is not 5V tolerant, but the other three pins than can be mapped to USART1_RX are.

\$\endgroup\$
6
  • \$\begingroup\$ I am using the only UART RX pin of STM32f030k6 which is PA3 \$\endgroup\$
    – Bornak
    Apr 2 '20 at 10:02
  • \$\begingroup\$ @Bornak: I have updated my answer with the information you need. \$\endgroup\$ Apr 2 '20 at 11:17
  • 1
    \$\begingroup\$ Thank you @Edin Fifić \$\endgroup\$
    – Bornak
    Apr 2 '20 at 11:58
  • 1
    \$\begingroup\$ @Bornak Why do you say PA3 is the only UART RX pin while it isn't? PA3 is not the only USART1_RX pin. It can be mapped to four different pins, of which all other three are 5V tolerant. \$\endgroup\$
    – Justme
    Apr 2 '20 at 12:09
  • \$\begingroup\$ @Justme You are right, I hadn't notice to pin mapping. Thank you so much. \$\endgroup\$
    – Bornak
    Apr 2 '20 at 12:25

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.