2021-06-17 06:50 AM
I have RS-485 transceiver connected to USART1 (PA9 + PA10) and relay connected to PB4. If MCU have erased FLASH or RST-pin connected to GND all incoming data to pin PA10 (Rx) for RS-485 line translated to pin PB4 in inversion (0 on PA10 => 1 on PB4, and 1 on PA10 => 0 on PB4). Why PB4 set as output and how it connected to USART1 Rx? And why is the output level inverted relative to the input?)
Solved! Go to Solution.
2021-06-18 02:55 AM
The UCPD dead-battery behaviour is independent of the rest of UCPD. Think about using this feature: it is aimed at having the pulldown in place exactly when the mcu is not working, to indicate to the charger that there's not enough charge left in the battery to run the mcu.
The behaviour of this feature is governed runtime by PWR_CR3.UCPD1_DBDIS, by reset enabled.
JW
PS. This is a surprising feature which got into your way. Who would possibly like this? :D
2021-06-17 09:58 AM
Try this on a "known good" board such as Nucleo or Disco.
JW
2021-06-17 10:05 AM
From RM0440:
The NJTRST (PB4) pin has also UCPD_CC2 functionality which implements internal UCPD
pull-down resistor (5.1 KΩ) which is controlled by voltage on UCPD_DBCC2 pin (PA10). to
disable the pull-down on the NJTRST (PB4) pin the UCPD_DBCC2 pin (PA10) must be held
at low level voltage (see Section 45.4.6: UCPD Type-C pull-ups (Rp) and pull-downs (Rd)).
JW
2021-06-17 10:08 AM
I've just realized that this may be the culprit in your other thread https://community.st.com/s/question/0D53W00000sr9xnSAA/stm32g473-cant-start-debugging-with-incoming-data-stream-on-usart1-rx-pin
JW
2021-06-18 02:01 AM
But how UCPD works with erased FLASH or grounded RST? By default UCPD is disabled (UCPD_CFGR1 Reset value: 0x0000 0000).
2021-06-18 02:14 AM
The "dead battery" pulldown resistor works directly in hardware, i.e. even if the mcu is in reset, that's why it can be disabled by pulling down PA10.
Yes I know you don't like it but that's how it works.
JW
2021-06-18 02:29 AM
You want to say that RM is lying about the turned off UCPD at startup?
"Yes I know you don't like it" - it's not whether I like it or not. I'm just trying to figure out how it works to avoid similar moments in the future.
2021-06-18 02:55 AM
The UCPD dead-battery behaviour is independent of the rest of UCPD. Think about using this feature: it is aimed at having the pulldown in place exactly when the mcu is not working, to indicate to the charger that there's not enough charge left in the battery to run the mcu.
The behaviour of this feature is governed runtime by PWR_CR3.UCPD1_DBDIS, by reset enabled.
JW
PS. This is a surprising feature which got into your way. Who would possibly like this? :D
2021-06-18 03:28 AM
This MCU is to hard for me. Where is my arduino...
It is really surprising feature for me.
Thanks bro :)