摘要
本文提出一种基于DMA方式的高效UART收发机制。该机制通过DMA方式在UART外设和内存之间传输数据,实现非阻塞式、不定长数据的接收和发送。该机制进出中断次数少,降低了CPU占用率。实际测试的单片机芯片采用STM32H743VI,通过测量UART收发过程中CPU的占用率来对本文的收发机制进行评估。测试结果表明,DMA方式UART收发机制CPU占用率最低,传输效率最高。
In the paper,a high-efficiency mechanism based on DMA to modify the UART communication emerged.This is a non-blocking and variable-length transfer mechanism which can be made to transfer data between memory and peripherals and can improve the efficiency of data transfer.The UART communication mechanism based on DMA is tested by the benchmark of the CPU occupancy rate on the STM32 H743 VI.The results show that UART communication based on DMA takes lowest CPU occupancy rate and highest CPU efficiency.
作者
杭春烁
金豫
洪若昕
Hang Chunshuo;Jin Yu;Hong Ruoxin(School of Communication and Electronic Engineering,East China Normal University,Shanghai 200241,China)
出处
《单片机与嵌入式系统应用》
2021年第5期22-24,共3页
Microcontrollers & Embedded Systems