打印
[ZLG-ARM]

EINT0下降沿中断

[复制链接]
1543|3
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
想实习去|  楼主 | 2010-6-18 18:35 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
ic, vi, ADDR, AD, DDR
EINT0下降沿中断为什么不断产生?

使用2119;
初始化代码:
void EINT01_Init(void)
{
   EXTMODE     = 0x0d;                        
   EXTPOLAR = 0x00;                        

   VICIntSelect = 0x00000000;         
   VICVectCntl4 = 0x20|14;              
   VICVectAddr4 = (int)IRQ_Eint0;      
   VICIntEnable = 0x00004000;           
   
   VICVectCntl5 = 0x20|16;              
   VICVectAddr5 = (int)IRQ_Eint2;      
   VICIntEnable = 0x00010000;         
   
   VICVectCntl6 = 0x20|17;              
   VICVectAddr6 = (int)IRQ_Eint3;      
   VICIntEnable = 0x00020000;         
   
   EXTINT = 0x0d;                        
   VICVectAddr = 0x00;
}

中断程序:
void   __irq IRQ_Eint0(void)//czd
{
   ....
   EXTINT = 0x01;   
   VICVectAddr = 0x00;
}

发现只要外部电平从高转为低后,只要低电平保持,就一直在产生中断。请教是什么原因?

相关帖子

沙发
无语凝咽| | 2010-6-18 18:36 | 只看该作者
A,你的中断实验成功没我的2100 非向量IRQ中断实验没有成功,C语言的程序有问题,只有汇编程序可以,请问你也是这样吗?

有兴趣的话交个朋友,大家一起学习2100,我的QQ:53772247

使用特权

评论回复
板凳
思行合一| | 2010-6-18 18:37 | 只看该作者
请参看2119的勘误手册
http://www.zlgmcu.com/philips/ARM/lpc2119.asp

使用特权

评论回复
地板
想实习去|  楼主 | 2010-6-18 18:37 | 只看该作者
谢谢,解决了我把相关内容贴在下面:
EXTINT.1 Corruption of VPBDIV via EXTPOLAR or EXTMODE
Introduction: The VPBDIV register controls the rate of the VPB clock in relation to the processor clock.
EXTPOLAR and EXTMODE determine the operating parameters of the external interrupts.
Problem: A write to either the external interrupt polarity register (EXTPOLAR) or the external interrupt mode
register (EXTMODE) will corrupt the VPBDIV register. A read of either EXTPOLAR or EXTMODE
will be corrupted BY the VPBDIV register. If VPBDIV is “1” or “2” prior to any write to EXTPOLAR
or EXTMODE, the CPU will hang up on the write to EXTPOLAR or EXTMODE.
Work-around: If VPBDIV is non-zero, write all zeroes to VPBDIV before reading or writing EXTMODE or
EXTPOLAR, then write the proper value back to VPBDIV. In most applications this is a known and
fixed value, but if there is a possibility of dynamic changes in VPBDIV, software will need to read
VPBDIV, write zero to VPBDIV, read or write EXTMODE and/or EXTPOLAR, and then rewrite the
value previously read from VPBDIV.
EXTINT.2 Incorrect setting of EXTMODE and/or EXTPOLAR register while trying to set them to desired
value
Introduction: EXTPOLAR and EXTMODE determine the operating parameters of the external interrupts.
Problem: As an illustration, trying to set EXTMODE to 0x1 or 0xd would result in EXTMODE to be set to 0x0
instead.
Work-around: This problem is related to EXTINT.1 and hence the same workaround applies with an additional
step.
The steps involved in the configuration of the EXTMODE and/or EXTPOLAR would be as follow:-
1. Write 0x0 to VPBDIV
2. Write the desired value to EXTMODE or EXTPOLAR register
3. Write the same value to VPBDIV (additional step)
4. Restore the VPBDIV to the previously saved value or simply write to the register again with the
desired value.
Code sample for setting EXTMODE and EXTPOLAR to 0x1:
VPBDIV = 0x0; /* EXTMODE */
EXTMODE = 0x1;
VPBDIV = 0x1;
VPBDIV = 0x0; /* EXTPOLAR */
EXTPOLAR = 0x1;
VPBDIV = 0x1;
VPBDIV = 0x0; /* Setting VPBDIV */
Note: While testing this in a debugger environment, please don’t single-step through these steps. A
breakpoint could be placed after Step 4 andyou would see the EXTMODE and EXTPOLAR
registers reflecting the correct values.

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

111

主题

500

帖子

1

粉丝