Projekt

Allgemein

Profil

Feature #611

Von Maximilian Seesslen vor 2 Tagen aktualisiert

Need a way to calibrate crystals. Why? CAN had some issues with the STM32F1.
Would need an PWM output.

STM32F103:
Heartbeat LED PA10 is also TIM1_CH3

Beim STM32103 soll das so gehen:
<pre><code class="cpp">
GPIO_InitTypeDef GPIO_InitStruct = {0};

GPIO_InitStruct.Pin = GPIO_PIN_8;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);

HAL_RCC_MCOConfig(RCC_MCO1, RCC_MCO1SOURCE_SYSCLK, RCC_MCODIV_1);
</code></pre>

Bei einem STM32F072 aehnlich:
<pre><code class="cpp">
HAL_RCC_MCOConfig(RCC_MCO, RCC_MCOSOURCE_SYSCLK, RCC_MCODIV_1);
</code></pre>

Zurück