cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot access >=3,3V at GPIOA - STM32F411

timbo2023
Associate III

Dear Ladies and Gentlemen,

 

for you it is your daily business - for me as customer a contemporary challenge:

 

Something went wrong with my pin-configuration.

I measure ~1,7 V as GPIO-output of Port A instead of wished >=3.3 V.

My power supply is a USB.

Could you give a sample pin configuration for (3.3 V output) of Port A in discussion?

 

As additional comment:

Round about 5 V are present at the 5 V-Pin(s).

 

Thank you in advance.

TIMBO

 

46 REPLIES 46

Could you please share your GPIO config?

This is what you need to toggle PA2 pin for example:

 

  __HAL_RCC_GPIOA_CLK_ENABLE();

  GPIO_InitStruct.Pin = GPIO_PIN_2;
  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
  GPIO_InitStruct.Pull = GPIO_NOPULL;
  GPIO_InitStruct.Speed = GPIO_SPEED_LOW;
  HAL_GPIO_Init(GPIOG, &GPIO_InitStruct);
  
  while (1)
  {
    HAL_GPIO_TogglePin(GPIOA, GPIO_PIN_2);
    /* Insert delay 100 ms */
    HAL_Delay(100);
  }

 

With this code PA2 pin will be at VDD level (let's say @3.3V) during 100ms and 0V at the same duration ..

 

 

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
timbo2023
Associate III

Ok, thank you -

"bare metal" or some more fundamental input, please - we sit in GER not in USA or RUSSIA ...

 

But as qualified input:

You set the GPIOx_MODE-register to "general purpose output mode" - that we understand.

You set GPIOx_PUPDR to "No pull-up, pull-down" =^ "00"

You set GPIOx_OSPEEDR to "low speed" =^ "00"

 

I will try it.

 

But is the ODR-value the same like the BSRR-value in look to this case?

 

 

 

 

 

 

 

Perhaps graduate to bare-metal when you have other things mastered.

What are you attempting to drive with the pin? A Motor?

Does PA3 conflict with anything else on your board? What's connected? Diagram.

The current out of the pin is limited, If you're getting 1.7V the load is likely too high. Remove the load and measure the pin level then.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
timbo2023
Associate III

I measure to the board ...

 

something went wrong here ...

 

 

 

SofLit
ST Employee

Again please share your code to conclude. This is not the right way to help you efficiently by doing ping pongs comments!

How did you configure the GPIO(s)? 

""bare metal" or some more fundamental input, please - we sit in GER not in USA or RUSSIA ..."

--> Start with HAL then move to direct access to the registers ..

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
timbo2023
Associate III

I got round about 3.3 V on PA1-3.

I got round about 1.7 V on PA0.

timbo2023
Associate III

Where I can reach the 3.6 V ?


@timbo2023 wrote:

I got round about 3.3 V on PA1-3.

I got round about 1.7 V on PA0.


Check what is connected to PA0. Is there something connected to it?

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

@timbo2023 wrote:

Where I can reach the 3.6 V ?


As I said previously, the GPIO output high level depends on your VDD. If your VDD is at 3.3V, your pin can't go more than 3.3V!

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

>I got round about 1.7 V on PA0.

Without anything connected to it ?

Then you damaged the pin.

+

>Where I can reach the 3.6 V ?

If you change the supply regulator to a 3,6v type.

Or use a level shifter...3->5V .

Otherwise NOT.

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