Hi,
I have difficulty in finding one of the information in your data sheet of 16 bit controller MC9S12G128. I am writing the drivers for the Analog to Digital module of 10 bit 12 channel. According to my requirement I need to sample the analog channel 3 when their is a trigger on the pin ETRIG1.
But according to the data sheet information, I could not select both of the ETRIG and channel pins at a time. My question is how to select a channel when their is trigger on the pin ETRIG1. The project is getting delayed because of this issue. I am waiting for your erliest reply.
Channel to sample (or first channel in case you want to sample multiple channels) is selected using Cx bits in ATDCTL5 register. Trigger is selected using ETRIGSEL and ETRIGCHx bits in ATDCTL1 register. Does this answer your question?
Thanks for your reply. But I still want to go in depth of this. If I select ETRIGSEL =1, ETRIGCH[0:3] and CA,CB,CC,CD bit I can select channels. But there is no intrupt flag when we found trigger on the ETRIG pins.
According to my requirement, if there is a positive edge on the pin ETRIG1 then I need to sample the channel 3. But my doubt is how can I synchronise the conversation on channel no 3 with trigger in the pin ETRIG1?
But you have ATD sequence complete interrupt.
Once trigger is enabled, when trigger occurs ATD will convert Cx channel or a seqiemce of channels automatically. It will be synchronous to trigger.