RS232

RS232的最大的传输速率大约10KBytes/s。

全双工工作方式,异步。数据是8位作为一块来发送的,先发送最低位,最后发送最高位。

在232通信中:

  1. Both side of the cable agree in advance on the communication parameters (speed, format...). That's done manually before communication starts.
  2. The transmitter sends "idle" (="1") when and as long as the line is idle.
  3. The transmitter sends "start" (="0") before each byte transmitted, so that the receiver can figure out that a byte is coming.
  4. The 8 bits of the byte data are sent.
  5. The transmitter sends "stop" (="1") after each byte.

通信中有关时钟速率能不能设置成任意速率的问题,答案是不能,只能设置特定的速率。

  • 1200 bauds.
  • 9600 bauds.
  • 38400 bauds.
  • 115200 bauds (usually the fastest you can go).
At 115200 bauds, each bit lasts (1/115200) = 8.7µs. If you transmit 8-bits data, that lasts 8 x 8.7µs = 69µs. But each byte requires an extra start and stop bit, so you actually need10 x 8.7µs = 87µs. That translates to a maximum speed of 11.5KBytes per second.

At 115200 bauds, some PCs with buggy chips require a "long" stop bit (1.5 or 2 bits long...) which make the maximum speed drop to around 10.5KBytes per second.


就是说在115300的波特率下,有的电脑最大的速度可能是11.5KBytes/s或者10.5KBytes/s.

电压所代表的值:

  • "1" is sent using -10V (or between -5V and -15V).
  • "0" is sent using +10V (or between 5V and 15V).

为了最容易的产生波特率1.8432Mhz的晶振是个好的选择,当除以16就是115200hz。

有关波特率的计算方法:

假如,手上的板子上晶振2M,想要115200的波特率,那在FPGA上的实现方法是先计算出tick多少次,2000000/115200次,这个式子表示的就是分频多少次(从2M变成115200要进行多少分频,就是原先的时钟变换多少次,现在的始终才变换一次)。然后简化出1024/59次,出现1024后较方便实现。

reg [10:0] acc;   // 11 bits total!

always @(posedge clk)
  acc <= acc[9:0] + 59; // use only 10 bits from the previous result, but save the full 11 bits

wire BaudTick = acc[10]; // so that the 11th bit is the carry-out

在用上位机打开串口的时候,发送端会有1.5s的低电平,然后恢复成高电平。


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值