What's going on after DTR/RTS is sent to an FTDI-based Arduino board?

为君一笑 提交于 2019-12-05 15:10:20

You are correct. The reason for this is the thing called Bootloader.

In their most barebones state, the microcontrollers (henceforth uCs) that Arduinos are built on can be programmed via In-System Programming (ISP) method, which is a particular implementation of SPI protocol. The only thing we need to know about that is that this isn't serial or USB.

To make AVR chips (and Arduino boards) programmable via Serial/USB we load a program called Bootloader (via ISP) onto the chip. The bootloader reads your program data over the serial link and writes it to flash. If there is no program to be loaded, the bootloader gives the loaded program the control. So the bootloader could only be active after turn on or reset: after that it runs the program you loaded and never becomes active again.

Most bootloaders are set up to look for programming data only after a reset, and the reason is that waiting for the serial data involves a timeout: you have to wait for some time (say 1/3/5/10 seconds) to see if there is program being uploaded and then load the program if it is being sent. If the bootloader looked for programming data every time an Arduino turned on, your Arduino would only activate with a delay, which was deemed to be undesirable. So the bootloader only activates after a reset.

It could be annoying to force the user to have to push the reset pin every time before they wanted to program their Arduino, and, moreover, to start sending the serial data immediately after reset (or they might miss the timeout window), so the clever folks at Arduino came up with a trick: use the DTS signal to trigger reset and after that send the data. So your Arduino (if it isn't ancient) is set up to reset on receiving DTS signal.

4ntoine

The answer is that the board resets. The schematic is made in the way it resets the board (RTD/DTR is wired to the microcontroller reset pin somehow).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!