cancel
Showing results for 
Search instead for 
Did you mean: 

Strange behavior GPIOD

Artur Vieira
Associate III

Hi

I am using the STM32G070CB in a new product.

I have the GPIOD0 and 1 connected to be digital inputs (they are to be connected to open-colector device), as such i have enabled the internal pull-ups in the GPIO configuration.

The strange thing, is that only PD1 is read as '1' (or have 3.3V) when the input is "open". Even checking with the multi-meter PD1 has 3.27V and PD0 as 0V.

The pull-ups and other configuration related to GPIO seems to be OK.

//Pins to be configured as Input
  GPIO_InitStruct.Mode = LL_GPIO_MODE_INPUT;
  GPIO_InitStruct.Speed = LL_GPIO_SPEED_FREQ_LOW;
  GPIO_InitStruct.OutputType = LL_GPIO_OUTPUT_PUSHPULL;
  GPIO_InitStruct.Pull = LL_GPIO_PULL_UP;
  GPIO_InitStruct.Pin = LL_GPIO_PIN_0 | LL_GPIO_PIN_1;
  LL_GPIO_Init(GPIOD, &GPIO_InitStruct);

The peripheral clock is enabled for GPIOD. When seeing the RCC, GPIOD registers in the DEBUG everything seems correctly configured accordingly with the datasheet / Reference manual.

0690X000009Yx59QAC.jpg

I have tried to configure also PD2 and PD3 (although they are not routed in this board) and the problem also exists, PD2 is read as '0' and PD3 is read as '1'.

Another funny / strange thing is that when i force the PD1 to GND, PD0 value starts to read as '1'.

I have tested in two boards i have assembled, and at the moment i don't have any component connected to the STM GPIOD pins (just the track to the output connector), the problem is the same in booth boards.

Any suggestions?

Thank You

1 ACCEPTED SOLUTION

Accepted Solutions

PD0 and PD2 are UCPD2_CCx which have a pulldown enabled enabled after reset. Disable it by setting SYSCFG_CFGR1.UCPD2_STROBE .

https://community.st.com/s/question/0D50X0000Az2By8SQE/open-drain-pin-is-pulling-down-slightly-on-stm32g081rb

JW

View solution in original post

2 REPLIES 2

PD0 and PD2 are UCPD2_CCx which have a pulldown enabled enabled after reset. Disable it by setting SYSCFG_CFGR1.UCPD2_STROBE .

https://community.st.com/s/question/0D50X0000Az2By8SQE/open-drain-pin-is-pulling-down-slightly-on-stm32g081rb

JW

Artur Vieira
Associate III

Thanks for the answer...

Completely missed that while reading the manual. Noticed on the datasheet that the pins had different electric characteristics (FT_c), but no "special" peripheral associated.

That solved the issue.