[PIC®/AVR®/dsPIC®产品] 关于XC8编译器下PIC单片机的中断向量表

[复制链接]
 楼主| lcr52099 发表于 2018-6-19 16:32 | 显示全部楼层 |阅读模式
void interrupt ISR(void) {

    if (IOCAF) {                                //SW1 was just pressed
        IOCAF = 0;                              //must clear the flag in software
        __delay_ms(5);                          //debounce by waiting and seeing if still held down
        if (SWITCH == DOWN) {
            _direction ^= 1;                    //change directions
        }
    }


    if (INTCONbits.T0IF) {                      // When Timer 0 rolls over, rotate the LED
        INTCONbits.T0IF = 0;

        if (_direction == LED_RIGHT) {
            LATC >> = 1;                        //rotate right
            if (STATUSbits.C == 1)              //when the last LED is lit, restart the pattern
                LATCbits.LATC3 = 1;
        } else{
            LATC << = 1;                        //rotate left
            if (LATCbits.LATC4 == 1)            //when the last LED is lit, restart the pattern
                LATCbits.LATC0 = 1;

        }
    }


}
新人新接触PIC
这个是一段示例程序,但是我把<xc.h>里所有包含了的头文件找了一次 没有发现对 interrupt ISR的描述,也没发现中断向量表。请问PIC16F1825单片机中断向量表在哪里找?

yklstudent 发表于 2018-6-20 08:54 | 显示全部楼层
你要啥中断向量表,16就一个中断入口
 楼主| lcr52099 发表于 2018-6-20 10:41 | 显示全部楼层
yklstudent 发表于 2018-6-20 08:54
你要啥中断向量表,16就一个中断入口

昨天看了下手册看见了。。。应该是都是从这个入口进去了过后读中断标志位
您需要登录后才可以回帖 登录 | 注册

本版积分规则

10

主题

26

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部

10

主题

26

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部