智能车制作

 找回密码
 注册

扫一扫,访问微社区

查看: 1295|回复: 1
打印 上一主题 下一主题

求大神指教中断为什么进不去

[复制链接]

1

主题

3

帖子

0

精华

中级会员

Rank: 3Rank: 3

积分
264
威望
154
贡献
52
兑换币
88
注册时间
2013-3-18
在线时间
30 小时
毕业学校
西南交通大学
跳转到指定楼层
1#
发表于 2013-4-14 16:23:39 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
void EXTI_ini(void)
{
MCF_GPIO_PNQPAR = MCF_GPIO_PNQPAR_IRQ3_IRQ3//配置引脚功能,3、5为IRQ功能
         |MCF_GPIO_PNQPAR_IRQ5_IRQ5;      
MCF_EPORT_EPPAR = MCF_EPORT_EPPAR_EPPA3_RISING//配置为捕捉上升沿
      |MCF_EPORT_EPPAR_EPPA5_RISING;
MCF_EPORT_EPDDR =(uint8)~MCF_EPORT_EPDDR_EPDD3//配置输出输入
      &~MCF_EPORT_EPDDR_EPDD5;
MCF_EPORT_EPIER = MCF_EPORT_EPIER_EPIE3; //开3中断
// MCF_EPORT_EPIER |=MCF_EPORT_EPIER_EPIE5;//开5中断
MCF_EPORT_EPIER&=~MCF_EPORT_EPIER_EPIE5;//关5中断
MCF_INTC0_IMRL&=~MCF_INTC_IMRL_MASKALL;//中断使能
MCF_INTC0_IMRL&=~MCF_INTC_IMRL_INT_MASK3 //EPORT interrupt source 3
       &~MCF_INTC_IMRL_INT_MASK5; //EPORT interrupt source 5     
//MCF_INTC0_ICR03=MCF_INTC_ICR_IP(2)+MCF_INTC_ICR_IL(3);
//MCF_INTC0_ICR05=MCF_INTC_ICR_IP(3)+MCF_INTC_ICR_IL(3);
MCF_INTC0_ICR03=MCF_INTC_ICR_IL(5);
MCF_INTC0_ICR05=MCF_INTC_ICR_IL(5);
}


