Is is possible to use the ADC interrupt for multiple ADC channels which have different operations?

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

Is is possible to use the ADC interrupt for multiple ADC channels which have different operations?

1,546 Views
admin
Specialist II

Hi. I'm currently working on the ADC interrupt. It seems to me that I can only use it for one ADC channel. I would like to know if I can use the interrupt for different channels. For example, I would like to use ADC channels AD1 and AD5, both having different operations when interrupted. Can I assign a unique interrupt to each of them?

 

I'm using MC9S08AW60 MCU, which only has one vector number for the ADC interrupt. Thx  

Labels (1)
0 Kudos
Reply
1 Reply

758 Views
bigmac
Specialist III

Hello,

 

The ADC module has a single interrupt only, that occurs when the COCO flag becomes set.  With more than one channel in operation, you would need to ascertain the channel associated with the current interrupt, by reading the channel select bits from within the ISR code.  Different courses of action could then be taken for each channel.

 

Regards,

Mac

 

0 Kudos
Reply