2017-08-25 07:34 AM
Hi,
i'm using stm32 nucleo board. The oscillator is configured to 32MHz speed.
Now, if i use the easy following code in the main:while(1)
{
HAL_GPIO_WritePin(LD2_GPIO_Port, LD2_Pin, 1);
HAL_GPIO_WritePin(LD2_GPIO_Port, LD2_Pin, 0);}
the frequency i measure on the LD2 pin is only 750KHz. This is really strange, i expect
to run more quick than 750KHz only.Can someone help me?
2017-08-25 07:39 AM
Confirm what the CPU is running at internally. Internal clocks can be output via PA8 MCO pin.
Use a lighter abstraction. Use optimization
Use GPIO BSRR register in a direct write approach
>>stm32 nucleo board
That narrows the list to a 50+ boards, care to be more precise?
2017-08-25 07:46 AM
The board is a Nucleo L053R8. How can i send output frequency on PA08?
2017-08-25 08:02 AM
The HAL code favours portability at the expense of speed which is the purpose of the LL (low layer).
Get LL cube examples from nucleo or discovery boards.
2017-08-25 10:09 AM
Seek out the MCO examples in your chosen library. Review RCC registers in IDE of choice to confirm PLL and clock source settings.
For PA8 driving via BSRR
while(1)
{
GPIOA->BSRR = (1 << 8);
GPIOA->BRR = (1 << 8);
}
Better to drive pin with a TIM
2017-09-12 05:15 AM
thanks everybody