cancel
Showing results for 
Search instead for 
Did you mean: 

LoRa-E5 STM32 WLE 5JC: How do i set a GPIO pin back to Analog to save power?

AA.16
Associate III
BQ_GE_GPIO_Port->MODER = GPIO_MODE_ANALOG;//setting to analog to save power

This seems to not work at all. I have a physical pulldown on the pin but the pin stays HIGH. Why is that?

i init the pin via this code here:

__HAL_RCC_GPIOB_CLK_ENABLE();
	GPIO_InitTypeDef GPIO_InitStruct = { 0 };
 
	/*Configure GPIO pin */
	GPIO_InitStruct.Pin = BQ_GE_Pin;
	GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
	GPIO_InitStruct.Pull = GPIO_NOPULL;
	GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
	HAL_GPIO_Init(BQ_GE_GPIO_Port, &GPIO_InitStruct);
	

my understanding is that i can jsut switch between the modes to save power when going into sleep. And that when its in Analog mode that it will not use any pullup internally. i have apulldown externally on the pin with 400k ohm.

1 ACCEPTED SOLUTION

Accepted Solutions
AA.16
Associate III

ok the problem was i was using a 470k ohm pulldown. with a 10k ohm pulldown it works.

View solution in original post

1 REPLY 1
AA.16
Associate III

ok the problem was i was using a 470k ohm pulldown. with a 10k ohm pulldown it works.