BCM20732S ADC Configuration

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
thj_2192231
Level 2
Level 2
First like received First like given

The HW App Note explains how to use the adc_readVoltage() function to get the voltage seen on a known ADC input channel. This function returns a voltage in mV, and therefore resolution is limited.

In my application I would need the get the ADC output code, so that I can get all 16 bits of resolution. Your API provides the adc_readSampleRaw() function but I don't know what reference is used and how to change it. Ideally I would like to be able to either use Vddio as the voltage reference, or a pin of the module. Is this possible ? In addition, should an ADC calibration be performed before calling adc_readSampleRaw() ? Any information on how to configure the ADC and use this function (reference, output code format, etc.) would be useful.

Thanks in advance.

1 Solution
asridharan
Employee
Employee
10 comments on KBA 5 comments on KBA First comment on KBA

Though the ADC reads 16 bit samples, the ENOB depends on the sample rate. In the default configuration (sampled at 5.859KHz), you will get 13 ENOB while at 187 KHz, you will get 10 ENOB.

> I don't know what reference is used and how to change it

The default reference is the internal bandgap and voltage range is set to 0-3.6V. You can change the reference the ADC uses to an eternal reference using adc_adcCalibrate(<EXTERNAL_REFERENCE_VOLTAGE_IN_MICRO_VOLTS>, <EXTERNAL_REFERENCE_ADC_CHANNEL>). The reference channel could also be ADC_INPUT_VDDIO or ADC_INPUT_VDD_CORE (in which case reference will be 1.2V - the output of the LDO). You should then be able to use adc_readVoltage() to read any other input channel.

View solution in original post

5 Replies
asridharan
Employee
Employee
10 comments on KBA 5 comments on KBA First comment on KBA

Though the ADC reads 16 bit samples, the ENOB depends on the sample rate. In the default configuration (sampled at 5.859KHz), you will get 13 ENOB while at 187 KHz, you will get 10 ENOB.

> I don't know what reference is used and how to change it

The default reference is the internal bandgap and voltage range is set to 0-3.6V. You can change the reference the ADC uses to an eternal reference using adc_adcCalibrate(<EXTERNAL_REFERENCE_VOLTAGE_IN_MICRO_VOLTS>, <EXTERNAL_REFERENCE_ADC_CHANNEL>). The reference channel could also be ADC_INPUT_VDDIO or ADC_INPUT_VDD_CORE (in which case reference will be 1.2V - the output of the LDO). You should then be able to use adc_readVoltage() to read any other input channel.

Thanks for the prompt reply.

What is the output code format of adc_readSampleRaw() ? For an input voltage between GND and Vref, I'm getting readings between -1150 and 25570. Should any calibration be performed ? Is there any ground offset ?

0 Likes

Is there any reason you don't want to use adc_readVoltage()? This already does all the conversions that are needed to give you a voltage between GND and Vio.

I would like to have the highest resolution (13 effective number of bits according to your response above). According to my tests it looks like when using adc_readVoltage() we have less resolution compared to using adc_readSampleRaw().

0 Likes

ADC_INPUT_VSS is GND. So you should be able to read GND and the known reference to calibrate the raw samples. Also try reading ADC_INPUT_VSS between reading samples of the input signal to see if that helps.