USB to serial communication

Publisher:和谐相伴Latest update time:2015-03-19 Source: diangonKeywords:USB Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
  With the development of technology, RS232 serial communication is still widely used in industry. However, in the application of commercial technology, USB to UART technology has gradually replaced RS232 serial port. Most laptops no longer have serial port. So how can we realize communication between microcontroller and computer?

We only need to add a USB to serial port chip to our circuit to successfully realize the conversion between USB communication protocol and standard UART serial communication protocol. On our development board, we use the CH340T chip, as shown in Figure 1.

USB to serial port circuit

Figure 1 USB to serial port circuit

  J2 on the left is a set of jumpers, which can be found in the lower left corner of our board. We short-circuit pins 3 and 5, and pins 4 and 6 through jumper caps. The circuit of CH340T on the right is very simple. After connecting the power circuit and crystal oscillator circuit, the DP and DM of pins 6 and 7 are connected to the two data pins of the USB port respectively, and pins 3 and 4 are connected to the TXD and RXD of our microcontroller through jumpers.

  A 4148 diode is added to the 3rd pin position in the CH340T circuit, which is a little trick. Because our STC89C52RC microcontroller needs a cold start to download the program, that is, click download first and then power on. At the moment of power on, the microcontroller will first detect whether the program needs to be downloaded. Although the VCC of the microcontroller is controlled by the switch, since the 3rd pin of the CH340T is an output pin, if there is no diode, when the power is off in the back-stage microcontroller of the switch, the 3rd pin of the CH340T is connected to the P3.0 (ie RXD) pin of the microcontroller, and current will flow through this pin into the back-stage circuit and charge the capacitor of the back-stage, causing a certain voltage in the back stage. Although this voltage value is only about two or three volts, it may affect our cold start. After adding the diode, on the one hand, it does not affect communication, and on the other hand, it can eliminate this problem. This place can be used as a temporary understanding. If you make this circuit yourself, you can refer to it.

Keywords:USB Reference address:USB to serial communication

Previous article:USB to serial communication
Next article:Serial RS232 communication interface_MAX232 adapter diagram

Recommended ReadingLatest update time:2024-11-16 13:28

Design and development of USB software encryption card and its driver
【Abstract】 This paper describes in detail the hot technology of USB software encryption card and its driver. Based on practical experience, it focuses on the selection and application of USB interface chips. It explains the development of basic functions of USB driver and proposes a new viewpoint on developing encr
[Analog Electronics]
Design and development of USB software encryption card and its driver
Design of USB interface circuit for embedded fingerprint recognition system
  In the fingerprint automatic identification system, embedded systems have been more and more widely used due to their advantages such as low power consumption, small device size and high security. Universal Serial Bus (USB) is a microcomputer bus interface specification jointly formulated by Inter, Microsoft, IBM an
[Power Management]
Design of USB interface circuit for embedded fingerprint recognition system
Application Design Method of PIC18F4550 Microcontroller with Full-Speed ​​USB Interface
introduction USB is a fast, bidirectional synchronous transmission, inexpensive and hot-swappable serial interface. Using USB bus technology, various instruments and equipment suitable for scientific research and industrial production are developed to replace the instruments and equipment using serial
[Microcontroller]
Application Design Method of PIC18F4550 Microcontroller with Full-Speed ​​USB Interface
mini6410 2.6.38 transplanted to USB
1. First, U disk must be supported. 1. Add line 124 in vi arch/arm/mach-s3c64xx/mach-mini6410.c /* Initializes OTG Phy. to output 48M clock */ void s3c_otg_phy_config(int enable) { u32 val; if (enable) { __raw_writel(0x0, S3C_PHYPWR); /* Power up */ val = __raw_readl(S3C_PHYCLK); v
[Microcontroller]
Battery Charger Development Trends in Portable Power Products
  Portable power applications are broad and varied. Products range from wireless sensor nodes with an average power consumption of only a few μW to in-vehicle medical or data acquisition systems with battery packs of several hundred watt hours. However, despite the variety, they show a relatively consistent developmen
[Power Management]
Battery Charger Development Trends in Portable Power Products
Some problems caused by STM32F401 USB VBUS settings
When debugging the code on the development board, PA9 on the development board is a floating input. When mounting the chip, our board uses this pin and sets it to GPIO_MODE_OUTPUT_PP. The problem that finally caused was that USB could not communicate properly. Finally, I checked the manual and saw the following d
[Microcontroller]
Some problems caused by STM32F401 USB VBUS settings
A first look at the USB peripherals of STM32
These days I have been considering whether to use USB or Ethernet for the project, but the platform we are using, STM32F103ZET6, does not seem to have the Enternet peripheral, so let's consider USB first. One of the major features of USB peripherals is plug-and-play, which is possible because the USB protocol stipulat
[Microcontroller]
Application of USB interface chip SL811HS in 51 single-chip microcomputer system
1. Introduction USB (Universal Serial Bus) is a new interface technology jointly proposed by INTEL, DEC, MI-CROSOFF, IBM and other companies, which has been gradually widely used in the PC field in recent years. The USB interface has good versatility, strong real-time performance, various transmission metho
[Microcontroller]
Application of USB interface chip SL811HS in 51 single-chip microcomputer system
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号