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

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

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

1,798 次查看
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  

标签 (1)
0 项奖励
回复
1 回复

1,010 次查看
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 项奖励
回复