Please let me know how to make use of an ADC pin to read a sensor input.
I have taken the following code as reference.
value = HalAdcRead(HAL_ADC_CHANNEL_4, HAL_ADC_RESOLUTION_12);
Will this give 12 bits resolution or 10-bits?
Thanks
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Please let me know how to make use of an ADC pin to read a sensor input.
I have taken the following code as reference.
value = HalAdcRead(HAL_ADC_CHANNEL_4, HAL_ADC_RESOLUTION_12);
Will this give 12 bits resolution or 10-bits?
Thanks
Hi YiKai,
I have done what you suggested, please let me know the accuracy of adc channel is 8-bits or 10-bits, with the resolution selected.
You can refer to register definition ADCCON3 in CC2530 user guide. ADC_RESOLUTION_12 is mapped to 128 decimation rate (9 bits ENOB).
Hello,
to set the adc resolution on the cc2530, should I only set the decimation time or I need something else?
is (0 - AVDD5 the voltage) input for the ADC?
Regards,
Filippo
Hi Filippo,
I don't understand your question. Do you have problem using ADC API in hal_adc.c? Please describe your problem more clearly.
sorry to not be clear.
mine is a foolish question.
is there any set up to be done to select the resolution of the adc?
or it is be done by using the ADC API (HAL_ADC_RESOLUTION_X) where x is the bit resolution?
Hi Flippo,
You only need to set voltage reference by HalAdcSetReference. Then, you can use HalAdcRead.
Thanks!
does Voltage reference is the voltage applied to ADVD 5 pin, that cannot be greater than 3.6, is that right?
Regards,
Filippo