STM32 automatic ISP circuit design

Publisher:数字驿站Latest update time:2016-12-08 Source: eefocusKeywords:STM32 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

STM32 automatic ISP hardware circuit

STM32 supports emulator and serial port downloader. The content to be introduced belongs to serial port download, which is what we usually call ISP download.

We already know that manual ISP download program can be realized by controlling BOOT0 pin. When STM32 is powered on, it will automatically detect the level of BOOT0 pin. If it is high level, it will wait for the user to download the program; if it is low level, it will run the program previously downloaded to the microcontroller by the user. So we need to lead out the BOOT0 pin, and then control it to ground or connect to VCC to download or run the program. During the debugging process, we need to constantly control BOOT0, which is very troublesome. Then, automatic ISP should come into play.

Automatic ISP, connect BOOT0 directly to the ground, then the program will run every time the power is turned on, and as long as you click the "Download" button on the computer, the program will start downloading, and after the program is downloaded, it will start executing. To achieve this goal, you need to use the serial port handshake signals DTR and RTS.

The following is the free ISP download software developed by Shenzhen Pengyuan Diantong Technology Co., Ltd. Please see the part in the red box.

DTR and RTS in STM32ISP software

DTR is connected to RESET (reset pin) to control reset, and RTS is connected to BOOT0 to control program running or waiting for downloading.

The following describes how to use the USB to TTL chip to implement STM32 automatic ISP. The CH340 chip is shown in the figure below:

CH340G

In CH340 chip, DTR and RTS pins are usually high level and low level is effective. Because the RESET pin of STM32 is also usually high level and low level is reset, DTR can be directly connected to RESET. However, BOOT0 is high level to download the program and low level to run the program, which is exactly the opposite of RTS, so we need to invert it and add an NPN transistor. The circuit is shown in the figure below:

STM32 automatic ISP circuit

ISP software selection:

STM32 automatic ISP software DTR and RTS selection

After seeing the options in the above picture, some people will have doubts. In theory, it should be a low-level reset, and then a low-level entry into the BOOTLoader. However, one thing needs to be noted, the high and low levels mentioned here are for the original 9-pin serial port of the computer, that is, "232 level", and the USB to TTL chip we use is "TTL level", which is exactly the opposite. For this part, you can refer to another article I wrote: http://www.rationmcu.com/elecjc/947.html

The download process and results are shown in the following figure:

STM32 automatic ISP process

 

Note: When CH340 is just powered on, it takes a few seconds to stabilize. During this period, the DTR pin will become low twice or three times, which will cause the microcontroller to reset two or three times after powering on. After stabilization, it will not affect the program operation. If you do not want the microcontroller to reset several times after powering on, just disconnect DTR and RESET when powering on.


Keywords:STM32 Reference address:STM32 automatic ISP circuit design

Previous article:assert_param and assert_failed in STM32 library functions
Next article:Why does the register address of ARM microcontroller differ by 4?

Recommended ReadingLatest update time:2024-11-16 15:30

STM32——FLASH (power-off save)
Today we use STM32's FLASH to save data and realize the power-off saving function. Power-off saving: When using FLASH storage, it is sufficient to store the data once after each data refresh. PS: When you re-download, the saved data will be refreshed. FLASH programming ideas: Write: Erase data first (page erase||full
[Microcontroller]
Implementation of STM32 CustomHID
How to create a custom HID project? Let's talk about it below. First, let's introduce the architecture of the project. The overall architecture of the project is shown in the figure below. The project is constructed according to the following figure: Let's analyze the project layout. First, there is APP. This group
[Microcontroller]
Implementation of STM32 CustomHID
SysTick system clock tick experiment (introduction to stm32 interrupts)
 The system clock tick experiment is not difficult, I will briefly talk about it here, but it involves the most complex and most widely used peripheral of STM32-NVIC. If RCC is the part that must be considered for real-time performance, then NVIC is the basis for the functional implementation of stm32. NVIC is not diff
[Microcontroller]
SysTick system clock tick experiment (introduction to stm32 interrupts)
Some common basic library functions and serial port configuration steps in stm32
Commonly used basic library functions: void RCC_APB2PeriphClockCmd(uint32_t RCC_APB2Periph, FunctionalState NewState) //Enable port clock   void GPIO_Init(GPIO_TypeDef* GPIOx, GPIO_InitTypeDef* GPIO_InitStruct) //Initialize port, select port number, set parameters typedef struct {   uint16_t GPIO_Pin; //pin number  
[Microcontroller]
STM32 Study Notes - External Interrupts
Interrupt, as the name implies, means that a continuous process is interrupted. When the processor is processing a task, there is a task that needs to be processed immediately, so it needs to stop the task at hand and execute this task first. The process of configuring external interrupts is similar to that of confi
[Microcontroller]
Interpretation of STM32 MCU: Code to implement PCROP clearing
Preface STM32  PCROP proprietary code readout protection sets a certain area to only allow execution, which can prevent the code from being illegally read out and modified. The ST website provides free PCROP reference code, but the routine only provides code to set PCROP. To facilitate the development and deployment
[Microcontroller]
Interpretation of STM32 MCU: Code to implement PCROP clearing
STM32—cubeMX+DMA+USART receives data of any length
Preface     In a previous article, I modified the HAL library to enable USART to receive data of any length. This can enable the reception of data of any length ending with 0x0a, that is, it is considered that the reception ends when 0x0a is received. See the link: HAL USART receives data of any length.    However
[Microcontroller]
STM32—cubeMX+DMA+USART receives data of any length
Tax controller solution based on STM32
With the promotion of the Golden Tax Project, the tax control market will develop rapidly. As one of the four major tax control products, the tax controller has a market share that cannot be underestimated. Tax control manufacturers need to consider the performance and cost of their products in many aspects. In the pa
[Microcontroller]
Tax controller solution based on STM32
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号