s3c2440中,UBRDIVn=(取整)( 源时钟 / (波特率×16 ) ) -1, 为什么波特率要乘以16?
答案:2 悬赏:30 手机版
解决时间 2021-02-06 10:17
- 提问者网友:咪咪
- 2021-02-05 19:22
s3c2440中,UBRDIVn=(取整)( 源时钟 / (波特率×16 ) ) -1, 为什么波特率要乘以16?
最佳答案
- 五星知识达人网友:走死在岁月里
- 2021-02-05 20:39
你看s3c2440芯片资料第352页
UART BAUD RATE DIVISOR REGISTER
There are three UART baud rate divisor registers including UBRDIV0, UBRDIV1 and UBRDIV2 in the UART
block.
The value stored in the baud rate divisor register (UBRDIVn), is used to determine the serial Tx/Rx clock rate
(baud rate) as follows:
UBRDIVn = (int)( UART clock / ( buad rate x 16) ) –1
( UART clock: PCLK, FCLK/n or UEXTCLK )
译:该值存储在波特率除数寄存器(UBRDIVn)中,用于确定串行Tx / Rx时钟频率 (波特率)
UBRDIVn很有意思吧 就是设置波特率的一个寄存器 比如要波特率位115200,但是不能直接把值115200放进去去 因为UBRDIVn就15位 最大最大就是32768 塞不下~
For example, if the baud-rate is 115200 bps and UART clock is 40 MHz, UBRDIVn is:
UBRDIVn = (int)(40000000 / (115200 x 16) ) -1
= (int)(21.7) -1 [round to the nearest whole number]
= 22 -1 = 21
通过已知的时钟和想要的波特率就可以算出UBRDIVn应该放多大的数值
至于为什么要*16 这应该是硬件规定的 别太较真朋友~
UART BAUD RATE DIVISOR REGISTER
There are three UART baud rate divisor registers including UBRDIV0, UBRDIV1 and UBRDIV2 in the UART
block.
The value stored in the baud rate divisor register (UBRDIVn), is used to determine the serial Tx/Rx clock rate
(baud rate) as follows:
UBRDIVn = (int)( UART clock / ( buad rate x 16) ) –1
( UART clock: PCLK, FCLK/n or UEXTCLK )
译:该值存储在波特率除数寄存器(UBRDIVn)中,用于确定串行Tx / Rx时钟频率 (波特率)
UBRDIVn很有意思吧 就是设置波特率的一个寄存器 比如要波特率位115200,但是不能直接把值115200放进去去 因为UBRDIVn就15位 最大最大就是32768 塞不下~
For example, if the baud-rate is 115200 bps and UART clock is 40 MHz, UBRDIVn is:
UBRDIVn = (int)(40000000 / (115200 x 16) ) -1
= (int)(21.7) -1 [round to the nearest whole number]
= 22 -1 = 21
通过已知的时钟和想要的波特率就可以算出UBRDIVn应该放多大的数值
至于为什么要*16 这应该是硬件规定的 别太较真朋友~
全部回答
- 1楼网友:想偏头吻你
- 2021-02-05 22:10
你好!
16倍的分频采样,所以要乘以16。
仅代表个人观点,不喜勿喷,谢谢。
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