DOS环境下用Borland C实现中断方式的串口编程实例  

Realization of interrupt mode serial programming with Borland C under environment of DOS

在线阅读下载全文

作  者:庞彬[1] 乔丽[2] 

机构地区:[1]北京航天控制仪器研究所,北京100854 [2]中国科学院遥感与数字地球研究所,北京100101

出  处:《现代电子技术》2013年第18期78-79,共2页Modern Electronics Technique

摘  要:Windows环境下进行串口通信很容易实现,但在DOS环境下进行串口通信时,由于可调用的系统资源很少,只能通过直接操作硬件端口来实现。在对硬件端口进行初始化设置之后,首先保存原中断向量,然后装入自己的中断服务程序入口地址,再打开中断,调用完成之后在程序关闭之前关闭中断和恢复原中断向量。通过以上方法实现了DOS环境下的串口通信,在转台设计过程中用于上下位机之间的通信,经过上万次的实验考核,该方法稳定可靠,在工程应用中具有很大的借鉴性。It is easy to realize the serial communication under Windows environment,but under the environment of DOS,serial communication can only be achieved by directly operating the hardware port because very few system resources can be called.The application method of the serial communication under the environment of DOS is introduced in this paper.The steps of the method is:the original interrupt vector is preserved after the initialization of the hardware port,the interrupt service routine entrance address is loaded,the interrupt is opened,and then the interruption is shut down before closing the program and the original vector interrupt is restored.The communication between the upper and lower machines was adopted in the turntable design process.The experimental results show that the method is stable and reliable.This is the innovation point of the reseach.

关 键 词:串口通信 寄存器 基地址 中断向量 

分 类 号:TN964-34[电子电信—信号与信息处理] TP311[电子电信—信息与通信工程]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象