Can someone please tell me what the 'ADC_Get_Sample' does..?
Thanks
ADC_Get_Sample
Re: ADC_Get_Sample
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.
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.
Re: ADC_Get_Sample
I also wondered about ADC_Get_Sample instruction but didn't find in help file some explanations about diffrences from ADC_Read instruction.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.
These clear and complete instructions should be added in help file.$ to explain diffrence between ADC_Get_Sample and ADC_read instructions.
Alain
Re: ADC_Get_Sample
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.