set main clock for using UART at 921600 bps

UART baud rate is main clock (MCK) divided by CR*16.
The MCK values are chosen >= 48 MHz and <= 64 MHz to have a near
integer value CR for a baud rate of 921600 bps.
The end MCK frequency between simtrace and qmod differ slightly
but are close to 58 MHz.

Change-Id: Iaa4a97fc68494c93b9d128503515d88049de506c
This commit is contained in:
Kévin Redon
2018-08-28 19:13:06 +02:00
parent e07640c35a
commit e2b0f971e5
5 changed files with 31 additions and 25 deletions

View File

@@ -26,8 +26,10 @@
/* Board definition */
#define simtrace
/* Board main oscillator frequency (in Hz) */
/** oscillator used as main clock source (in Hz) */
#define BOARD_MAINOSC 18432000
/** desired main clock frequency (in Hz, based on BOARD_MAINOSC) */
#define BOARD_MCK 58982400 // 18.432 * 16 / 5
/** Pin configuration **/
/* Button to force bootloader start (shorted to ground when pressed */