element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Connector Technology & Design
  • Technologies
  • More
Connector Technology & Design
Forum 学USB的一点心得
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Connector Technology & Design to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 0 replies
  • Subscribers 128 subscribers
  • Views 86 views
  • Users 0 members are here
Related

学USB的一点心得

YYD
YYD over 14 years ago

1、目标:用USB取代232。
      原因:1、提高速度,2、适应没有232的电脑笔记本,3、上档次。
   
    2、知识点:
        1、USB协议,比起232协议难多了,需要数字通信的基础,难。
        2、USB接口器件的硬件知识和编程,硬件易懂,编程难。  
        3、PC的驱动程序和编程。编驱动极难,厂商通常提供,仅特殊情况时要自己编。编程用API函数,通常有VC的例子,较难。
   
    3、方案:
      1、买世面上出售的232<=>USB线,>100RMB。好处是不用任何学习,但速度提高不多。用的是一个USB-232的片子,软件是安装一个驱动,就会多出一个Com3来,实际上也就是USB,然后你照操作普通串口的方式去操作它就很容易了。
        2、用一个USB-232的芯片自己作,比如FTDI公司的FTDI232A。大量应用才有必要。
        3、用其他的USB芯片,那么PC端的程序一定要改动,但是速度可以做得很高。USB芯片分两类,一种内含MCU例如EZ—USB,另一种不含MCU例如PDIUSBD12。后一种的开发费用低。线路板一般需要改动,单片机的程序一般也要改。   
   
    4、我的方案:
      将d12+89C52放在一个小线路板上,用以取代MAX232。好处是可以塞进现用的机箱(^_^我的机箱大),并可以继续使用光藕隔离。原有线路板就不用改动了,单片机的程序也不用改(我把串口速率提高为128000)。 PC那里用软件调用一个DLL(周立功公司作的,速度15KB/s),仅仅四个函数,很简单的。速度(下行)达到8KB/s,够我用的。试验已经成功了,马上要去做板了。××谁想要的话告诉我,我可以顺便多作几个。你自己焊上元件就能用它当个试验板,不过体积小,用起来不一定舒服。
   
    5、速度:
      对于USB来说8KB/S的速度是很慢的,USB1.1版速度可达900KB/s。但是对于89C52的串口来说,这已经很快了(如果是上行难度更大),如果不涉及到串口,89C52(24MHZ)的通信速度至少可达80KB/s。想再快就要用其他的MCU,比如AVR的8515。PC机那边要用API函数来作,或者干脆自己用API写一个DLL出来,这样以后使用比较方便。
   
    6、价格:
      D12要20元,89C52要8元,两个晶振(6M、24M),几个小电阻,几个小电容,一根USB线,一块板,合计大约50元,同时少用一个MAX232和串口线可以省去几元。如果我当年把D12设计到我的大线路板上价格会更低一些,当然使用一个同MCU控制他的的代码要增加4K。D12的价格较低且开发设备费低,所以我选它,但是它的PCB封装在PROTEL里没有,要自己画。
   
    7、隔离:
      我的方案最大的好处是隔离,因为用串口传输仅仅要两个光藕,同时小板上的器件由USB供电,两板之间完全电气隔离。
   
    8、即插即用:
      我的设计仍要用驱动,虽然仅仅安装一次,但仍不够酷。其实可以用HID技术,来实现即插即用,速度可达64KB/S,USB键盘、USB鼠标就用的此技术。等我以后有空时,自己写一个基于HID的DLL,用起来岂不很酷。
   
    9、难度:
      USB开发涉及的相关知识很多,所以难度较大。以我自己的D12开发为例,需要数字通信,VC++6.0编程,89c51的C编程,API,多线程,等知识。
   
    10、工具:
    (1)、一块 USB SMART 开发板
    (2)、操作系统Windows 98以上
    (3)、要求安装VC++ 6.0 和 DDK

  • Sign in to reply
  • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube