摘要
串口通讯简单、易实现,应用广泛,但需要CPU的参与,占用了CPU的时间。采用直接内存存取(DMA)读写技术,则不需要CPU参与,外设与内存直接数据拷贝。采用DMA方式接收串口数据报文时,如利用DMA本身中断完成接收,则DMA接收数据长度需配置成定长,而在实际使用时,数据长度可能不定。利用串口的空闲中断,较好地解决了不定长报文的接收问题,节约CPU的资源,提高通讯效率,简化硬件设计。
Serial communication is simple and easy to achieve,widely used,but it requires the participation of the CPU and takes up the time of CPU.If reading and writing technology of direct memory access(DMA)is used,it does not need the participation of CPU,peripherals and memory copy data directly.When receiving serial data packets in the Direct Memory Access(DMA)mode,if the interruption of DMA is used to complete the reception,the length of the data received by the DMA needs to be configured as a fixed one.However,the data length may be uncertain when actually used.Using the idle interruption of the serial port,it better solves the problem of receiving indefinite long messages,saves CPU resources,improves communication efficiency,and simplifies hardware design.
作者
李队员
朱广
LI Duiyuan;ZHU Guang(Department of Urban Rail Transit and Information Engineering,Anhui Communications Vocational&Technical College,Hefei 230051,China;School of Mechanical and Electrical Engineering,Anhui Jianzhu University,Hefei 230601,China)
出处
《宿州学院学报》
2020年第3期68-71,75,共5页
Journal of Suzhou University
基金
安徽省教育厅一般项目(KJ2017JD18)。
关键词
内存存取
不定长
空闲中断
DMA
Uncertain length
Idle interruption