Application of USB interface based on CH371 in portable wireless meter reading system

Publisher:水手谷水手Latest update time:2012-07-18 Source: 21ic Keywords:CH371  USB Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1 Introduction

USB (Universal Serial Bus) 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 Northern 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 12Mbps, USB2.0 protocol supports 480Mbps), 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 interface generally requires designers to have a deep understanding of USB standards, firmware programming and driver programming, which limits the development and use of USB interface products by general hardware engineers. The USB interface chip CH371 used in our portable wireless meter reading system is simple to use, has excellent performance and is inexpensive. As long as you are familiar with single-chip microcomputer programming and simple VB or VC application programming, general hardware engineers can easily develop corresponding USB products in a very short period of time. Figure 1 shows the principle of wireless meter reading and management system

block diagram.

Principle block diagram of wireless meter reading and management system

Figure 1 Principle block diagram of wireless meter reading and management system

2 Introduction to the USB bus universal interface chip CH371

CH371 is a universal interface chip for USB bus.

As shown in Figure 2, at the local end, 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, DSPs , MCUs and other controllers; in the computer system, the supporting software of CH371 provides a simple and easy-to-use operation interface, and communicating with the local microcontroller is like reading and writing files in 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. Based on CH371, you can easily upgrade parallel and serial port products to USB interfaces without knowing any USB protocols or firmware programs or even drivers.

CH371 chip schematic diagram

Figure 2 CH371 chip schematic

It has the following features:

(1) Shielded USB protocol, providing end-to-end connection between the computer application layer and the local end;
(2) Two communication modes: unidirectional data flow mode, request plus response mode, support for pseudo interrupts;
(3) Automatically complete the USB configuration process, without the need for the local controller to do any processing;
(4) Standard USB V1.1 interface, plug and play, D+ pin with built-in pull-up resistor;
(5) Built-in 4 endpoints, support USB control transfer, bulk transfer, and interrupt transfer;
(6) Universal Windows driver, providing device-level interface and application layer interface;
(7) Universal local 8-bit data bus, 4-wire control: read enable, write enable, chip select input, interrupt output;
(8) Occupies 16 addresses, can choose direct address mode or multiplexed address mode;
(9) Built-in input and output buffer, notifying the local controller to transfer data in interrupt mode;
(10) Built-in hardware-implemented I2C master interface, the application layer can directly read and write external I2C slave devices;
(11) In master control mode, it can provide 16 input signal lines or 12 independently controlled output signal lines;
(12) Built-in power-on reset, providing high-level effective reset output and low-level effective reset output;
(13) Built-in optional watchdog circuit Watch-Dog, providing monitoring for the local controller. [page]

3 Hardware Interface Design of CH371 in Wireless Meter Reader Based on Single Chip Microcomputer

Figure 3 shows a simplified diagram of the hardware interface between CH371 and MCU, so the hardware connection of MCU AT89C52 is relatively simple, mainly because in the design of this system, there are no special requirements for 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 serial EEPROM 24C01 with I2C interface is used 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 provided dynamic link library to easily complete the reading and writing of the corresponding information to the serial EEPROM. Of course, there can be no EEPROM in the system design. CH371 will use the default VID, PID, product descriptor and power descriptor, and there is no device serial number.

3CH371 and MCU hardware interface diagram

Figure 3. Hardware interface diagram of CH371 and MCU

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 USB connectors 1 and 4; the shell of the 12MHz crystal oscillator is best grounded; the impedance matching resistor can be between 80Ω and 150Ω.

4 Information transmission software implementation process

(1) Sub-program for uploading data to the lower computer

The simplified flow chart is shown in Figure 4.

Data upload subroutine flow chart

Figure 4 Data upload subroutine flow chart

(2) Lower computer interrupt service program

The flow chart is shown in Figure 5.

Flowchart of interrupt service program of lower computer

Figure 5 Flowchart of interrupt service program of lower computer

(3) Computer Application layer programs

