2025-03-20 3:58 AM - edited 2025-03-20 12:25 PM
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) ?
2025-03-20 4:01 AM
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 ...
2025-03-20 12:24 PM - edited 2025-03-20 12:26 PM
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.