How does a microcontroller communicate with a computer? Electronic engineers must know

Publisher:BlissfulBlissLatest update time:2024-08-19 Keywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

The serial port of the microcontroller is TTL level and cannot communicate directly with the computer. Level conversion is required. There are many types of level conversion chips on the market. Today I recommend three types to you, namely MAX232, CH340G, and CH340C. The following are introduced respectively.

1. MAX232 chip

This chip is a chip that appears frequently. Whether it is in university textbooks or on MCU development boards, as long as it involves USB/serial ports, this chip will definitely be mentioned. This chip has a dual-channel conversion interface, and the circuit design is not complicated. The following figure is a typical design schematic:

Typical schematic diagram of MAX232 chip

This chip requires four capacitors to build peripheral circuits. The manual recommends using 1uF polarized capacitors, but it has been verified that 0.1uF capacitors can also be used, which greatly reduces the size of the board.

2. CH340G chip

CH340G is produced by Nanjing Qinheng. It can be said that the level conversion chips and gateway chips produced by this company are all magical tools, with simple peripheral circuits and powerful functions. CH340G chip is currently selling well due to its simple peripheral circuits and is often out of stock. Its typical schematic diagram is shown below:

CH340G typical schematic diagram

This chip needs an external 12M crystal oscillator, and when designing, please note that the processing method of the 4th pin V3 is different when the external power supply is 5V and 3.3V. In the above figure, when the external power supply is 5V, V3 needs to pass through a 0.1uF capacitor to GND; when the external power supply is 3.3V, V3 needs to be connected to the power supply. At present, many USB to serial port modules are designed using this chip.

USB/TTL Module

The currently popular ISP automatic download circuit uses this chip.

3.CH340C chip

CH340C and CH340G are in the same series, but CH340C can save the external 12M crystal oscillator and oscillator capacitor when used, saving PCB space and cost, and is relatively more convenient to design. The typical circuit schematic of CH340C is shown below:

CH340C typical schematic diagram

The prices of these chips are not very high, CH340G is about 1.8 yuan, CH340C is about 1.94 yuan, and MAX232 is about 3 yuan. Of course, there are many other chips such as PL2303, which are not recommended here.


Keywords:MCU Reference address:How does a microcontroller communicate with a computer? Electronic engineers must know

Previous article:Modular Programming
Next article:MC9S12XS128 PWM Output Configuration

Recommended ReadingLatest update time:2024-11-15 07:15

IC design, foundry and packaging and testing rankings: When will the global semiconductor market recover?
Since the second half of 2018, some institutions have predicted that the global semiconductor industry will enter a downward cycle. Due to the Sino-US trade war, the Japan-Korea war, the decline in demand for automobiles, consumer electronics and other products, coupled with the lack of innovation in the new iPhone an
[Embedded]
IC design, foundry and packaging and testing rankings: When will the global semiconductor market recover?
Exploring the Principle and Control Program of PWM in Single Chip Microcomputer
PWM is widely used in microcontrollers. Its basic principle is very simple, but its meaning is often not exactly the same when applied in different occasions. Here I will first introduce the basic concepts and principles to you, so that when you encounter them later, at least you know what they are. PWM is the abbre
[Microcontroller]
Exploring the Principle and Control Program of PWM in Single Chip Microcomputer
MCU PWM wave (AT89C51, ADC0808)
1. Introduction This circuit is composed of AT89C51 minimum system and ADC0808. 2. Operation Effect 3. Code /*Want more projects private wo!!!*/ #include reg52.h #define uint unsigned int #define uchar unsigned char sbit CLK = P2^4; sbit ST = P2^5; sbit EOC = P2^6; sbit OE = P2^7; sbit PWM = P3^0; void Delay
[Microcontroller]
MCU PWM wave (AT89C51, ADC0808)
[MCU] md5 signature algorithm
#include string.h #include "md5.h" #define F(x, y, z) ((x & y) | (~x & z)) #define G(x, y, z) ((x & z) | (y & ~z)) #define H(x, y, z) (x ^ y ^ z) #define I(x, y, z) (y ^ (x | ~z)) #define ROTATE_LEFT(x, n) ((x n) | (x (32 - n))) #define FF(a, b, c, d, x, s, ac)      {                                      a
[Microcontroller]
Based on the use of STM8 microcontroller I2C method to realize read and write operations
STM8 hardware I2C knowledge The I2C module of STM8S can not only receive and send data, but also convert data from serial to parallel data when receiving and from parallel to serial data when sending. Interrupts can be enabled or disabled. The interface is connected to the I2C bus through the data pin (SDA) and the cl
[Microcontroller]
Based on the use of STM8 microcontroller I2C method to realize read and write operations
How to use a microcontroller to simulate reading and writing 24C01EEPROM data
Purpose: Familiar with using MCU to simulate reading and writing 24C01EEPROM 1. First write data to 24C01EEPROM 2. Read data from 24C01EEPROM and display it with LED Hardware Setup: 1. All SW4 switches are closed 2. SW2 switch 1 is closed, and the others are open 3. SW3 switches 7 and 8 are closed, and the others ar
[Microcontroller]
How to use a microcontroller to simulate reading and writing 24C01EEPROM data
Simulation implementation of Multi2sim10 microcontroller and its application in digital circuits
introduction Microcontrollers are small in size, light in weight, highly flexible, and inexpensive, so they are increasingly used. Among them, the 8051/8052 chip launched by In2ter is the most basic, most popular and most commonly used. 8051/8052 are widely used in small and medium-sized development situations and hav
[Microcontroller]
Simulation implementation of Multi2sim10 microcontroller and its application in digital circuits
Design of kitchen control based on PIC microcontroller
    With the continuous development of intelligent home appliance control technology, multifunctional and intelligent kitchen controllers have become the mainstream of kitchen appliance development. Compared with traditional single kitchen equipment controllers, multifunctional kitchen controllers have the advantages o
[Microcontroller]
Design of kitchen control based on PIC microcontroller
Latest Microcontroller Articles
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号