RS232
RS232的最大的传输速率大约10KBytes/s。
全双工工作方式,异步。数据是8位作为一块来发送的,先发送最低位,最后发送最高位。
在232通信中:
- Both side of the cable agree in advance on the communication parameters (speed, format...). That's done manually before communication starts.
- The transmitter sends "idle" (="1") when and as long as the line is idle.
- The transmitter sends "start" (="0") before each byte transmitted, so that the receiver can figure out that a byte is coming.
- The 8 bits of the byte data are sent.
- 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的低电平,然后恢复成高电平。
版权声明:本文为博主原创文章,未经博主允许不得转载。
最新文章
- WebApi接口 - 响应输出xml和json
- Tor网络突破IP封锁,爬虫好搭档【入门手册】
- js乱码解决方法
- Mac系统安装jdk和maven
- JSON 格式介绍
- NSURLSession的使用(1)
- OFBiz进阶之HelloWorld(五)创建新实体
- java transient关键字和transaction的区别
- WCF 客户端与服务端消息传输
- c++智能指针《一》 auto_ptr
- .Net程序猿玩转Android开发---(7)相对布局RelativeLayout
- erlang证书加密
- my eclipse 端口号被占用问题 Mac上
- 队列queue的一些操作
- 【转载】 禁止国外IP访问你的网站
- SecureCRT 上传下载
- Complete the Word
- 8.rem适配
- jQuery使用cookie与json简单实现购物车功能
- ZT android -- 蓝牙 bluetooth (四)OPP文件传输
热门文章
- [Usaco2013 Jan]Island Travels
- C. Mahmoud and a Message dp + 暴力
- 简单工厂模式及php实现
- 重构29-Remove Middle Man(去掉中间人)
- 田字格布局html div
- 合并百度影音的离线数据 with python 第二版 基于yield
- 今天被 <;!doctype html>; 搞了两个小时,两个页面同样的样式,chosen右边的小箭头,一个上下居中对齐 一个居顶对齐。最后找到问题所在doctype
- E. Wrong Answer
- python 双冒号
- [转载]MyBatis mapper文件中的变量引用方式#{}与${}的差别