Can I set the ADC to use the 3.3V supply (or a voltage supplied on a pin) for Vref on the pyboard in Micropython?
Many thanks,
Bernhard
ADC Vref
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: ADC Vref
My understanding is that the ADC uses the 3.3V supply for the reference.
The 64 pin package version of the MCU used on the Pyboard doesn't bring Vref+ or Vref- out to pins.
According to the hardware datasheet (P133), "1. V REF+ and V REF– inputs are both available on UFBGA176. V REF+ is also available on LQFP100, LQFP144, and LQFP176. When V REF+ and V REF– are not available, they are internally connected to V DDA and V SSA ."
So it's defined in hardware and cannot be changed. However you can use the ADC to read the reference voltage and thus determine the voltage of the Vdd supply. This enables you to correct for ADC read errors caused by lack of accuracy in the 3.3V supply. The docs describe how to do this.
The 64 pin package version of the MCU used on the Pyboard doesn't bring Vref+ or Vref- out to pins.
According to the hardware datasheet (P133), "1. V REF+ and V REF– inputs are both available on UFBGA176. V REF+ is also available on LQFP100, LQFP144, and LQFP176. When V REF+ and V REF– are not available, they are internally connected to V DDA and V SSA ."
So it's defined in hardware and cannot be changed. However you can use the ADC to read the reference voltage and thus determine the voltage of the Vdd supply. This enables you to correct for ADC read errors caused by lack of accuracy in the 3.3V supply. The docs describe how to do this.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: ADC Vref
I see, the internal reference is only and input, it is never applied to the ADC Vref, which is 3.3V. Exactly what I need for ratiometric readout.
2nd Question: Apparently adc.read_timed is blocking? Are interrupts still served?
Thanks!
Bernhard
2nd Question: Apparently adc.read_timed is blocking? Are interrupts still served?
Thanks!
Bernhard
Bernhard Boser
Re: ADC Vref
You can make a cut or extract L1 and connect VDDA to a High Precision Vref 3.3V, powering with V+ (5V). IDDA is only 0.5mA, max 0.85mA. Then, ADC, DAC and Vref are working with high precision 3300mV +-0.1% which in common is needed for useful measurements instead of estimates with accuracy ..+-4%!
Reading Vref and corrections with it is a funny idea for the next Nobel Prize in Physical Science (...)
Reading Vref and corrections with it is a funny idea for the next Nobel Prize in Physical Science (...)
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: ADC Vref
adc.read_timed is blocking. As far as I can see the code doesn't disable interrupts.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.