Hi Sagar,
The S12GA48 may measure external analog voltages at 12 port AD pins when LQFP 48 package or bigger is selected. The number of available port AD pins may be limited for smaller packages.
The multiplexor inside ATD module is driven per ATD control registers (ATDCTL0~ATDCTL5) setting.
The ATD conversion sequence may be configured one for three options:
- Measure one sample at single ATD channel
- Measure multiple samples at single ATD channel
- Measure one sample at multiple ATD channels
The digital values are stored into ATD data registers ATDDR0~ATDDR11 (for 12 channel ATD module).
If FIFO bit is 0 (default case), ATDDR0 register contains the first value from conversion sequence and next ATDDRx registers are filed subsequently by next ATD samples/channels.
In basic, you should configure ATDCTL0~ATDCTL5 registers while writing into ATDCTL5 register also works as measurement trigger (if an external trigger is not used). After that, you should wait for conversion end and read ATDDR0~ATDDRx registers.
The simple ATD example code may be downloaded for example here:
https://community.nxp.com/docs/DOC-93792
I hope it helps you.
Have a great day,
Radek
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------