Reply
Posts: 135
Registered: ‎12-06-2016
Accepted Solution

ADC Example for BGM111/113

[ Edited ]

Sorry I'm little confused.

in one end there is written Vref. min 1V.

On the other side >= 0,7 V.

The same with the Vref-Int. 1,25 and 2,5 Volt.

The BG have 0,78 / 0,83 V.

 

I use the BGM113 with Vdd = 3.3 V.

I have to messure 0,11 ...0,25 V with the ADC.

So I want to adjust the Vref as little as possible ( 0,7V ? ).

I want to use the VBGR or better VBGRLOW.

 

How do I have to set: VREFATTFIX , VREFATT , and what ever else ?

 

I want to make radiometric messurement.

Can I get the internal Vref on a pin with less then 1mA ? Or better on a OP.

How ?

Or can I get the same if I make a 2. messurment on the V-Mess ?

 

Thanks

arnold

Posts: 2,510
Registered: ‎09-01-2015

Re: ADC Example for BGM111/113

Hello,

 

I'm moving this post to the 32-bit MCU forum because I think the guys over there know better how to configure the ADC.

 

Posts: 229
Registered: ‎08-16-2012

Re: ADC Example for BGM111/113

The latest AN0021 application note section 3.7 (with software example in section 5.13) has all the information you need.

The AN0021 can download from the link below.

http://www.silabs.com/support/resources.ct-application-notes.ct-example-code

 

My views are my own and do not necessarily represent the views of Silicon Labs
Posts: 135
Registered: ‎12-06-2016

Re: ADC Example for BGM111/113

That is exactly where my problems start with.

May be my English is not good enough.

 

That is where my post came from. May be it is written there ?

But may be not everybody understand it if he is not an expert with this chip yet !

 

Looks like the dilema with the egg and the chicken.


amenleung wrote:

The latest AN0021 application note section 3.7 (with software example in section 5.13) has all the information you need.

The AN0021 can download from the link below.

http://www.silabs.com/support/resources.ct-application-notes.ct-example-code

 


 

Posts: 229
Registered: ‎08-16-2012

Re: ADC Example for BGM111/113

Section 3.7 (Advanced full-scale voltage configuration) is used if the internal reference (1.25V, 2.5V, AVDD...) can't meet your requirement.

 

In according to AN0021 section 3.7 point 3:
Configure the VREFATTFIX and VREFATT bit fields in the ADCn_SINGLECTRLX or ADCn_SCANCTRLX register to ensure that the reference voltage at the ADC (= VREF x ATTVREF) is between 0.7 V and 1.05 V (column 3 on AN0021 Table 3.10).

 

In according to AN0021 section 3.7, it should select VBGRLOW (0.78V) as the voltage reference source for minimum VFS as below.
VFS = 2 x 0.78 x 1 / (15/12) = 1.248V = +/-0.624V differential

It can't output the internal reference to a pin.

What are OP and V-Mess mean? 

My views are my own and do not necessarily represent the views of Silicon Labs
Posts: 135
Registered: ‎12-06-2016

Re: ADC Example for BGM111/113

Thanks for your answer.

 

So do I understand right:

1. There are 1.25, 2.5, 5.0, AVDD ( the Analog power I think ) and Vref-ext unscaled as reference.

    ( REF = 0 ... 6 )

2. ( REF = 7 ) I can control the VRef from different sources.

    ONLY 1, 2, 5 are with a attenuation factor.

    Ref 0.83 and 0.78 are here WITHOUT a attenuation factor !?

3. VREFFATTFIX = 0 => Vref = VREFSEL ( 1,2 or 5 ) / VREFFATT.

    VREFFATTFIX = 1 => Vref = VREFSEL ( 1,2 or 5 ) / ( 1/3 or 1/4 depending on VREFFATT )

   

So far I can understand.

 

1. BUT in the docu AN0021 is written, that 0.78 and 0.83 can be used with an factor too.

    I can not read this from the EFR32xG1 - Datasheet.

2. In AN0021 is written something about ( VREF x ATTVREF ) between 0.7 ... 1.05V

    IT IS NOT CLEAR, what exactly that mean.

