ADC Pin Question

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
Post Reply
JimTal001
Posts: 176
Joined: Thu Jul 30, 2015 4:59 pm

ADC Pin Question

Post by JimTal001 » Thu Sep 24, 2015 8:09 pm

I'm Powering a breadboard with the pyboard 3.3 V and Gnd pins and reading an analog value on pin X11. The adc value read was incorrect (checked with multimeter). Using the same code I switched to pin X19 and the adc value read is correct. The difference between the adc values read on X11 and X19 is near a factor of 2 (1202 and 2169).

Question: is there something special I need to do to make X1-X8 and X11-X12 read more accurately?

Reason: I have a need for 7 adc pins for analog and there are only 4 shielded ones (X19 - X22).

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: ADC Pin Question

Post by dhylands » Thu Sep 24, 2015 8:28 pm

What code were you using to read the ADC?

What device do you have connected to the input?

JimTal001
Posts: 176
Joined: Thu Jul 30, 2015 4:59 pm

Re: ADC Pin Question

Post by JimTal001 » Thu Sep 24, 2015 8:53 pm

:o just realized I was using
adc = ADC(Pin('X11')) rather than adc = ADC(Pin('Y11'))

wasted hours on that issue.

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: ADC Pin Question

Post by dhylands » Thu Sep 24, 2015 9:33 pm

Don't feel bad, - I've done things just as bad....

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: ADC Pin Question

Post by pythoncoder » Fri Sep 25, 2015 6:46 am

You guys aren't alone - I've just spent the best part of a day tracking down an "obscure bug" which turned out to be a pin header one pin short of the mating socket :oops:

He who never made a mistake never made anything.
Peter Hinch
Index to my micropython libraries.

Post Reply