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.
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.
Previous article:USB to serial communication
Next article:Serial RS232 communication interface_MAX232 adapter diagram
Recommended ReadingLatest update time:2024-11-16 13:28
- Popular Resources
- Popular amplifiers
- Virtualization Technology Practice Guide - High-efficiency and low-cost solutions for small and medium-sized enterprises (Wang Chunhai)
- usb_host_device_code
- Image acquisition and processing system for panoramic map applications
- Teach you to learn 51 single chip microcomputer-C language version (Second Edition) (Song Xuefeng)
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
- AVCC and AVSS issues with MSP430FR2355?
- 【N32L43x Review】OLED Displays Temperature and Humidity Data
- Method of flash programming in LPC2000 series microcontroller
- A Review of Low Power Design Technology
- [Restored] Notice: Forum short message maintenance, will be restored tomorrow at noon
- What is the typical salary for a software engineer?
- [Dialogue with forum members] My main focus now is to find chips, buy them first and then develop them
- NXP MKL26 error when downloading during debugging..
- Introduction to the method of board-level online compilation and downloading of C6000 DSP code
- Tiny technology, global impact: Breakthrough TI BAW resonator technology creates a new electronic heartbeat