Page 1 of 1

Analog reading is up to 1.8v only?

Posted: Tue Sep 06, 2016 3:56 am
by saulo
Hi guys, i was trying to read an pressure sensor with output of 0.2 to 3.3v months ago, after some annoying hours of head breaking (i have access to an reference pressure sensor to comparison), i give up.. now i open again the documentation and i see that the AD from pyb is up to 1.8v?

I need a voltage divider now?

Re: Analog reading is up to 1.8v only?

Posted: Tue Sep 06, 2016 4:12 am
by dhylands
The analog inputs on the pyboard are good up to 3.3v. Why do you think that its only good to 1.8v?

Re: Analog reading is up to 1.8v only?

Posted: Tue Sep 06, 2016 6:32 pm
by saulo
dhylands wrote:The analog inputs on the pyboard are good up to 3.3v. Why do you think that its only good to 1.8v?
yes, i read that on http://docs.micropython.org/en/latest/p ... b.ADC.html

but yesterday i was making a kicad component for pyb shield and i saw this library as well:

It have an warning for voltages: http://docs.micropython.org/en/latest/p ... adcchannel

This can justify why my measurements after conversion was mismatched with reference, but i have to check which lib i've used (i'm working, later i will check that).

Anyway, do you know why using Machine lib it can only read up to 1.8v and with pyb lib can be up 3.3v? Or i misunderstood something?

Re: Analog reading is up to 1.8v only?

Posted: Tue Sep 06, 2016 7:30 pm
by dhylands
I think that warning only applies to the WiPy (hint: only the WiPy has pins named like GP4) and should only be included in the WiPy specific documentation.

I think that when the machine docs were first written, only the WiPy implemented it. Now that there are several implementations, the docs need to be updated to reflect that its a WiPy specific warning.

For the pyboard, the warning should probably be that ADC is limited to 3.3v even though its a 5v tolerant pin for digital I/O.

Re: Analog reading is up to 1.8v only?

Posted: Tue Sep 06, 2016 11:37 pm
by saulo
dhylands wrote:I think that warning only applies to the WiPy (hint: only the WiPy has pins named like GP4) and should only be included in the WiPy specific documentation.

I think that when the machine docs were first written, only the WiPy implemented it. Now that there are several implementations, the docs need to be updated to reflect that its a WiPy specific warning.

For the pyboard, the warning should probably be that ADC is limited to 3.3v even though its a 5v tolerant pin for digital I/O.
Ok, got it! thanks dhylands! Sadly i don't know all the micropython ecosystem yet, but i can help to find those "conflicts" (like VBACK and VBAT differences between pybv1 and pybv1.1 "confusion") and send some reports to an email or something like that..

Re: Analog reading is up to 1.8v only?

Posted: Wed Sep 07, 2016 3:43 am
by dhylands
Sending a PR to fix it would be better :)