Page 1 of 1

unix port machine.UART

Posted: Wed Feb 22, 2017 7:48 am
by corleo
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

Re: unix port machine.UART

Posted: Mon Apr 10, 2017 5:24 am
by pfalcon
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

Re: unix port machine.UART

Posted: Mon Jul 10, 2017 3:32 pm
by pmp-p
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.

Re: unix port machine.UART

Posted: Tue Jul 11, 2017 8:29 pm
by dhylands
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.