After loading the universal driver of CH371 provided by WINCHIPHEAD on the computer, we no longer have to consider the USB communication protocol, firmware program, driver, automatic configuration process and underlying data transmission process. We only need to compile our own application with VB or VC according to the interface function of the dynamic link library provided.

5 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, high reliability, etc. I believe that there will be more and more new USB interface products based on CH371.

Keywords:CH371  USB Reference address:Application of USB interface based on CH371 in portable wireless meter reading system

Previous article:Design of handheld monitoring equipment for satellite communication vehicle-mounted station based on MSP430
Next article:Grain depot wireless temperature and humidity monitoring system based on RF module nRF905

Recommended ReadingLatest update time:2024-11-16 16:22

Design of portable ARINC429 bus communication equipment based on USB
In the integrated avionics system, fast and effective data transmission has a great impact on the performance of the entire avionics system, so the data bus is called the "skeleton" of the modern avionics system. ARINC429 is one of the most commonly used communication buses between avionics systems. To realize ARINC42
[Test Measurement]
Design of portable ARINC429 bus communication equipment based on USB
Designing with the MAXQ2000 USB "Thumb" Evaluation Kit
Designing with the MAXQ2000 USB "Thumb" Evaluation Kit This application note describes the steps required to quickly develop with the MAXQ2000 RISC microcontroller using the USB "thumb" evaluation (EV) kit. The document explains how to install and configure the EV kit's hardware and software, and how to develop
[Analog Electronics]
Designing with the MAXQ2000 USB
EU responds to Apple's criticism of stifling innovation! Forcing USB-C to be used is more environmentally friendly
Not long ago, the European Commission formally proposed a bill to unify the charging interfaces of consumer electronic devices such as smartphones, tablets, digital cameras, headphones, portable speakers, and game consoles into USB-C.    In response, Apple bluntly stated that the EU's actions are stifling innovation.
[Mobile phone portable]
How to design a USB-powered 433.92MHz RF power amplifier to prevent overheating
How to design a USB-powered 433.92MHz RF power amplifier to prevent overheating The International Telecommunication Union (ITU) has allocated the 433.92MHz Industrial, Scientific and Medical (ISM) band for use in Region 1, which geographically consists of Europe, Africa, Russia, Mongolia and the Arabian P
[Analog Electronics]
How to design a USB-powered 433.92MHz RF power amplifier to prevent overheating
Overview of USB Battery Charging Specification Version 1.2 and the Importance of Adapter Emulators
  introduction   Wherever you go, if you look around, you'll likely see someone using a portable device. Whether at home, in the car, or plugged into a computer, USB-powered portable devices require an intelligent way to determine the appropriate amount of power required for proper operation and charging. Due to the
[Power Management]
Overview of USB Battery Charging Specification Version 1.2 and the Importance of Adapter Emulators
Homemade MCU 8…USB-ISP download cable
  Nowadays, laptops and desktops are gradually abandoning parallel and serial ports; many netizens also told me that desktops no longer have parallel ports and download cables cannot be used, and asked me to help them think of a solution. It seems that making a USB-ISP download cable is inevitable.   After searching o
[Microcontroller]
A brief introduction to USB2.0 SD/MMC flash memory card reader single chip
Hechuanxing provides GL823K, a USB2.0 SD/MMC flash memory card reader single chip launched by Taiwan Chuangwei Semiconductor. Supports USB2.0 high-speed transmission and complies with the Universal Serial Bus specification. The chip integrates a high-speed 8051 microprocessor and a best-in-class data engine, and its p
[Microcontroller]
A brief introduction to USB2.0 SD/MMC flash memory card reader single chip
Implementation of USB Real-time Data Acquisition and Processing System Based on LabVIEW
  Universal Serial Bus (USB) is a new type of data communication interface that is being used in more and more fields. Compared with traditional PCI cards and ISA cards , data acquisition cards based on USB interfaces have the advantages of plug-and-play, hot-swap, fast transmission speed, strong versatility, easy exp
[Test Measurement]
Implementation of USB Real-time Data Acquisition and Processing System Based on LabVIEW
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号