FTDI通用转USB芯片简述
FTDI公司的FT2232系列芯片可实现USB与异步串行口RS232/RS485、同步串行总线IIC/SPI/JTAG相互通信,市场占有率,使用普遍。
FTDI芯片有两种类型的驱动:virtual COM port driver (VCP)和D2xx。VCP就是常用的U转串COM驱动,实现USB到虚拟串口功能,应用于异步RS232/RS485与USB间通信,linux设备文件为/dev/ttyUSBx;D2XX应用于同步串行总线IIC/SPI/JTAG与USB间通信,整个驱动框架都有FTDI公司提供。
COM驱动
linux支持FTDI公司的VCP驱动需配置内核:
Device Drivers --->
[*] USB support --->
<M> USB Serial Converter support --->
<M> USB Prolific Single Port Serial Driver
<M> USB FTDI Single Port Serial Driver
Prolific和FTDI是常用的USB转串口芯片厂商。通用模块usbserial.ko,prolific公司的模块pl2303.ko,ftdi公司的模块ftdi_sio.ko
[ 1.771996] usbcore: registered new interface driver usbfs [ 1.777600] usbcore: registered new interface driver hub [ 1.782975] usbcore: registered new device driver usb [ 3.227325] usbcore: registered new interface driver usb-storage [ 3.331190] usbcore: registered new interface driver bcm203x [ 3.336872] usbcore: registered new interface driver bfusb [ 3.342381] usbcore: registered new interface driver btusb [ 3.347893] usbcore: registered new interface driver ath3k [ 3.496381] usbcore: registered new interface driver usbhid [ 3.501958] usbhid: USB HID core driver [ 58.132670] usb -: new full-speed USB device number using xhci-hcd [ 58.314580] usbcore: registered new interface driver usbserial [ 58.316675] usbcore: registered new interface driver pl2303 [ 58.316707] usbserial: USB Serial support registered for pl2303 [ 58.317386] usb -: pl2303 converter now attached to ttyUSB0 [ 289.400405] usb -: USB disconnect, device number
或
[ 1.774779] usbcore: registered new interface driver usbfs [ 1.780377] usbcore: registered new interface driver hub [ 1.785752] usbcore: registered new device driver usb [ 3.230535] usbcore: registered new interface driver usb-storage [ 3.334244] usbcore: registered new interface driver bcm203x [ 3.339930] usbcore: registered new interface driver bfusb [ 3.345439] usbcore: registered new interface driver btusb [ 3.350951] usbcore: registered new interface driver ath3k [ 3.495753] usbcore: registered new interface driver usbhid [ 3.501362] usbhid: USB HID core driver [ 3.643788] usb -: new high-speed USB device number using xhci-hcd [ 7.070296] usbcore: registered new interface driver usbserial [ 7.099899] usbcore: registered new interface driver ftdi_sio [ 7.099925] usbserial: USB Serial support registered for FTDI USB Serial Device [ 7.100046] usb -: Detected FT2232H [ 7.100439] usb -: FTDI USB Serial Device converter now attached to ttyUSB0 [ 7.100539] usb -: Detected FT2232H [ 7.100667] usb -: FTDI USB Serial Device converter now attached to ttyUSB1 [ 86.423288] usb -: USB disconnect, device number
插入USB设备会在/dev/ttyUSBx文件出现,可像操作普通的串口文件/dev/ttySx一样操作,采用通用termios编程。
D2XX驱动
在linux中VCP和D2XX驱动是不兼容的,当D2XX驱动应用前应卸载VCP驱动模块:
sudo rmmod ftdi_sio
sudo rmmod usbserial
实际测试中采用D2XX驱动时系统会自动卸载VCP驱动。
D2XX驱动协议栈如下图,D2XX驱动libftd2xx.tar.gz可在如下页面下载:https://www.ftdichip.com/Drivers/D2XX.htm,或者直接在系统下apt安装(可能需要libusb-dev):
apt install libftdi-dev
在D2XX驱动之上是libmpsse,即MPSSE库。Multi Protocol Synchronous Serial Engine(MPSSE)是一个通用的同步总线如I2C、SPI或JTAG通信库,用于FT2232D、FT2232H、FT4232H和FT232H芯片通过USB与PC或ARM通信。MPSSE基于D2XX设计。


