论文部分内容阅读
PIC系列单片机的中断及堆栈数量有限,特别是PIC16C5X系列产品没有设置专门的中断功能,堆栈也只有两级,在实际应用中有时会感到很不方便。下面介绍利用软件对PIC系列单片机进行中断的扩展原理和实现方法,及建立寄存器和控制位定义文件的范例。一、软件中断的扩展技术本文以PIC16E5X系列产品为例,介绍一种软件中断的扩展方法,此方法是利用软件改变程序计数器PC的值,从而扩展PIC单片机的中断功能。这种方法可以使用多达8条中断线,对于简单的程序实际只需要6
PIC series microcontrollers have a limited number of interrupts and stacks. In particular, the PIC16C5X series does not have a dedicated interrupt function, and the stack has only two stages, which can sometimes feel inconvenient in practical applications. The following describes the use of software to PIC series microcontrollers to interrupt the expansion of the principle and implementation methods, as well as the establishment of register and control bit definition file examples. First, the software interrupt the expansion technology PIC16E5X series of products, for example, describes a software extension of the method of interruption, this method is to use software to change the value of the program counter PC, thus extending the PIC microcontroller interrupt capabilities. This method can use up to eight interrupt lines, actually only 6 for a simple program