Need ADC demo guidelines

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Need ADC demo guidelines

1,010 Views
garimaparashar
Contributor III

Hi.,

I am beginner in ADC.

I am working with demo project of ADC. It is working perfectly but I want some information about ADC demo.

1. What is Sample need to trigger event in ADC_INIT_CHANNEL_STRUCT?? If I am increasing it then reading of ADC output seems fast...!! I dont understand that logic.

2. Why Event is required?

3. What is the purpose of Circular buffer size? Is it doing some kind of averaging?? What I need to do to get average output (..Not Manually).

4. If reference voltage is 3.31V (I measured with Multimeter) then is it possible to give more that 3.31V as input say 10V.

5. What is Formula that is converting Analog input Voltage into 16bit Digital output ?

- I read that Max Rang of Vin is (VREFH * 31/32) from K60P144M120SF3.pdf (SnapShot attached).

Actually I am trying to figure it out. I read MQXIOUG, TWR‐K60D100M, K60P144M120SF3.  But I am helpless. Cant get brief idea.

Can someone help me to sort this out. I am so much confused..:smileysad:

0 Kudos
6 Replies

662 Views
david_diaz
NXP Employee
NXP Employee

Hello Garima,

Regarding your questions 4 and 5:

4. For proper conversion, the input voltage must fall between the reference voltages: VREFH and VREFL.

If the input is equal to or exceeds VREFH, the converter circuit converts the signal to 0xFFF.

Besides, the VREF must not exceed the VDDA value.

5. As an example, if the ADC resolution is 3, the Less Significant Bit is set as follow:

adc.JPG

Based on the figure, depends of the analog input, there is a corresponding digital output.

In order to get more information about the ADC, please refer to the following link:

https://community.freescale.com/docs/DOC-103932

Hope this information will be useful for you.

Have a great day.

David

662 Views
garimaparashar
Contributor III

Hi David,

Thanks for giving brief idea.

There is one more question I want to ask. If my input voltage is say 5V (beyond the range of Vdda) then how to input this?

Is there any Idea?

Regards,

Garima

0 Kudos

662 Views
DavidS
NXP Employee
NXP Employee

Hi Garima,

Use a voltage divider to reduce 5V to 3.3V.

Reference:

Voltage Dividers - learn.sparkfun.com

Regards,

David

0 Kudos

662 Views
soledad
NXP Employee
NXP Employee

Hello Garima,

Could you please let me know the MQX version you are using??

Regards

Sol

0 Kudos

662 Views
garimaparashar
Contributor III

Hi Sol,

I am working on CodeWarrior v10.6 and of MQX v4.0.

0 Kudos

662 Views
utsavikalpesh
Contributor V

Hi,

I dont know about the rest questions.

But In response to do averaging, I read ADC_CHANNEL_ACCUMULATE and I tried some trial and error and found that, by setting ADC_CHANNEL_ACCUMULATE flag in ADC_INIT_CHANNEL_STRUCT, it will do sum of all number_samples( Not averaging ).

I wait for _lweven then reading output.

And to do average I will divide data.result (that is a sum of  sampled outputs) by  number_samples. And I get Average ADC output.

I dont know whether this is a right method or wrong...but what I am facing is, whether I am waiting for events or not, it will take a same conversion time..!! Why ? If my code works fine without _lwevent then why I need to wait for Event (seen from  ADC_CHANNEL_ACCUMULATE )  ? 

Or is there any other method to do averaging?

How to set  ADC peripheral in ADC IP integrate HW arithmetic averaging? Any Idea?

Please help

Regards,

Utsavi

0 Kudos