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,806件の閲覧回数
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,018件の閲覧回数
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 件の賞賛
返信