//行中断处理
__declspec(interrupt) void EPORT_irq3_handler(void)//行中断
{
unsigned int  n=0;
   MCF_EPORT_EPFR|=MCF_EPORT_EPFR_EPF3;//行中断标志位清除,以便于下次行中断进行
   Line++;         //行中断计数变量
   if ( SampleFlag == 0 || Line<ROW_START || Line>ROW_MAX )
   {
      return;     //不是要采集图像的有效行,返回                              
    }
   
       if( Line==Get_Image[hang])
  {
     
     
     Buffer[m][0]=MCF_GPIO_PORTAN;__asm();Buffer[m][1]=MCF_GPIO_PORTAN;__asm();Buffer[m][2]=MCF_GPIO_PORTAN;__asm();Buffer[m][3]=MCF_GPIO_PORTAN;__asm();Buffer[m][4]=MCF_GPIO_PORTAN;__asm();
        Buffer[m][5]=MCF_GPIO_PORTAN;__asm();Buffer[m][6]=MCF_GPIO_PORTAN;__asm();Buffer[m][7]=MCF_GPIO_PORTAN;__asm();Buffer[m][8]=MCF_GPIO_PORTAN;__asm();Buffer[m][9]=MCF_GPIO_PORTAN;__asm();
        Buffer[m][10]=MCF_GPIO_PORTAN;__asm();Buffer[m][11]=MCF_GPIO_PORTAN;__asm();Buffer[m][12]=MCF_GPIO_PORTAN;__asm();Buffer[m][13]=MCF_GPIO_PORTAN;__asm();Buffer[m][14]=MCF_GPIO_PORTAN;__asm();
        Buffer[m][15]=MCF_GPIO_PORTAN;__asm();Buffer[m][16]=MCF_GPIO_PORTAN;__asm();Buffer[m][17]=MCF_GPIO_PORTAN;__asm();Buffer[m][18]=MCF_GPIO_PORTAN;__asm();Buffer[m][19]=MCF_GPIO_PORTAN;__asm();
        Buffer[m][20]=MCF_GPIO_PORTAN;__asm();Buffer[m][21]=MCF_GPIO_PORTAN;__asm();Buffer[m][22]=MCF_GPIO_PORTAN;__asm();Buffer[m][23]=MCF_GPIO_PORTAN;__asm();Buffer[m][24]=MCF_GPIO_PORTAN;__asm();
        Buffer[m][25]=MCF_GPIO_PORTAN;__asm();Buffer[m][26]=MCF_GPIO_PORTAN;__asm();Buffer[m][27]=MCF_GPIO_PORTAN;__asm();Buffer[m][28]=MCF_GPIO_PORTAN;__asm();Buffer[m][29]=MCF_GPIO_PORTAN;__asm();
        Buffer[m][30]=MCF_GPIO_PORTAN;__asm();Buffer[m][31]=MCF_GPIO_PORTAN;__asm();Buffer[m][32]=MCF_GPIO_PORTAN;__asm();Buffer[m][33]=MCF_GPIO_PORTAN;__asm();Buffer[m][34]=MCF_GPIO_PORTAN;__asm();
        Buffer[m][35]=MCF_GPIO_PORTAN;__asm();Buffer[m][36]=MCF_GPIO_PORTAN;__asm();Buffer[m][37]=MCF_GPIO_PORTAN;__asm();Buffer[m][38]=MCF_GPIO_PORTAN;__asm();Buffer[m][39]=MCF_GPIO_PORTAN;__asm();
        Buffer[m][40]=MCF_GPIO_PORTAN;__asm();Buffer[m][41]=MCF_GPIO_PORTAN;__asm();Buffer[m][42]=MCF_GPIO_PORTAN;__asm();Buffer[m][43]=MCF_GPIO_PORTAN;__asm();Buffer[m][44]=MCF_GPIO_PORTAN;__asm();
        Buffer[m][45]=MCF_GPIO_PORTAN;__asm();Buffer[m][46]=MCF_GPIO_PORTAN;__asm();Buffer[m][47]=MCF_GPIO_PORTAN;__asm();Buffer[m][48]=MCF_GPIO_PORTAN;__asm();Buffer[m][49]=MCF_GPIO_PORTAN;__asm();
        Buffer[m][50]=MCF_GPIO_PORTAN;__asm();Buffer[m][51]=MCF_GPIO_PORTAN;__asm();Buffer[m][52]=MCF_GPIO_PORTAN;__asm();Buffer[m][53]=MCF_GPIO_PORTAN;__asm();Buffer[m][54]=MCF_GPIO_PORTAN;__asm();
        Buffer[m][55]=MCF_GPIO_PORTAN;__asm();Buffer[m][56]=MCF_GPIO_PORTAN;__asm();Buffer[m][57]=MCF_GPIO_PORTAN;__asm();Buffer[m][58]=MCF_GPIO_PORTAN;__asm();Buffer[m][59]=MCF_GPIO_PORTAN;__asm();
        Buffer[m][60]=MCF_GPIO_PORTAN;__asm();Buffer[m][61]=MCF_GPIO_PORTAN;__asm();Buffer[m][62]=MCF_GPIO_PORTAN;__asm();Buffer[m][63]=MCF_GPIO_PORTAN;__asm();Buffer[m][64]=MCF_GPIO_PORTAN;__asm();
        Buffer[m][65]=MCF_GPIO_PORTAN;__asm();Buffer[m][66]=MCF_GPIO_PORTAN;__asm();Buffer[m][67]=MCF_GPIO_PORTAN;__asm();Buffer[m][68]=MCF_GPIO_PORTAN;__asm();Buffer[m][69]=MCF_GPIO_PORTAN;__asm();
        Buffer[m][70]=MCF_GPIO_PORTAN;__asm();Buffer[m][71]=MCF_GPIO_PORTAN;__asm();Buffer[m][72]=MCF_GPIO_PORTAN;__asm();Buffer[m][73]=MCF_GPIO_PORTAN;__asm();Buffer[m][74]=MCF_GPIO_PORTAN;__asm();
        Buffer[m][75]=MCF_GPIO_PORTAN;__asm();Buffer[m][76]=MCF_GPIO_PORTAN;__asm();Buffer[m][77]=MCF_GPIO_PORTAN;__asm();Buffer[m][78]=MCF_GPIO_PORTAN;__asm();Buffer[m][79]=MCF_GPIO_PORTAN;__asm();
        Buffer[m][80]=MCF_GPIO_PORTAN;__asm();Buffer[m][81]=MCF_GPIO_PORTAN;__asm();Buffer[m][82]=MCF_GPIO_PORTAN;__asm();Buffer[m][83]=MCF_GPIO_PORTAN;__asm();Buffer[m][84]=MCF_GPIO_PORTAN;__asm();
        Buffer[m][85]=MCF_GPIO_PORTAN;__asm();Buffer[m][86]=MCF_GPIO_PORTAN;__asm();Buffer[m][87]=MCF_GPIO_PORTAN;__asm();Buffer[m][88]=MCF_GPIO_PORTAN;__asm();Buffer[m][89]=MCF_GPIO_PORTAN;__asm();
        Buffer[m][90]=MCF_GPIO_PORTAN;__asm();Buffer[m][91]=MCF_GPIO_PORTAN;__asm();Buffer[m][92]=MCF_GPIO_PORTAN;__asm();Buffer[m][93]=MCF_GPIO_PORTAN;__asm();Buffer[m][94]=MCF_GPIO_PORTAN;__asm();
        Buffer[m][95]=MCF_GPIO_PORTAN;__asm();Buffer[m][96]=MCF_GPIO_PORTAN;__asm();Buffer[m][97]=MCF_GPIO_PORTAN;__asm();Buffer[m][98]=MCF_GPIO_PORTAN;__asm();Buffer[m][99]=MCF_GPIO_PORTAN;__asm();
        Buffer[m][100]=MCF_GPIO_PORTAN;__asm();Buffer[m][101]=MCF_GPIO_PORTAN;__asm();Buffer[m][102]=MCF_GPIO_PORTAN;__asm();Buffer[m][103]=MCF_GPIO_PORTAN;__asm();Buffer[m][104]=MCF_GPIO_PORTAN;__asm();
        Buffer[m][105]=MCF_GPIO_PORTAN;__asm();Buffer[m][106]=MCF_GPIO_PORTAN;__asm();Buffer[m][107]=MCF_GPIO_PORTAN;__asm();Buffer[m][108]=MCF_GPIO_PORTAN;__asm();Buffer[m][109]=MCF_GPIO_PORTAN;__asm();
        Buffer[m][110]=MCF_GPIO_PORTAN;__asm();Buffer[m][111]=MCF_GPIO_PORTAN;__asm();Buffer[m][112]=MCF_GPIO_PORTAN;__asm();Buffer[m][113]=MCF_GPIO_PORTAN;__asm();Buffer[m][114]=MCF_GPIO_PORTAN;__asm();
        Buffer[m][115]=MCF_GPIO_PORTAN;__asm();Buffer[m][116]=MCF_GPIO_PORTAN;__asm();Buffer[m][117]=MCF_GPIO_PORTAN;__asm();Buffer[m][118]=MCF_GPIO_PORTAN;__asm();Buffer[m][119]=MCF_GPIO_PORTAN;

   
        
  
   }
hang++;               
   m++;
}


