Skip to main content
Visitor II
March 20, 2025
Question

STM32H503RBT6 - Is it okay to continuously change a specific port function ?

  • March 20, 2025
  • 1 reply
  • 407 views

Hello!

In STM32H503RBT6, PIN 16 (PA2) can take the role of a UART or ADC.

In my application, hardware-wise, it would be ok continuously change their role (every 500ms).

What about firmware?

I'd like to set it to 1-wire UART, do some communication for around 500ms, then change the port role to ADC, take some samples for around 500ms, and then back to UART.

I don't see any problem about this but I figured I might ask anyway.

So, could a problem arise because of this constant port role change (strictly looking at the firmware side only) ?

 

    This topic has been closed for replies.

    1 reply

    Super User
    March 20, 2025

    No problem as far as the STM32 port is concerned.

    Maybe challenging to have the same external connection doing both serial comms and analogue, though ...

    mpiresAuthor
    Visitor II
    March 20, 2025

    Thanks for the answer!

    The ADC is a simple NTC.

    The pullup resistor on this line is going to be used in UART communication (when a device UART capable is connected to this pin) and as a voltage divider when an NTC is connected.

     

    edit: Oh, I just noticed that I forgot to provide a crucial information: this is a 1-wire UART communication. I've added this to the main post.