unix port machine.UART

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
corleo
Posts: 2
Joined: Sun Nov 13, 2016 4:55 am

unix port machine.UART

Postby corleo » Wed Feb 22, 2017 7:48 am

Hello, everyone!
Does upython unix port really have a 'machine' module with all this classes listed in its doc at http://docs.micropython.org/en/latest/u ... ml#classes ? Because when I try to 'import machine' at unix repl I get "ImportError: no module named 'machine'" and the 'umachine' module has only mem8, mem16, mem32, PinBase and time_pulse_us...

I'm using today's version "MicroPython v1.8.7-320-gda6dbc80 on 2017-02-22". So there is something I can do to use UART in unix port?

Thank you,
Corleo

pfalcon
Posts: 952
Joined: Fri Feb 28, 2014 2:05 pm

Re: unix port machine.UART

Postby pfalcon » Mon Apr 10, 2017 5:24 am

corleo wrote:Hello, everyone!
Does upython unix port really have a 'machine' module with all this classes listed in its doc at http://docs.micropython.org/en/latest/u ... ml#classes ?


Please read the introduction to the libraries in the documentation: http://docs.micropython.org/en/latest/u ... index.html

Because when I try to 'import machine' at unix repl I get "ImportError: no module named 'machine'"


Per the documentation above, the next step would be checking micropython-lib...

and the 'umachine' module has only mem8, mem16, mem32, PinBase and time_pulse_us...

I'm using today's version "MicroPython v1.8.7-320-gda6dbc80 on 2017-02-22". So there is something I can do to use UART in unix port?


Unix port provides standard "tty" module and that's the most straightforward way to do that. There's also pyserial work-alike: https://github.com/pfalcon/micropython-serial

pmp-p
Posts: 1
Joined: Mon Apr 24, 2017 12:45 am

Re: unix port machine.UART

Postby pmp-p » Mon Jul 10, 2017 3:32 pm

Hi, would be nice if someone still remember how to do deal with LPT port as gpio and bind that to umachine on unix port, as you can still find DB25 breakout boards around.

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

Re: unix port machine.UART

Postby dhylands » Tue Jul 11, 2017 8:29 pm

There are C libraries which do that: http://parapin.sourceforge.net/ and there is a CPython library called pyparallel:
https://pypi.python.org/pypi/pyparallel/ that you could look at to see if it might be ported to MicroPython.


Return to “Programs, Libraries and Tools”

Who is online

Users browsing this forum: No registered users and 1 guest