AnsweredAssumed Answered

LPUART on K66F

Question asked by Christie Su on Apr 9, 2019
Latest reply on Apr 10, 2019 by Christie Su

Hi,

 

I am going to use LPUART on K66F and tried the sample code in SDK. I have the following questions:

From sample code:

BOARD_InitPins();

BOARD_BootClockRUN();

CLOCK_SetLpuartClock(1U);

 

/*

* config.baudRate_Bps = 115200U;

* config.parityMode = kLPUART_ParityDisabled;

* config.stopBitCount = kLPUART_OneStopBit;

* config.txFifoWatermark = 0;

* config.rxFifoWatermark = 0;

* config.enableTx = false;

* config.enableRx = false;

*/

LPUART_GetDefaultConfig(&config);

config.baudRate_Bps = BOARD_DEBUG_UART_BAUDRATE;

config.enableTx = true;

config.enableRx = true;

 

LPUART_Init(DEMO_LPUART, &config, DEMO_LPUART_CLK_FREQ);

 

// For clock setting...

const sim_clock_config_t simConfig_BOARD_BootClockRUN =

{

.pllFllSel = SIM_PLLFLLSEL_MCGPLLCLK_CLK, /* PLLFLL select: MCGPLLCLK clock */

.pllFllDiv = 0, /* PLLFLLSEL clock divider divisor: divided by 1 */

.pllFllFrac = 0, /* PLLFLLSEL clock divider fraction: multiplied by 1 */

.er32kSrc = SIM_OSC32KSEL_RTC32KCLK_CLK, /* OSC32KSEL select: RTC32KCLK clock (32.768kHz) */

.clkdiv1 = 0x1140000U, /* SIM_CLKDIV1 - OUTDIV1: /1, OUTDIV2: /2, OUTDIV3: /2, OUTDIV4: /5 */

};

 

 

Based on the above sample code, the input clock for LPUART is 120MHz instead of 60MHz(Max frequency allowed for LPUART based on document).

 

Could you tell me if it is right? Should I change pllFllDiv to 1 to make it 60MHz for LPUART?

 

Thanks,

 

Christie

Outcomes