Interrupt handling in 8 bit controller

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Interrupt handling in 8 bit controller

跳至解决方案
493 次查看
akashpandey
Contributor II

Hi,

I am using 8 bit freescale controller MC9S08AW16. I am getting problem in interrupt handling,if interrupt occurs simultaneously at 4 input pin then controller can't procees it effectively.i want to execute all interrupt one by one at some time delay.please provide me solution.

标签 (1)
标记 (1)
0 项奖励
回复
1 解答
362 次查看
eckhard
Contributor V

Hello,

I dont think your idea will work. Interrupts are not designed to be handles delayed. So you should set variables into the ISR and then decide in your Program how to handle this. The KBI only has one Interrupt Vector for all pins so if you use it you have to sample all oins at once ( which I think is effektive ). If you want a seperate Interrupt routine for each pin, you could use the Timer channels . Connect your inputs to the Timer channels and use Input Capture. It will give you an Interrupt on the active edge. But once more you should think about your program design. It doesnt make sense to delay Interrupts.

Interrupts are handled by the CPU as they occure, thats the concept of interrupts. You can switch them of to delay them and switch them on to handle the next one but you might miss some interrupts this way.

Eckhard

在原帖中查看解决方案

0 项奖励
回复
1 回复
363 次查看
eckhard
Contributor V

Hello,

I dont think your idea will work. Interrupts are not designed to be handles delayed. So you should set variables into the ISR and then decide in your Program how to handle this. The KBI only has one Interrupt Vector for all pins so if you use it you have to sample all oins at once ( which I think is effektive ). If you want a seperate Interrupt routine for each pin, you could use the Timer channels . Connect your inputs to the Timer channels and use Input Capture. It will give you an Interrupt on the active edge. But once more you should think about your program design. It doesnt make sense to delay Interrupts.

Interrupts are handled by the CPU as they occure, thats the concept of interrupts. You can switch them of to delay them and switch them on to handle the next one but you might miss some interrupts this way.

Eckhard

0 项奖励
回复