ADC_Get_Sample

General discussion on mikroBasic PRO for PIC.
Post Reply
Author
Message
RichardHirst
Posts: 35
Joined: 08 Feb 2007 11:25

ADC_Get_Sample

#1 Post by RichardHirst » 15 May 2010 08:50

Can someone please tell me what the 'ADC_Get_Sample' does..?


Thanks

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: ADC_Get_Sample

#2 Post by filip » 18 May 2010 09:02

Hi,

ADC_Get_Sample routine, like its name says, is used to acquire samples from analog input and convert them into digital form.

The difference between the ADC_Get_Sample and ADC_Read routines is in the following :

1. ADC_Read routine initializes ADC module and reads desired analog input every time it is called.
2. ADC_Get_Sample just reads desired analog input without initialization of the ADC module.

So, ADC_Read consumes more power and time, because it initializes ADC module each time it is called.

To avoid this, you can initialize ADC module by calling ADC_Init once, and then use ADC_Get_Sample every time it is necessary to acquire samples from analog input.

Regards,
Filip.

Kalain
Posts: 1093
Joined: 11 Mar 2005 18:26
Location: Aubenas, France

Re: ADC_Get_Sample

#3 Post by Kalain » 18 May 2010 09:10

filip wrote:Hi,

ADC_Get_Sample routine, like its name says, is used to acquire samples from analog input and convert them into digital form.

The difference between the ADC_Get_Sample and ADC_Read routines is in the following :

1. ADC_Read routine initializes ADC module and reads desired analog input every time it is called.
2. ADC_Get_Sample just reads desired analog input without initialization of the ADC module.

So, ADC_Read consumes more power and time, because it initializes ADC module each time it is called.

To avoid this, you can initialize ADC module by calling ADC_Init once, and then use ADC_Get_Sample every time it is necessary to acquire samples from analog input.

Regards,
Filip.
I also wondered about ADC_Get_Sample instruction but didn't find in help file some explanations about diffrences from ADC_Read instruction.

These clear and complete instructions should be added in help file.$ to explain diffrence between ADC_Get_Sample and ADC_read instructions.
Alain

wiseman
Posts: 3
Joined: 21 Jul 2016 09:53

Re: ADC_Get_Sample

#4 Post by wiseman » 26 Jul 2016 16:42

Thanks very much. I realized that when I used Adc_Read() and Adc_Init(), my program worked well on simulation but didn't work upon implementation. Adc_Init() and Adc_Get_Sample() solved the problem.

Post Reply

Return to “mikroBasic PRO for PIC General”