This improves the utilization rate of the CPU. When DMA transmission is completed, an interrupt will be generated to tell the CPU that I have finished, and then the CPU can process the data when it knows it. This kind of operation does not involve the processor in processing. A typical example is moving a block of external memory to a faster memory area inside the chip. The CPU only needs to initialize DMA, and the transfer itself is realized and completed by DMA controller. Direct Memory AccessĭMA transfers copy data from one address space to another. What is DMA?ĭMA: full name Direct Memory Access, i.e. Only by thinking constantly can we make progress. In fact, it is necessary to think about the above problems. How can we receive indefinite data? DMA introduction We can use DMA to receive data, but DMA needs a fixed length to generate a receive interrupt. Do you want to run the main program?Ĭlassmate B: the serial port can be configured to receive data by DMA. How can we ensure high efficiency? Often interrupt the main program.
Interrupt is to interrupt the normal operation of the program. When using stm32 or other single-chip computers, serial communication is often used, so how to effectively receive data? If this data is indefinite, how can it be received efficiently?Ĭlassmate A: when the data comes, it will enter into the serial port and interrupt.