Content originally posted in LPCWare by mvinger on Sun Jun 23 09:58:30 MST 2013
Hello Noah.
Thanks for the reply.
I am using the lp800_driver_lib and the CMSIS_CORE_LPC8xx.
SystemInit is initializing the PLL using the 12MHz IRC as an input and MSEL = 4 (M=5) and PSEL = 1 (P=2) which produces a 12MHz * 5*(2*2) = 240MHz FCCO clock and the PLL output clock is 240MHz/(2*2) = 60MHz.
The SYSAHBCLKDIV register is set to 2. Thus the system clock is 60MHz/2 = 30MHz. The SystemCoreClockUpdate confirms this with SystemCoreClock = 60,000,000.
UARTInit/UARTClock_Init set UARTCLKDIV to 1 and UARTSysClk is calculated at 30,000,000.
BRG is then set at 15 (divide UARTSysClk by 16).
UARTFRGMULT is then set for 4.
The UARTInit function does not get as close to 115200 as you have (I may tweak it now that I see its inefficiency) but it gets to 115384.
Still, all of my input and output baudrates are actually doubled.
MTV2