3. Is VREFFATT member of N = { 0, 1, 2 ... } ?

4. IT IS NOT CLEAR from the datasheet if VREFFATT is also aktiv if VREFFATTFIX = 1 ?

5. I DON'T find any data about the Vref after the Scalling with VREFFATT and VREFFATTFIX.

    There are ony max. values. Not minimum. 

    I have a analog value of 0.1 to 0.3 V can I scale down Vref to 0.3 V ?

    What is the minimum ? 

6. I find in the datasheet also an attenuation factor for Vin. What does this exacly mean ?

    IS IT Vin / VINATT ?  VINATT member of N = { 0, 1, 2 ... } ?

    IS VREFFATTFIX olso in the result of Vin ? The exaple 24.2 in the datasheet is very unclear.

    But the Vin must still be under VINmax I think ?

    Is there any lose in result if I use VINATT ?

    What is the use of this ? Makes only sence in scanning from a low Vref with different Vin.

    But I can't adjust it for different chanels. So what for do I neet it ?

    So VINATT = 1 for unchanged Vin ?

 

Sorry your documentation is often very difficult to understand.

So I have to bather somebody.

Thanks a lot and best regards

arnold

Posts: 135
Registered: ‎12-06-2016

Re: ADC Example for BGM111/113

Sorry I forgot something:

 

can I use VREFSEL = VREFPNWATT also for single ended Vin ?

I have switch to GND and I want to eliminate the error over this switch.

So I want to put VrefN over this switch ( some mV over GND )

and VrefP on the other side of the sensor with ( 0.1 ... 0.3 V ).

 

Posts: 229
Registered: ‎08-16-2012

Re: ADC Example for BGM111/113

#1 & #2
It is correct.

 

#3
For VREFATTFIX = 0
Vref = VREFSEL * ATTVREF (see AN0021 table 3.9 column 4-5 on how to calculate ATTVREF from VREFATT)
For VREFATTFIX = 1
Vref = VREFSEL * ATTVREF (where ATTVREF = 1/3 or 1/4, see AN0021 table 3.9 column 2-3)

 

The main point here is the reference voltage (Vref) above must meet the condition below (point 3 in procedure of AN0021 section 3.7).
Configure VREFATTFIX and VREFATT so that the reference voltage at the ADC is between 0.7 and 1.05V.

 

#1
Where you get such information in AN0021?

 

#2
See #3 above.

 

#3
VREFATT can be 0-15.

 

#4
If VREFATTFIX = 1, there is only two options for VREFATT, it is =0 or >0 (1-15).
What do you mean aktiv?

 

#5
As metioned before the Vref = VREFSEL * ATTVREF must be 0.7 - 1.05V so 0.3V is an invalid value.
The range (VFS) on scaling Vref is determined by the formula below in AN0021.
VFS (full scale voltage) = (2 × VREFSEL × ATTVREF)/ATTVIN
The VREFSEL x ATTVREF must be 0.7 - 1.05V and ATTVIN maximum is 15/12 so the VFS minimum is 2 x 0.7/(15/12) = 1.12V.

 

