Skip to main content
Visitor II
February 15, 2024
Question

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

  • February 15, 2024
  • 20 replies
  • 16073 views

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

 

    This topic has been closed for replies.

    20 replies

    Technical Moderator
    February 15, 2024

    Hello,

    Which board you are using? a custom board?

    You need to provide schematics as well. 

    ".. instead of wished >=3.3 V." -> that depends on your VDD.  What is your VDD level?

    Technical Moderator
    February 15, 2024

    The TO talks about the Black Pill, probably this one.

    Graduate II
    February 15, 2024

    Reduce the load attached to the pin. Perhaps just remove and measure then.

    timbo2023Author
    Visitor II
    February 15, 2024

    It is a BlackPill (weact v. 3.0) -

     

    To my purpose - I need the round about 5 V from 5 V-Pin at the outputs of PA0-PA3.

     

    ~ 3.3 V would be enough, but I measure ~1.7 V at the moment...

     

    It seems to be a configuration thought...

    Technical Moderator
    February 15, 2024

    BlackPill/BluePill are not boards of ST and unfortunately some of them have fake STM32 on them!

    Meanwhile, even with a genuine STM32 you can't reach 5V. The maximum you can reach is 3.6V which is the maximum of VDD.

    timbo2023Author
    Visitor II
    February 15, 2024

    Ohhwee, that we must consider & check, of course.

     

    On the 5 V pin were 4. ..V with USB given.

    Is it possible to reach this voltage direct on another pin of port A?

    But:

    ~3.6 V would be enough - VDD - of course - How looks the configuration of the pin0-3 of port A regarding it?

     

    timbo2023Author
    Visitor II
    February 15, 2024

    Thank you, Mr. NEIL - ok, that i understood with support of your answer.

     

    But back to VDD with its reachable value - I measure after a pin configuration ~1.7 V - how should be the configuration to reach the "full" 3.6 V on the pins of port A.

     

    Could you give a sample?

     

     

    Technical Moderator
    February 15, 2024

    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 ..

     

     

     

    timbo2023Author
    Visitor II
    February 15, 2024

    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?

     

     

     

     

     

     

     

    Graduate II
    February 15, 2024

    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.

    timbo2023Author
    Visitor II
    February 15, 2024

    I measure to the board ...

     

    something went wrong here ...

     

     

     

    Technical Moderator
    February 15, 2024

    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 ..

     

    timbo2023Author
    Visitor II
    February 15, 2024

    I got round about 3.3 V on PA1-3.

    I got round about 1.7 V on PA0.

    Technical Moderator
    February 15, 2024

    @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?

    timbo2023Author
    Visitor II
    February 15, 2024

    Where I can reach the 3.6 V ?

    Technical Moderator
    February 15, 2024

    @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!