Interrupt handling in 8 bit controller

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Interrupt handling in 8 bit controller

Jump to solution
450 Views
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.

Labels (1)
Tags (1)
0 Kudos
1 Solution
319 Views
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

View solution in original post

0 Kudos
1 Reply
320 Views
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 Kudos