2019-06-20 12:56 PM
I am using pin PA8 in open drain GPIO output mode to control the power supply voltage on a custom board. Normally, the power supply output 5V but when PA8 is set low, it adds an extra 3k resistor to ground to the voltage feedback pin on the power supply and the output switches 12V.
The voltage feedback node is nominally 2.5V.
This works fine except that when PA8 is high (open drain), the supply outputs around 7.5V and the voltage at the PA8 pin is around 1.5V, not the 2.5V I would expect. Internal pull-ups and pull-downs are disabled.
I rewired the prototype board and switched to a different pin (PB11) and everything worked correctly. This problem exists on all of the prototype boards that we have powered up so far.
What is going on? Why is that particular pin acting like it has a very weak pull-down when high instead of going open drain?
Solved! Go to Solution.
2019-06-22 01:40 AM
PA8 is UCPD1_CC1which has a pulldown enabled after reset. Disable it by setting SYSCFG_CFGR1.UCPD1_STROBE .
JW
2019-06-20 01:34 PM
Something else attached to it? Shorted to a neighbouring pin?
Xray board? Check continuity on unpopuled board?
2019-06-21 02:29 PM
No, it doesn't seem to have anything to do with the board itself.
I just reproduced the problem on a stock G071RB Nucleo board.
2019-06-22 01:40 AM
PA8 is UCPD1_CC1which has a pulldown enabled after reset. Disable it by setting SYSCFG_CFGR1.UCPD1_STROBE .
JW
2019-06-24 09:23 AM
That fixed it.
Thanks!
2019-12-26 12:19 PM
Hi all,
Where did you add the line: SET_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_UCPD1_STROBE)? I have added it before and after GPIO init, but it seems not to disable the pulldown on PA8 pin on my G070KB (32pin). I have PA9 configured as UART_TX. Is there something else needed to set/reset in the registers?
2019-12-30 09:09 AM
I put the line after the GPIO Init (and after all of the other HAL peripheral inits).
Also, I didn't set the bit directly but used the helper function:
HAL_SYSCFG_StrobeDBattpinsConfig(SYSCFG_UCPD1_STROBE);
This shouldn't make any difference, since it looks like the helper function just sets the bit.
Hope that helps.
2019-12-30 09:55 PM
Thank you. I actually seemed to got it working by putting the line right after the HAL_Init(); (before SystemClock_Config();), but not sure if this place was the key, or what changed.