Forum: Mikrocontroller und Digitale Elektronik STM32 Usart Clock Source


von T. F. (sar)


Lesenswert?

Hallo,

Ich probiere auf dem STM32F334 die USART2 vom HSI takten zu lassen:
1
    PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_USART2;
2
    PeriphClkInit.Usart2ClockSelection = RCC_USART2CLKSOURCE_HSI;
3
    HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit);

Leider stimmte die Baudrate danach nicht und ich habe weiter gesucht:
1
  UART_ClockSourceTypeDef clocksource = UART_CLOCKSOURCE_UNDEFINED;
2
  __HAL_UART_GETCLOCKSOURCE(&huart2, clocksource);

wobei clocksource dann UART_CLOCKSOURCE_PCLK1 ist.

Gibt es was zu beachten wenn ich die Clocksource auf HSI einstellen 
will?

Danke

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.