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

    timbo2023Author
    Visitor II
    February 15, 2024

     

    I thought 3.6 V are possible?

     

    PA0 ~ 1.7 V  (?!?)

    PA1 ~ 3.2 V

    PA2 ~ 3.2 V

    PA3 ~ 3.2 V

     

    The 5V-pin, are there any access?

    Technical Moderator
    February 15, 2024

    If PA0 is connected to something (as shown by your photo), please disconnect it and let it floating and measure the voltage level on this pin. If it goes to 3.3V it does mean there is something wrong on the other side forcing the pin to go to 1.7V!

    3.2V level as output pin is correct.

    timbo2023Author
    Visitor II
    February 15, 2024

    ?! ok ?!

     

    I just thought that I red something to connect ADC-devices to get the "full" 4.x V USB-power...from the 5 V-pin, too.

     

    timbo2023Author
    Visitor II
    February 15, 2024

    Is it possible to get the "full" USB Power on a pin?!

    Technical Moderator
    February 15, 2024

    You didn't answer any of our questions and you continue to ask more.. Sorry no one can help you that way!

    timbo2023Author
    Visitor II
    February 15, 2024

    Attached - my situation ...

     

    My aim is to have at least 3.3 - or more - voltage on PA0 ...

     

     

    Technical Moderator
    February 15, 2024

    My answers:

    1. Disconnect any load from PA0 for test
    2. Use the HAL as I suggested previously and try to toggle PA0.. If it does work and you reach 3.3V move to the direct access to registers like you do. If you still at 1.7V using HAL I suspect an issue on PA0 pin. So change the MCU or the board. You're using BlackPill: I cannot consider it's something guaranteed!

    To have more than 3.3V as output:

    • Use a voltage level shifter as suggested by AScha.3 
    • Or configure the pin in open drain and connect a pull-up resistor between the pin and 5V. The pin must be five volt tolerant: FT). But here you need to take care about the slopes of your signal you need to output on the pin and the load to connect to it.

    Hope it does answer your question.

    timbo2023Author
    Visitor II
    February 15, 2024

    very tough - SofLit and - in look to the separate solution - Ascha.3

     

    I will try both suggested solutions and compare it in a more scientifically way in the future...

     

    But for now, that was my actual discussion aim for today:

    "configure the pin in open drain and connect a pull-up resistor between the pin and 5V. The pin must be five volt tolerant: FT). But here you need to take care about the slopes of your signal you need to output on the pin and the load to connect to it."

     

    Is it possible to get for this case - a bare metal snippet in look to the A-Pin configuration?

     

    Thank you in advance for your "input"...

     

    timbo2023Author
    Visitor II
    February 15, 2024

    @AScha.3 

     

    Are you expert in look to an external motivated solution in amplifying signals in this "voltage size"?

    I have an operational amplifier MCP6002 with an external voltage source of 9V (block) at home.

    When I use this operational amplifier as non-inverted amplifier, is it possible to realize an amplification in this "size" and in an external circle?

     

    Super User
    February 15, 2024

    Basically yes, is possible. But a bad idea - opamp is slow, compared to the digital switching pins.

    And bringing in now 9V level...risk to damage even the 5V circuit.

    I have the impression, it would shorten the guessing game, if you just show, what you have, what you want to do and which chips/driver is to connect.

    Geht doch um nen Schrittmotortreiber - oder ?

    timbo2023Author
    Visitor II
    February 15, 2024

    Vdd + 4 V --> risk after data sheet ...

     

    I will switch into my broken German, too:

     

    Schrittmotor, "Spannungsangleichung" 0..3.3 V auf 0..~4.5 V

    Externer Kreis oder am/in der Karte ist die Frage -

     

    Kann ich die knapp 5V vom USB nutzen, die ja anliegen oder der Weg zu Schottky über dann die letzte Möglichkeit eines externen Verstärkerkreises...

    timbo2023Author
    Visitor II
    February 15, 2024

    What actually is the big episode with the "schottky-diode"-solutions?!

     

    Is that relevant for this topic, too?

    timbo2023Author
    Visitor II
    February 15, 2024

    Now with the usual calm:

     

    (1) code

     

     

    GPIOA->MODER = 0x55555555;
    	GPIOC->MODER = 0x55555555;
    
    	GPIOA->OSPEEDR |= 0x00000000;
    	GPIOA->PUPDR |= 0x00000000;
    
    	GPIOA->ODR |= (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) | (1 << 4);
    
    	GPIOA->BSRR = 0xFFFF0000;
    
    	GPIOA->ODR|= (1 << 0);

     

     

    see attachment 1

     

    (2) code

     

     

    	RCC->AHB1ENR |= (1 << 0) | (1 << 2);
    
    	TM_DELAY2_Init();
    
    	GPIOA->MODER = 0x55555555;
    	GPIOC->MODER = 0x55555555;
    
    	GPIOA->OSPEEDR |= 0x00000000;
    	GPIOA->PUPDR |= 0x00000000;
    
    	GPIOA->BSRR = 0xFFFF0000;
    
    	GPIOA->BSRR = (1U << 0);

     

     

     

    see attachment 2

     

     

    Now I need a small rise to the USB-voltage-level...

     

    Is that basically possible?

     

     

    timbo2023Author
    Visitor II
    February 15, 2024

    That's my situation - 1,64 V - on load - measured to card -

     

    But I need at least round about 3.6 V ... USB Voltage tap per software possible?

    Graduate II
    February 15, 2024

    >>But I need at least round about 3.6 V ... USB Voltage tap per software possible?

    No, there's no magical connectivity here. Go check the schematic, the 5V goes to a 3.3V regulator powering the STM32. The STM32 doesn't have 3.6V available as a High Level

    Perhaps you've damaged PA0 ? Pressed the Key, shorting out the MCU?

    A photo of the PA0 voltage off the board, and not connected to anything would be more assuring.

    Do you have additional BLACK PILL boards you can sanity check against?

    https://stm32-base.org/assets/pdf/boards/original-schematic-STM32F411CEU6_WeAct_Black_Pill_V2.0.pdf

    Provide schematics of what you've wired, over photos.

    GPIOA->OSPEEDR |= 0x00000000; // Doesn't clear bits, basically does nothing

    GPIOA->OTYPER |= 0xE; // PA1..3 Open Drain, then external pull-ups to 5V via 10K

    A read of the DATA SHEET indicates PA0 is not FT (5V Volt Tolerant), just a standard 3.3V GPIO

    https://www.st.com/en/microcontrollers-microprocessors/stm32f411ce.html

    timbo2023Author
    Visitor II
    February 15, 2024

    Ok - in common I think, that my control voltage is too low. The motor sounds in this way.

     

    In look to the USB voltage, there is no possibility to get this voltage per software?

     

    timbo2023Author
    Visitor II
    February 15, 2024

     

    What actually does VB means?

    Is it possible to give there a voltage input ~5V on the card?