WICED Smart ADC Example
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
The attached app shows sample usage of the ADC hardware built into the 36/37/s chips.
To use the app, load it onto a Tag board that has a push button on P0. Run traces on the board. You'll initially see ~0V, and when you press the button you'll see the applied voltage on the voltage rail (~3300mV).
There are three necessary steps to get the ADC running, as seen in the app:
Import:
#include "adc.h"
Instantiate in create function:
adc_config();
And poll the ADC using the function:
adc_readVoltage(adc_convertGPIOtoADCInput(gpio_number));
*Calibration occurs within the initialization function. However, it may be useful to your application to calibrate the ADC to an external voltage for added assurance, or to do so periodically throughout the run-time of your application. To do so, call the function below: parameter one is the known voltage of the reference source in mV, and parameter two is the location of the reference voltage. The location can be configured to many different buses and all GPIOs (for external sources). Control click the second parameter within the source code to see a complete list of the locations that can be utilized as a reference voltage.
adc_adcCalibrate(2000, ADC_INPUT_VDDIO);
The output of the polling function is in mV.
More info on the ADC:
BCM20737S - ADC Noise-free resolution
Questions related to the ADC implementation on the BCM2073XS...