检索规则说明:AND代表“并且”;OR代表“或者”;NOT代表“不包含”;(注意必须大写,运算符两边需空一格)
检 索 范 例 :范例一: (K=图书馆学 OR K=情报学) AND A=范并思 范例二:J=计算机应用与软件 AND (U=C++ OR U=Basic) NOT M=Visual
作 者:牛洪海[1] 臧峰[1] 周绪贵 NIU Honghai;ZANG Feng;ZHOU Xugui(NR Electric Co.,Ltd.,Nanjing 211102,China)
机构地区:[1]南京南瑞继保电气有限公司,江苏南京211102
出 处:《自动化仪表》2018年第9期45-48,共4页Process Automation Instrumentation
摘 要:使用直接内存存取(DMA)方式接收报文时,必须先向DMA控制器指定需要接收的字节。当DMA控制器接收到指定字节后,产生DMA传输中断。但是在实际应用时,串口接收报文的字节往往是不固定的。针对DMA必须接收固定长度的数据才产生传输中断的不足,设计了外部中断与定时器相结合的方法来解决这一问题。该方法兼顾了DMA传输不需要CPU干预的优点,又弥补了其不能传输不定长数据的缺陷。外部中断由一个与串口RXD引脚相连接的外部引脚产生。该中断产生的EVENT事件与定时器的输入事件相关联。设置定时器为Retrigger模式,接收到EVENT事件后清零定时器的累计时间;而当定时器一定时间内接收不到EVENT事件后就会超时产生中断,在超时中断服务程序中进行报文处理。由于使用了定时器超时中断进行报文处理,实现了不定长报文的接收和处理,满足了串口通常传输不定长报文的需求。When using direct memory access( DMA) for messages reception,it is necessary to specify the number of bytes to be received for the DMA controller. When the DMA controller receives the specified bytes,a DMA transmission interruption is generated. But in practical applications,the number of bytes received by serial port is often not fixed. Aiming at the deficiency that transmission interruption is only generated under fixed length data transmission through DMA,a method combining external interruption and timer is designed and implemented to solve this problem. This method takes into account the advantages of DMA transfer without CPU intervention,and makes up for the inability to transmit indefinite-length data. The external interruption is generated by an external pin connected to the RXD pin. The EVENT generated by this interrupt is associated with the input event of timer. The timer is set into Retrigger mode,after receiving EVENT,the accumulative time of the timer is cleared; when the timer fails to receive EVENT within a certain period,it will timeout and generate an interrupt,message processing is conducted in timeout interrupt service routine. Due to the use of timeout interruption for message processing,indefinite length message can be received and processed,the demand for transmitting indefinite length messages is satisfied.
关 键 词:直接内存存取 不定长 外部中断 通用异步收发器 定时器 超时中断
分 类 号:TH865[机械工程—仪器科学与技术] TP27[机械工程—精密仪器及机械]
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在链接到云南高校图书馆文献保障联盟下载...
云南高校图书馆联盟文献共享服务平台 版权所有©
您的IP:3.133.83.123