7 posts / 0 new
Last post
Rony
Offline
Last seen:4 years 11 months ago
Master
Joined:2014-05-15 15:02
ADC timings

We are using the ADC to measure P0.0, P0.2, P0.3 and the 3v battery.
For the battery we are initializing the adc to 3x attenuation and for the rest initializing without the attenuation.
Our measurements are not consistent and I am afraid that our timing is not correct.
So please tell me:
1.ti多少me should I wait between adc_init to adc_enable_channel?
2. How much time to wait between adc_enable_channel to adc_get_sample?
3. Do I have to call adc_disable?
Thanks

Device:
MT_dialog
Offline
Last seen:3 months 1 day ago
Staff
Joined:2015-06-08 11:34
Hi Rony,

Hi Rony,

1 - There is no need for delays between adc_init and the adc_enable_channel.

2 - In case when a 3x attenuator is used you have to wait for about 1us else no delays.

3 - You mean if you should call adc_disable between measuremnts ? no

Thanks MT_dialog

Rony
Offline
Last seen:4 years 11 months ago
Master
Joined:2014-05-15 15:02
So if I understand correctly

So if I understand correctly can this be the sequence?

adc_init (GP_ADC_SE GP_ADC_SIGN 0);
adc_enable_channel(ADC_CHANNEL_P02);
t2=adc_get_sample();
adc_enable_channel(ADC_CHANNEL_P01);
t1=adc_get_sample();
adc_enable_channel(ADC_CHANNEL_P03);
t3=adc_get_sample();
adc_init(GP_ADC_SE, GP_ADC_SIGN,GP_ADC_ATTN3X);
adc_usDelay(1);
adc_enable_channel(ADC_CHANNEL_VBAT3V);
tb=adc_get_sample();

Thanks

MT_dialog
Offline
Last seen:3 months 1 day ago
Staff
Joined:2015-06-08 11:34
Hi Rony,

Hi Rony,

Yes, please give it a try.

Thanks MT_dialog

Rony
Offline
Last seen:4 years 11 months ago
Master
Joined:2014-05-15 15:02
OK.

OK.
BTW why in the battery example you have a 20 microsec delay?

MT_dialog
Offline
Last seen:3 months 1 day ago
Staff
Joined:2015-06-08 11:34
Hi Rony,

Hi Rony,

Indeed we have this delay in the peripheral_examples project, i will raise an internal ticket for the team to take a look i will let you know as soon as i 've got some feedback.

Thanks MT_dialog.

Rony
Offline
Last seen:4 years 11 months ago
Master
Joined:2014-05-15 15:02
Thanks

Thanks