摘要
介绍了以LPC2365为核心处理器、嵌入式实时操作系统μC/OS-Ⅱ下的多串口通信编程方法。对于固定长度的短字节帧数据,通过设置合适的字节触发深度,一次中断完成数据接收任务;对于变长的长字节帧数据,则通过多次中断和等待延时的方法判断数据稳定并完成帧数据的接收;对于大量数据的接收和发送采用建立FIFO数据队列的方法。通过这些措施较好地完成了多串口较大数据量的通信任务。
Multi-serial communication programming method in embedded real-time operating system μC/OS-Ⅱ is introduced, taking LPC2365 as core processor. For fixed-length short-byte frame data, one depth interruption is triggered to finish data receving task through setting suitable bytes. For variable length long-byte frame data, multiple interruptions and time delay are used to determine data stability and receive frame data. For the receiving and sending of large amounts data. FIFO data queues are established. By using the methods, the communication tasks of multi-serial and abundant data are realized well.
出处
《单片机与嵌入式系统应用》
2012年第8期26-29,共4页
Microcontrollers & Embedded Systems
关键词
嵌入式系统
实时操作系统
互斥信号量
数据队列
embedded system
real time operating system
mutual exclusion semaphores
data queue