[LPC55xx] SYSCON->FLEXFRGXCTRL & CLOCK_GetFlexCommClkFreq

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

[LPC55xx] SYSCON->FLEXFRGXCTRL & CLOCK_GetFlexCommClkFreq

558 Views
Gorvak
Contributor II

Hmmm, it seems that my post body has disappeared upon posting and an unexpected error.

I shall try again and be more brief in case it timed out.

SYSCON->FLEXFRGXCTRL[0] = SYSCON_FLEXFRG0CTRL_MULT(18) | SYSCON_FLEXFRG0CTRL_DIV(255);

SYSCON clock is 12Mhz (FRO12Mhz), I expect the above to give me 18/256 divisor, so 1.0703125, or 12.84375Mhz, is the correct?

If I call CLOCK_GetFlexCommClkFreq(0) I get 631578, why is this? This does not seem correct.

If I don't configure FLEXFRGXCTRL (use default values), I get 12000000, which is the expected value.

If I setup FC0 as USART, and set USART0->BRG to 12 then I can communicate happily at 57600 which suggests that my maths is correct? (although I might be off by 1 somewhere?)

 

 

Labels (1)
0 Kudos
0 Replies