How to access multiplexed ADC channels in S12GA48 MCU ?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to access multiplexed ADC channels in S12GA48 MCU ?

ソリューションへジャンプ
910件の閲覧回数
sagardhavali
Contributor III

Hi All,

 

In one of our application, I need to have 10 ADC channels. I can use AN0 to AN7 for first 8 channels. As per reference manual, one can use multiplexed port AD pins. I would like to know how can I use them?
1. What registers should be initialized ?
2. Which register can I read to get the digital data?

 

Thanks in advance.

 

- Sagar

ラベル(1)
タグ(3)
0 件の賞賛
返信
1 解決策
713件の閲覧回数
RadekS
NXP Employee
NXP Employee

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:

  1. Measure one sample at single ATD channel
  2. Measure multiple samples at single ATD channel
  3. 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!
-----------------------------------------------------------------------------------------------------------------------

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
714件の閲覧回数
RadekS
NXP Employee
NXP Employee

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:

  1. Measure one sample at single ATD channel
  2. Measure multiple samples at single ATD channel
  3. 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!
-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛
返信