The equation to calculate the UARTDM Baud Rate is as follows:
Baud rate = 1/16 * Input clock rate * 1/CSR Value,
Input clock rate= Source clock rate * (M/N) * (1/P) where P = 1, 2 or 4.
P is the value in UART2DM_NS_REG[4:3]
M, N can be derived from the registers UART2DM_MD_REG and UART2DM_NS_REG respectively.
For a CSR= 0xFF, CSR Value = 1; for CSR = 0xEE, CSR Value = 2.
For a CSR= 0xDD, CSR Value = 3; for CSR = 0xCC, CSR Value = 4.
For a CSR= 0xBB, CSR Value = 6; for CSR = 0xAA, CSR Value = 8.
For a CSR= 0x99, CSR Value = 12; for CSR = 0x88, CSR Value = 16.
For a CSR= 0x77, CSR Value = 24; for CSR = 0x66, CSR Value = 32.
For a CSR= 0x55, CSR Value = 48; for CSR = 0x44, CSR Value = 96.
For a CSR= 0x33, CSR Value = 192; for CSR = 0x22, CSR Value = 384.
For a CSR= 0x11, CSR Value = 768; for CSR = 0x00, CSR Value = 1536.
For Eg.: for a baud rate of 4Mbps, Input Clock Rate= 16 * 4 MHz * 1 (CSR = 0xFF) = 64MHz. We just need to calculate the input clock rate without bothering about the M, N, P values. These values have already been configured to achieve a given input clock rate.
The file clkrgm_bsp_xxxx.c (eg. clkrgm_bsp_7627.c) has different values of input clock rates which can be selected to achieve a given baud rate. If a particular input clock rate is not specified in this file, then please open a case with the Modem Clock team for that input clock rate to be added to the list of clock rates supported.
No comments:
Post a Comment