How to calculate the clock of UART

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

How to calculate the clock of UART

跳至解决方案
1,298 次查看
chengwu
Contributor I

Dear all,

I have an i.MX53 evk board and a standard BSP for the board, now I want to know how to calculate the frequnce of the UART & DDR, for example, there may be some registers in CCM & PLL modules specify the frequence, can anyone tell me what's the registers and how to calculate the frequence? Thank you very much.

标签 (1)
0 项奖励
回复
1 解答
1,133 次查看
AnsonHuang
NXP Employee
NXP Employee

Hi, Chengwu

     You need to read register CCM_CSCMR1[25-24] to see what is the UART's clock source, PLL1 or PLL2 or PLL3 or LPAPM, then you need to read these PLLx's register to see what are their frequence. For PLL, there is formula to calculate their freq, in RM chapter 21.3.2.4. For LPAPM, it should be 24MHz from OSC, you need to see CCM_CCSR[10] to see whether it is from OSC or PLL4. Then you will know what is the freq of UART. But, you need to be aware of there is divider in CCM_CSCDR1 for UART, PRE and PODF, you need to divided both PRE and PODF divider. The BSP should already support reading such clock's rate directly from clk API, clk_get_rate, you can just call it to get UART's rate.

     Same for DDR, first, get its parent's freq, then div by its divider, you can look up register description in CCM chapter.

在原帖中查看解决方案

0 项奖励
回复
3 回复数
1,134 次查看
AnsonHuang
NXP Employee
NXP Employee

Hi, Chengwu

     You need to read register CCM_CSCMR1[25-24] to see what is the UART's clock source, PLL1 or PLL2 or PLL3 or LPAPM, then you need to read these PLLx's register to see what are their frequence. For PLL, there is formula to calculate their freq, in RM chapter 21.3.2.4. For LPAPM, it should be 24MHz from OSC, you need to see CCM_CCSR[10] to see whether it is from OSC or PLL4. Then you will know what is the freq of UART. But, you need to be aware of there is divider in CCM_CSCDR1 for UART, PRE and PODF, you need to divided both PRE and PODF divider. The BSP should already support reading such clock's rate directly from clk API, clk_get_rate, you can just call it to get UART's rate.

     Same for DDR, first, get its parent's freq, then div by its divider, you can look up register description in CCM chapter.

0 项奖励
回复
1,133 次查看
chengwu
Contributor I

Hi,Yongcai Huang

Thank you very much.

0 项奖励
回复
1,132 次查看
AnsonHuang
NXP Employee
NXP Employee

Hi,

     If you do NOT have any question, can you please check the correct answer and close this topic? If you still have question, please let me know.

0 项奖励
回复