2024-02-15 04:53 AM - last edited on 2024-02-15 08:52 AM by SofLit
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
2024-02-15 07:05 AM - edited 2024-02-15 07:11 AM
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 ..
2024-02-15 07:17 AM - edited 2024-02-15 07:18 AM
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?
2024-02-15 07:27 AM
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.
2024-02-15 07:31 AM
2024-02-15 07:34 AM - edited 2024-02-15 07:35 AM
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 ..
2024-02-15 07:36 AM
I got round about 3.3 V on PA1-3.
I got round about 1.7 V on PA0.
2024-02-15 07:37 AM
Where I can reach the 3.6 V ?
2024-02-15 07:39 AM
@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?
2024-02-15 07:41 AM - edited 2024-02-15 07:41 AM
@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!
2024-02-15 07:43 AM
>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.