Analog reading is up to 1.8v only?

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
User avatar
saulo
Posts: 16
Joined: Thu May 26, 2016 9:05 am
Location: Brasil

Analog reading is up to 1.8v only?

Post by saulo » Tue Sep 06, 2016 3:56 am

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?

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

Re: Analog reading is up to 1.8v only?

Post by dhylands » Tue Sep 06, 2016 4:12 am

The analog inputs on the pyboard are good up to 3.3v. Why do you think that its only good to 1.8v?

User avatar
saulo
Posts: 16
Joined: Thu May 26, 2016 9:05 am
Location: Brasil

Re: Analog reading is up to 1.8v only?

Post by saulo » Tue Sep 06, 2016 6:32 pm

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?

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

Re: Analog reading is up to 1.8v only?

Post by dhylands » Tue Sep 06, 2016 7:30 pm

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.

User avatar
saulo
Posts: 16
Joined: Thu May 26, 2016 9:05 am
Location: Brasil

Re: Analog reading is up to 1.8v only?

Post by saulo » Tue Sep 06, 2016 11:37 pm

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..

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

Re: Analog reading is up to 1.8v only?

Post by dhylands » Wed Sep 07, 2016 3:43 am

Sending a PR to fix it would be better :)

Post Reply