Serial communication

Use Moserial Terminal as the serial debug tools. It can be found in the Ubuntu software center.


For Mib520, there are two ports. /ttyUSB0 is used for installing program to the motes, while /ttyUSB1 is used for serial communication. So, when installing, use "allmake micaz install,1 mib520,/dev/ttyUSB0". When communicating with serial port, set the port of Moserial Terminal as "/dev/ttyUSB1" and the default baud rate for TinyOS is 57600.

Moxa是一家做了几十年工业串口卡、串口服务器之类设备的公司,PComm Lite是一套易用性、可靠性久经考验串口编程开发包。相比用API或mscomm控件开发简单太多了。 版本:目前最新版是Version 1.6 Released May 14, 2012 支持XP/win7, 32/64bit的库都有,开发环境支持VC/VB/Delphi。注意可以会搜到另外一个Version 2.6. Released Jul 8, 2008,那是在WIN9x/NT4用的,不要看版本号高下错了。 使用方法:运行安装后有类库、例程、帮助和几个小工具。关键的有四个文件:pcomm.h/pcomm.lib两个文件复制到项目目录并引用,pcomm.dll丢到windows\system32下或跟应用程序放在一起,pcomm.chm帮助备查。 函数介绍:整个库包含50多个函数,最常用的也就10来个: 打开、关闭、设波特率的:sio_open ()、sio_close()、sio_baut() 发送数据的:sio_putch(),sio_write() 接收数据的:sio_getch(),sio_read() 查询输入输出缓冲区状态的:sio_iqueue(), sio_oqueue() 有时可能要设读写超时:sio_SetReadTimeouts(), sio_SetWriteTimeouts() 这些函数见名知义,用法查一下PComm.chm就行了。 编程方法: 接收数据一般免不了要开线程的,在接收线程里sio_iqueue()看一下有没有数据,有就处理,没就Sleep()一会。接收数据时它至少会帮你缓冲几十k,一般也不会丢数据。也可以用sio_term_irq()指定接收一定长数据数据就调用一个CALLBACK函数。 这些基本就齐活了。需要控制DTS/RTS、自动流控制都有,甚至还有Xmoderm/Ymoderm/Zmoderm发送文件。如果要Modbus之类的协议就要自己写了。 与其它串口开发方式比较:简单地说API是基础零件,自己做起来麻烦。MSComm控件、CSerialPort类是实验室产品,Pcomm lite是工业成熟产品。
A fiber optic gyroscope (FOG) is a device that measures angular velocity by detecting changes in the phase of light that is transmitted through a coiled optical fiber. In order to communicate the measurement data from the FOG to a computer or other processing device, a serial communication circuit is typically used. The specific requirements of the serial communication circuit will depend on the particular FOG being used, as well as the requirements of the system in which it is being integrated. However, some general considerations include: 1. Baud rate: The baud rate determines how quickly data can be transmitted between the FOG and the processing device. The baud rate should be selected to ensure that the system can handle the amount of data being transmitted. 2. Data format: The format of the data being transmitted (e.g. ASCII or binary) should be compatible with the processing device. 3. Transmission protocol: The transmission protocol (e.g. RS-232 or RS-485) should be compatible with both the FOG and the processing device. 4. Noise immunity: The circuit should be designed to minimize the impact of noise on the transmitted data, as noise can cause errors in the measurements. 5. Power supply: The circuit should be designed to operate with the appropriate voltage and current levels for the FOG and processing device. 6. Connector type: The connector used to connect the FOG to the processing device should be compatible with both devices and provide a secure and reliable connection. 7. Error detection and correction: The circuit should include measures to detect and correct errors in the transmitted data, such as parity checking or cyclic redundancy checking (CRC). Overall, the serial communication circuit for a fiber optic gyroscope should be designed with a focus on reliability, accuracy, and compatibility with the specific FOG and processing device being used.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值