为了把测温数据传送到主机,传统的方法是利用RS 232或RS 485总线与主机通信。但由于这些接口传输速度慢,近年来,逐步被USB接口所取代。目前USB成为PC机的标准接口已经是大势所趋,在主机(host)端,目前推出的PC机几乎100%支持USB。鉴于此,本文采用CYGNAL公司的支持全速USB 2.0的微控制器C8051F320。该单片机是完全集成的混合信号系统级芯片(SOC),具有与C8051完全兼容的CIP51内核,与MSC-51指令集完全兼容。片内集成了数据采集和控制系统中常用的模拟、数字外设及其他功能部件;内置FLASH程序存储器、内部RAM以及外部数据存储器RAM。微控制器C8051F320带有USB接口,其功能控制模块符合USB 2.0规范,可在全速或低速下运行,并具有1 kB USB缓存、集成收发器,无需外部电阻。
In order to transmit the temperature data to the host, the traditional method is to communicate with the host using the RS 232 or RS 485 bus. However, these interfaces have been gradually replaced by the USB interface in recent years because of the slow transmission speed. At present, USB has become the general trend of PC's standard interface. At the host (host) side, almost 100% of the current PC machines support USB. In view of this, this article uses the CYGNAL company to support the full speed USB 2 micro controller C8051F320. The single chip is a fully integrated hybrid signal system level chip (SOC), which is fully compatible with the C8051 CIP51 kernel and is fully compatible with the MSC-51 instruction set. The chip is integrated with analog, digital peripherals and other functional components commonly used in data acquisition and control system, built-in FLASH program memory, internal RAM and external data memory RAM. The microcontroller C8051F320 has USB interface. Its function control module conforms to the USB 2 specification. It can operate at full speed or low speed, and has 1 kB USB buffer and integrated transceiver without external resistance.