Universal Serial Bus (USB) is a new generation bus interface standard jointly launched by seven world-renowned computer and communication companies, including Intel, Compaq, Digital, IBM, Microsoft, NEC, and Nerthern Telecom. As a high-speed communication interface between PCs and peripherals, USB has the advantages of flexible connection, hot pluggability, one interface suitable for multiple devices, high speed (USB1.1 protocol supports 12Mb/s, USB2.0 protocol supports 480Mb/s), automatic configuration, no need to locate and run installation programs, power supply for peripherals, low power consumption, low cost, high reliability, etc., so it is widely used in digital cameras, portable instruments, portable storage devices and other products.
However, the development of USB interfaces generally requires designers to have a deep understanding of USB standards, firmware programming and driver writing, which limits the development and use of USB interface products by general hardware engineers. The USB interface chip CH371 we use in the portable wireless meter reading system is easy to use, has excellent performance and is low in price. As long as a general hardware engineer is familiar with microcontroller programming and simple VB or VC application programming, he can easily develop the corresponding USB product in a very short period of time.
1 Introduction to the USB bus universal interface chip CH371
CH371 is a universal interface chip for USB bus, as shown in Figure 1. On the local side, CH371 has an 8-bit data bus and read, write, chip select control lines and interrupt output, which can be easily connected to the system bus of microcontrollers, DSP and other controllers. In the computer system, the supporting software of CH371 provides a simple and easy-to-use operation interface. Communicating with the local microcontroller is like reading and writing files on the hard disk. CH371 shields all protocols in USB communication and provides end-to-end connection between the computer application layer and the local controller. Using CH371, you can easily upgrade parallel and serial port products to USB interface without understanding any USB protocols or firmware programs, or even drivers. It has the following features:
*Shields the USB protocol and provides an end-to-end connection between the computer application layer and the local end.
*Two communication modes: one-way data flow mode, request plus response mode, support pseudo interrupt.
*Automatically complete the USB configuration process without any processing by the local controller.
*Standard USB V1.1 interface, plug and play, D+ pin built-in pull-up resistor.
* Built-in 4 endpoints, supporting USB control transfer, bulk transfer, and interrupt transfer.
* Generic Windows driver, providing device-level interface and application-layer interface.
*Universal local 8-bit data bus, 4-wire control, i.e. read enable, write enable, write select input, interrupt output.
* Occupies 16 addresses, and can choose direct address mode or multiplexed address mode.
* Built-in input and output buffer, which notifies the local controller to transmit data in interrupt mode.
*Built-in hardware-implemented I2C master interface, the application layer can directly read and write external I2C slave devices.
* In master control mode, it can provide 16 input signal lines or 12 independently controlled output signal lines.
* Built-in power-on reset, providing high-level active reset output and low-level active reset output.
* Built-in optional watchdog circuit Watch-Dog to provide monitoring for the local controller. [page]
2 Hardware design based on CH371 USB interface
Figure 2 shows a simplified diagram of the hardware interface between CH371 and MCU. The hardware connection of MCU AT89C52 is relatively simple, mainly because there are no special requirements in the design of the system, such as the selection and connection of the crystal oscillator and the reset circuit, and the reset of CH371 can completely use the reset signal generated by the reset circuit of the single-chip microcomputer. The function of the serial EEPROM 24C01 with I2C interface is to store the product's VID, PID, device serial number and other information. As long as the address is different, multiple peripheral chips with I2C interface can be connected. Users can use the functions of the dynamic link library provided to easily complete the reading and writing of the serial EEPROM. In the system design, there can also be no EEPROM. CH371 will use the default VID, PID, product descriptor and power descriptor, and there is no device serial number.
It should be noted that: it is best to connect a 100μF electrolytic capacitor and a 0.1μF monolithic or ceramic capacitor between 1 and 4 of the USB connector; the shell of the 12MHz crystal oscillator is best grounded; the impedance matching resistor is 80Ω~150Ω.
3. Information transmission software implementation process
The simplified flow chart of the lower computer data upload subroutine is shown in Figure 3.
The interrupt service program flow of the lower computer is shown in Figure 4.
Conclusion
From the current practical application, the system design is successful. In particular, the USB interface based on CH371 has the characteristics of simple hardware design, easy software programming, low cost, fast transmission rate, and high reliability. I believe that there will be more and more new USB interface products based on CH371.
Previous article:CAN bus isolation expansion design based on serial peripheral interface (SPI)
Next article:MCS-51 single chip computer address pointer and its application
- Popular Resources
- Popular amplifiers
- 西门子S7-12001500 PLC SCL语言编程从入门到精通 (北岛李工)
- Siemens Motion Control Technology and Engineering Applications (Tongxue, edited by Wu Xiaojun)
- MCU C language programming and Proteus simulation technology (Xu Aijun)
- 100 Examples of Microcontroller C Language Applications (with CD-ROM, 3rd Edition) (Wang Huiliang, Wang Dongfeng, Dong Guanqiang)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- 46% of open source maintainers are unpaid, and 26% earn more than $1,000 per year
- How to start learning analog electronics
- I would like to ask about the AMS1117 and LM2596S chips
- Why are all villains so stupid?
- Pipeline Leakage Monitor Based on Sound Waves
- See good people and emulate them, Zhu Ge is full of positive energy^_^
- [Mil MYS-8MMX] Mil MYS-8MMQ6-8E2D-180-C Unpacking Report 2 - Power on
- MSP430 MCU timer TA interrupt program
- Free review: Domestic FPGA Anlu SparkRoad development board
- Replaying MicroPython on STM32F7DISC - DCExpert