Let's first talk about the pins used for downloading programs to two types of microcontrollers:
The download pins of STC are P3.0 and P3.1, which are RXD and TXD;
Atmel's download pins are P1.5, P1.6 and P1.7. Secondly, after power-on, the level of the RST pin must be pulled high before downloading can be performed.
In order to be compatible with the download of two brands of microcontrollers on one board, the consequences of pin multiplexing must be considered during the design. I originally wanted to use the CD40xx series analog switch to automatically switch the download line, but the laboratory only had 4051, which is an eight-choose-one analog switch. I don’t need eight channels, but a two-channel, three-way parallel 4053. In the end, I had to use the most primitive dip switch to manually switch the download.
Here is the schematic diagram of the download board (partial):
As can be seen from the schematic diagram above, two five-position dip switches are used, one to control the communication connection between the RS232 serial port and the MAX232 chip, and the other to control the connection between the MAX232 and the microcontroller. In addition, a self-locking switch is connected in parallel to the reset switch, so that the RST pin can be locked to a level state when downloading the AT microcontroller to ensure normal downloading of the program.
When using, if you are downloading STC series microcontrollers, just turn the first and second channels of the two dials to on, and the third, fourth, and fifth channels to off. If it is an AT series microcontroller, just turn it the other way around. The download tool for STC is STC-ISP, and the download tool for AT is Atmel ISP2. Both download tools are the most commonly used and can be easily downloaded online.
One more thing to point out here is that this circuit is based on the RS232 serial port directly connected to the level conversion chip for downloading. If you use those cheap USB to serial port cables on the market to connect to this circuit, the speed of downloading Atmel's microcontroller will be very slow, or even unable to download (STC's microcontroller does not have this problem). This is determined by the conversion chip inside the USB to serial port cable. If the conversion cable is of good quality, the above problem will not occur. Students whose computers do not have serial ports need to pay attention when making this download cable.
The serial port socket in this PCB diagram is a male port, and the line sequence is relatively special; while the serial port in the schematic diagram above is a universal female port, and common cables can be used directly. Please pay attention to the difference.
An eight-position dip switch is also added to the resistor array position because I sometimes need to use the high-impedance state of the P0 pin.
Here is the finished board:
This board was designed more than two months ago. At that time, I was learning Altium Designer, 51 MCU, analog electronics, etc. I had just started learning everything, so there were many deficiencies in the design. I posted it here mainly to explain that AT MCU also downloads programs directly through the serial port. Many people on the Internet say that programs can only be downloaded through a special download cable. I am refuting the rumor now~·Hehe. I believe that students with a certain foundation should be able to see that the circuit of the two dip switches above can be simplified. Hehe~~ I have been seen through~~~
That's all about the production of this download line. I will post my provincial competition works and recent new works when I have time. For another download line, please refer to: http://www.51hei.com/mcu/585.html . I no longer use 51 microcontrollers, but STM32 based on ARM Cortex-M3 core. I will not spend time to optimize the above circuit. If you are interested in this download line, please discuss with me. If you have any better ideas, please remember to share them with me.
Previous article:PWM Speed Control of High-Power Brushless DC Motor Based on 51 Single-Chip Microcomputer
Next article:An infrared transmitter + decoding program + simulation file
Recommended ReadingLatest update time:2024-11-16 13:27
- Popular Resources
- Popular amplifiers
- 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)
- Fundamentals and Applications of Single Chip Microcomputers (Edited by Zhang Liguang and Chen Zhongxiao)
- Single chip microcomputer control technology (Li Shuping, Wang Yan, Zhu Yu, Zhang Xiaoyun)
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
- Inline instructions for TMS320C66x study notes
- Automotive Ultrasonic Kick-to-Open Reference Design
- 【Ufan Learning】I received the Ufan but where is the drawing? ? ? ?
- 【TI recommended course】#Lecture on basic knowledge of electronic circuits#
- Summary of GPIO usage
- How to Implement Flexible RF Sampling Architectures Using High-Speed Data Converters
- I'm under a lot of pressure. I have an exam tomorrow.
- Solve the problem of abnormal MCU startup
- STM32F207 Ethernet + LAN8742 transmission server will get stuck
- Urgent help!!!!