/*************************************************************/
/*                        场中断处理函数                     */
/*************************************************************/
__declspec(interrupt) void EPORT_irq1_handler(void)//场中断
{
   MCF_PWM_PWMDTY(0)=0;
             MCF_EPORT_EPFR|=MCF_EPORT_EPFR_EPF1;              //场中断清楚,以便于下次的场中断的正常进行
             MCF_EPORT_EPFR|=MCF_EPORT_EPFR_EPF3;              //行中断清除,以便于开始采集图像数据
            
             m=0;                      //行中间变量清零,以便于开始从把采集的图像放到数组的第一行
             Line=0;                   //行中断临时变量清零
             hang=0;                   //行临时变量清除
            // SampleFlag=~SampleFlag;   //场中断标记取反,这样只采集奇数场的图像
            MCF_EPORT_EPIER |=MCF_EPORT_EPIER_EPIE3;
}

65

主题

230

帖子

0

精华

常驻嘉宾

Rank: 8Rank: 8

积分
3035
威望
1039
贡献
1528
兑换币
428
注册时间
2012-12-6
在线时间
234 小时
2#
发表于 2013-4-30 18:21:58 | 只看该作者
中断向量表没改
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

关于我们|联系我们|小黑屋|智能车制作 ( 黑ICP备2022002344号

GMT+8, 2024-9-21 04:21 , Processed in 0.044655 second(s), 32 queries , Gzip On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表