cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H753ZI Internal pull up resistors not doing anything?

CLeo.1
Senior II

Hey guys,

Kinda pulling my hair out as to why the pull up resistor is not kicking in? I am expecting when the MCU boots up to see a nice high signal on PA4, but nothing. 

I am not sure what I am doing wrong. if I write a 0x01 into ODR it then pulls up, but I know that is not correct.
GPIO configuration:

 

LL_AHB4_GRP1_EnableClock(LL_AHB4_GRP1_PERIPH_GPIOA);

	LL_GPIO_InitTypeDef GPIO_STD_CFG;
	LL_GPIO_StructInit(&GPIO_STD_CFG);

	GPIO_STD_CFG.Alternate = 0;
	GPIO_STD_CFG.Mode = LL_GPIO_MODE_OUTPUT;
	GPIO_STD_CFG.OutputType = LL_GPIO_OUTPUT_PUSHPULL;
	GPIO_STD_CFG.Pin = LL_GPIO_PIN_4;
	GPIO_STD_CFG.Pull = LL_GPIO_PULL_UP;
	GPIO_STD_CFG.Speed = LL_GPIO_SPEED_HIGH;
	LL_GPIO_Init(GPIOA, &GPIO_STD_CFG);

 

GPIOA Reg:

CLeo1_0-1687967788184.png

Logic Analazyer 

CLeo1_1-1687967821007.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

If you want it to be high, you can set ODR=1 before you set it to output mode. Pullups/pulldowns do nothing in output push-pull mode except waste power if enabled.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

4 REPLIES 4
TDK
Guru
	GPIO_STD_CFG.Mode = LL_GPIO_MODE_OUTPUT;
	GPIO_STD_CFG.OutputType = LL_GPIO_OUTPUT_PUSHPULL;

 

I think there's a misunderstanding on what you think it should do. Why do you think it should be high?

It's configured as a push-pull output, and since ODR=0, it's set to low. If you want it as open-drain or as an input, where the pullup would actually do something useful, do those instead.

If you feel a post has answered your question, please click "Accept as Solution".
CLeo.1
Senior II

No problem, it could easily be a misunderstanding, The reasoning behind my thinking is simply within the reference manuel pg 537 Figure 73. It states "Push-pull mode: a “0” in the output register activates the N-MOS whereas a “1” in the output register activates the P-MOS" within pg 536 11.3.10 so to me 


This simply should set your GPIO high as soon it turns on as the Pull up is enable and the ODR reg is 0 thus activating NMOS that will start sinking the Pull up, is all.

Also. maybe I wasnt clear with my intention but I do want my GPIO to start HIGH as soon as the MCU boots, this pin will be used as a Chip Select for SPI. 

Edit: Nevermind, I see where I made my mistake. Its actually zero on that node due to the NMOS, I believe this is where I went wrong.

TDK
Guru

If you want it to be high, you can set ODR=1 before you set it to output mode. Pullups/pulldowns do nothing in output push-pull mode except waste power if enabled.

If you feel a post has answered your question, please click "Accept as Solution".