#6
The VIN attenuation factor (ATTVIN) is used to widen the available input range of the ADC beyond the reference source and determined by VINATT bit field (see formula in #5).

There is no example in datasheet, what is 24.2? Do you mean example in EFR32 reference manual?

 

You need to calculate the VFS for the selected reference (VREFSEL) with attenuation factors and use it for ADC conversion.
You can get some examples of VFS configuration on AN0021 table 3.10 and similar information can be found on EFR32 reference manual section 24.3.6.2.

My views are my own and do not necessarily represent the views of Silicon Labs
Posts: 135
Registered: ‎12-06-2016

Re: ADC Example for BGM111/113

#1: 3.7 Point 2. Select the ....  ( no reference to only 1,2,5 )

Thanks I start to better understand the chip.

 

 

#4  IT IS NOT CLEAR from the datasheet if VREFFATT is also aktiv if VREFFATTFIX = 1 ?

      ===>  if VREFFATTFIX = 1 is VREFFATT also aktiv as attenuation factor or not ( =  1/1 )?

    

#5 The VREFSEL x ATTVREF must be 0.7 - 1.05V and ATTVIN maximum is 15/12 so the VFS minimum 

      is 2 x 0.7/(15/12) = 1.12V.  ===> 15 ist the VREFFAT I think, but were does the 12 come from ?

      ----

      The same with the example:

      ATTVref = (VREFFATT + 6) / 24 for VREFFATT < 13, and (VREFFATT-3)/12 for VREFFATT >= 13

      Where das the +6, /24, -3 and /12 come from. There is nothing in the register description.

      Is it just like this depenting on VREFFATT, or do I get this factors from somewhere else ?

 

      VFS (full scale voltage) = (2 × VREFSEL × ATTVREF)/ATTVIN ( so ATTVIN is >= 3 ? )

      OR IS ATTVIN allways:  ATTVIN / 12 ?

 

#6  s. Attachment in EFR32 datasheet.

 

Verry very difficult to understand.

I have a external ref of 1.25 V and a signal < 0,3 V.

If you don't mind, just give me the best parameters for the registers before I get complet grazy about this stuff.

Posts: 229
Registered: ‎08-16-2012

Re: ADC Example for BGM111/113

#4
Can you explain what is aktiv?
For VREFATTFIX = 1, ATTVREF = 1/3 for VREFATT = 1-15 (>0), ATTVREF = 1/4 for VREFATT = 0.

 

#5
The 15 is the VINATT, not VREFATT.
The 12 comes from the definition of ATTVIN, see column 6 of table 3.9.
The +6, /24, -3 and /12 are hardcoded and they can't change.
You can find the related description on EFR32 reference manual (Rev 0.6) section 24.3.6.2.
ATTVIN = VINATT/12, where VINATT = 3 to 15.

 

#6
This is reference manual, not datasheet.

 

The advanced full-scale voltage configuration is used to tailor make your own VFS but the minimum VFS can't < 1V.
So this is what you need if you want to scale down the VFS to ~0.3V to measure signal <0.3V.

My views are my own and do not necessarily represent the views of Silicon Labs
Posts: 135
Registered: ‎12-06-2016

Re: ADC Example for BGM111/113

thanks again.

 

I have a 1,25 ext. reference. A put on EXT_P and EXT_N but I only messure single chanel.

on adcPosSelAPORT4XCH7.

 

I use:

VINATT = 12

VREFATT = 13

VREFATTFIX = 0

VREFSEL  = 5

 

does this make sense ?

Or is there a better for my messurment ?

Posts: 229
Registered: ‎08-16-2012

Re: ADC Example for BGM111/113

I miss the NOT in my last post, it should be:
So this is NOT what you need if you want to scale down the VFS to ~0.3V to measure signal <0.3V.

 

Why you don't use REF = 4 (EXTSINGLE) or 0 (internal 1V25) in SINGLECTRL register for your measurement?

 

Why you don't use VREFSEL = 2 (REF = 7) for single ended external reference?
As I mentioned before, the Vref should be 0.7 - 1.05V regardless the VREFSEL is 1, 2, or 5.
So the VFS in your case will be (Vref = 1.25 x 10/12 = 1.042V is within 0.7 - 1.05V):
VFS = 2 x 1.25 x (10/12) / (12/12) = 2.08V = +/-1.04V differential

 

This VFS is higher than your original 1.25V reference.
So I suggest you to use REF = 4 (EXTSINGLE) or 0 (internal 1V25) for your measurement.

My views are my own and do not necessarily represent the views of Silicon Labs
Posts: 135
Registered: ‎12-06-2016

Re: ADC Example for BGM111/113

Sorry took some time ,I had an business apointment in an other country.

 

I want to messure radiometric and I have to shut down the messument current because of limited baterie resources.

I use a fet down to GND and with Vext_N on top of the fet I will eliminate all errors across the fet.

So the Vext-P - Vext-N is just across the resistor and the Sensor ( Pt 100...1000 ) in line.

The 1,24 Volt Ref. ist a standart we use on many aplications.

Posts: 135
Registered: ‎12-06-2016

Re: ADC Example for BGM111/113

I use the single 1,25V internal Ref. ( BGM113 on Gecko board )

I put both Analog Inputs ( pos, neg ) on VSS and I read 0....3

What could I do wrong ?

 

Thanks

arnold

 

Highlighted
Posts: 135
Registered: ‎12-06-2016

Re: ADC Example for BGM111/113

for POSSEL are several modes. I don't find a description for ervery ?

source: EFR32BG1B_adc.h

 

#define _ADC_SINGLECTRL_POSSEL_AVDD                     OK
#define _ADC_SINGLECTRL_POSSEL_BU                             ?
#define _ADC_SINGLECTRL_POSSEL_AREG                        ?
#define _ADC_SINGLECTRL_POSSEL_VREGOUTPA            ?
#define _ADC_SINGLECTRL_POSSEL_PDBU                        ?
#define _ADC_SINGLECTRL_POSSEL_IO0                             ?
#define _ADC_SINGLECTRL_POSSEL_IO1                             ?
#define _ADC_SINGLECTRL_POSSEL_VSP                           ?
#define _ADC_SINGLECTRL_POSSEL_OPA2                         ?
#define _ADC_SINGLECTRL_POSSEL_TEMP                      OK
#define _ADC_SINGLECTRL_POSSEL_DAC0OUT0             OK
#define _ADC_SINGLECTRL_POSSEL_TESTP                        ?
#define _ADC_SINGLECTRL_POSSEL_SP1                             ?
#define _ADC_SINGLECTRL_POSSEL_SP2                             ?
#define _ADC_SINGLECTRL_POSSEL_DAC0OUT1              not available on EFR
#define _ADC_SINGLECTRL_POSSEL_SUBLSB                      ?
#define _ADC_SINGLECTRL_POSSEL_OPA3                           ?
#define _ADC_SINGLECTRL_POSSEL_DEFAULT                    ?
#define _ADC_SINGLECTRL_POSSEL_VSS                           OK

Posts: 190
Registered: ‎11-04-2014

Re: ADC Example for BGM111/113

Hello,

 

Please refer to the EFR32xG1 Reference Manual (http://www.silabs.com/documents/public/reference-manuals/EFR32xG1-ReferenceManual.pdf) for additional information on the available values for the POSSEL bitfield in the ADCn_SINGLECTRL register (section 24.5.4 in the current version).  You can see that some of these options are listed as "Reserved for future expansion".  You can consult the relevant sections of chapter 24 for additional detail on the various input configurations available with the ADC.

 

Best regards,

- Phillip

Posts: 135
Registered: ‎12-06-2016

Re: ADC Example for BGM111/113

Ok, thanks.

most is for future use.

 

But what is: DECOUPLE, IOVDD, SUBLSB ?

 

OPA I think means operational amplifier, which the EFR don't have ?

 

regards

arnold

Posts: 190
Registered: ‎11-04-2014

Re: ADC Example for BGM111/113

Hello,

 

Please see the "ADC Overview" graphic (Figure 24.1 in the current version) in the "Functional Description" section (currently, 24.3) of the Ref Manual ADC chapter.  It depicts DECOUPLE and IOVDD as two of the available input options to the vdd_mux, which sources one of the inp_mux options.  These voltage nets are available as inputs to the ADC via this mechanism.

 

The register map for POSSEL I referenced previously denotes the OPA options as "Not Applicable if no OPA is available."

 

I will get more information on the SUBLSB option and post it here.

 

Best regards,

- Phillip

 

 

Posts: 135
Registered: ‎12-06-2016

Re: ADC Example for BGM111/113

of course I have seen it.

my problem was, what is DECOUPLE and IOVDD ?

Ok I found it in 11.3.4

 

DECOUPLE = Low Voltage Digital Suply

IOVDD = IO Supply

Posts: 190
Registered: ‎11-04-2014

Re: ADC Example for BGM111/113

I've confirmed that the SUBLSB is an error - mentions of this option will be removed in subsequent updates.

 

Best regards,

- Phillip