D2XX应用
lora gateway就应用了D2XX驱动,将SPI接口转化为U口与主服务器(X86或ARM)通信,开源库:https://github.com/yuxi-o/RAK833-LoRaGateway-RPi或https://github.com/Lora-net/lora_gateway.git。
参考:
1. https://www.ftdichip.com/Support/Documents/AppNotes.htm
4. FTDI Drivers Installation Guide for Linux
5. User Guide For LibMPSSE-SPI
FTDI通用转USB芯片简述的更多相关文章
- usb芯片调试经验
记录一下调试usb有关的芯片的一些经验. 1.有i2c的芯片.一般有i2c的地址选择. 检查地址选择是否正确,地址是多少.SCL和SDA上面是否有上拉电阻. 芯片的地址是几位的.I2c的时钟频率也是必 ...
- windows xp 连接USB网络打印机服务器(通用所有usb网络打印机服务器的安装)
usb网络打印机服务器是HP1101U 打印机是 hp1108 需要准备的其他东西:1.HP1108的驱动 首先,接好线,保证usb hp1101u能正常访问,这款USB一旦接入了网络,会分配一个ip ...
- CYPRESS USB芯片win10驱动
The ZIP file attached with this knowledge base article contains the CyUSB3.inf and CyUSB3.sys files ...
- USB2.0学习笔记连载(三):通用USB驱动程序解析
对于USB驱动的开发,读者可以使用Windows DDK.DriverStudio等多种开发工具来实现USB的驱动,但是驱动程序的开发过程都比较复杂,而且很容易致使USB主机内存泄露而死机.那么对于笔 ...
- USB Keyboard Recorder
catalogue . 引言 . Device Class Definition for Human Interface Devices (HID) . USB HID Report Descript ...
- USB入门
简述 USB(Universal Serial Bus)全称通用串口总线,USB为解决即插即用需求而诞生,支持热插拔.USB协议版本有USB1.0.USB1.1.USB2.0.USB3.1等,USB2 ...
- USB接口介绍
USB设备系统分为两个部分,USB Host端和USB Device端,以USB接口的U盘为例子,U盘自身是一个USB Device,PC机的USB接口以及相关的控制电路为USB Host部分 ...
- Linux usb子系统(一):子系统架构
一.USB协议基础知识 前序:USB概念概述 USB1.0版本速度1.5Mbps(低速USB) USB1.1版本速度12Mbps(全速USB) USB2.0版本速度480Mbps(高速USB). ...
- USB Mass Storage大容量存储的基本知识
http://www.crifan.com/files/doc/docbook/usb_disk_driver/release/htmls/ch02_msc_basic.html 目录 2.1. US ...
随机推荐
- Web用户控件开发--星型评分控件
本文中分享一个实现简单,使用方便的星型评分控件. 一:贴几张测试图片先: 二.星型评分控件的实现: RatingBar.ascx: <%@ Control Language="C#&q ...
- 【转载并整理】ORACLE锁机制
转载文章:http://blog.csdn.net/liuyiy/article/details/25005393 转载文章:http://www.cnblogs.com/jiyuqi/p/37017 ...
- 常用代码之五:RequireJS, 一个Define需要且只能有一个返回值/对象,一个JS文件里只能放一个Define.
RequireJS 介绍说一个JS文件里只能放一个Define,这个众所周知,不提. 关于Define,它需要有一个返回值/对象,且只能有一个返回值/对象,这一点却是好多帖子没有提到的,但又非常重要的 ...
- mysql存储过程批量向表插入数据
业务需要,往某个表中批量插入数据,使用存储过程插入 首先,要建立一张mysql表,表明为phone_number, 三个字段,id 自增,number 就是要插入的表格,is_used 表示十分已经使 ...
- MySql计算两个日期的时间差函数
MySql计算两个日期时间的差函数: 第一种:TIMESTAMPDIFF函数,需要传入三个参数,第一个是比较的类型,可以比较FRAC_SECOND.SECOND. MINUTE. HOUR. DAY. ...
- struts2:在Action中使用Servlet的API,设置、读取各种内置对象的属性
有两种方式可以实现在Action中使用Servlet的API.一种是使用org.apache.struts2.ServletActionContext类,另一种是使用com.opensymphony. ...
- hdu 2680 Choose the best route (dijkstra算法)
题目:http://acm.hdu.edu.cn/showproblem.php?pid=2680 /************************************************* ...
- 菜鸟教程之工具使用(四)——借助JRebel使Tomcat支持热部署
JRebel是一个J2EE热部署的工具.使用它可以减少浪费8-18%的开发时间在项目的构建和部署上.虽然Java也提供了HotSpot的JVM,但是如果你修改的类中有方法名称变动的话,HotSpot就 ...
- 菜鸟学Java(二十一)——如何更好的进行单元测试——JUnit
测试在软件生命周期中的重要性,不用我多说想必大家也都非常清楚.软件测试有很多分类,从测试的方法上可分为:黑盒测试.白盒测试.静态测试.动态测试等:从软件开发的过程分为:单元测试.集成测试.确认测试.验 ...
- 谷歌Chrome浏览器小于12px字号显示的BUG
webkit的私有属性:html{-webkit-text-size-adjust:none;}