Search found 69 matches

by v923z
Sun May 13, 2018 5:36 pm
Forum: General Discussion and Questions
Topic: accessing REPL via pyserial
Replies: 13
Views: 1934

Re: accessing REPL via pyserial

OK, then it is probably a question of what is "invoking" the REPL in the first place. pyboard does not, but any serial terminal does. I see that this issue is probably not related to the board as such, but to the software on the computer.
by v923z
Thu May 10, 2018 7:35 pm
Forum: General Discussion and Questions
Topic: accessing REPL via pyserial
Replies: 13
Views: 1934

Re: accessing REPL via pyserial

In the REPL, each statement you execute is evaluated and if the return value from the statement is not equal to None, then the result is printed. Consider the following: >>> def foo(): ... print('Hey there') ... return 42 ... >>> foo() Hey there 42 >>> def foo2(): ... print('Another print') ... ret...
by v923z
Mon May 07, 2018 7:37 pm
Forum: General Discussion and Questions
Topic: accessing REPL via pyserial
Replies: 13
Views: 1934

Re: accessing REPL via pyserial

pyserial reads the data from the serial port. It does not print that data out anywhere. Any of the terminal programs will read data from the serial port and print it to stdout. If you try the python miniterm.py, then you'll see that it does the same thing. For example, here's a really simple serial...
by v923z
Sat May 05, 2018 4:38 pm
Forum: General Discussion and Questions
Topic: accessing REPL via pyserial
Replies: 13
Views: 1934

Re: accessing REPL via pyserial

pythoncoder wrote:
Sat May 05, 2018 5:14 am
Have you seen miniterm.py? This works well on the PC with MicroPython targets.
Thanks for the pointer, Peter! This works. Now I've just got to figure out, why ;)

Cheers,

Zoltán
by v923z
Fri May 04, 2018 7:46 pm
Forum: General Discussion and Questions
Topic: accessing REPL via pyserial
Replies: 13
Views: 1934

Re: accessing REPL via pyserial

Hi Dave, Thanks for the comments. At the more fundamental level, the question really is, why pyserial devours the output of REPL, while e.g., screen does not. My problem is not that I can't save the output of print, but why I have to use print in the first place. In other words, is it possible to em...
by v923z
Fri May 04, 2018 7:26 pm
Forum: General Discussion and Questions
Topic: accessing REPL via pyserial
Replies: 13
Views: 1934

accessing REPL via pyserial

Hi all, I think, the answer to my question is rather trivial, the snag is, I don't know what it is. In short, I would like to use the REPL from python, meaning that I would like to open the serial port on the PC from python, and then put the instructions on the serial line. This works fine till I en...
by v923z
Thu Jan 18, 2018 8:12 pm
Forum: MicroPython pyboard
Topic: counting external events
Replies: 2
Views: 602

Re: counting external events

Fantastic, many thanks, Dave! Indeed, one has to go to the bit level settings of the hardware. In any case, brilliant example, not only for the frequency counter, but also for the low-level manipulation of the hardware.
by v923z
Thu Jan 18, 2018 7:57 pm
Forum: MicroPython pyboard
Topic: counting external events
Replies: 2
Views: 602

counting external events

Hi all, On the pyboard, is it possible to set up any of the pins to count external events? I know that I can do that with interrupts, but what if the count rate is so high that interrupts are no longer a viable option? I would basically like to use the hardware counter, and the chip supports that, b...
by v923z
Thu Nov 16, 2017 7:40 am
Forum: MicroPython pyboard
Topic: is the 32-kHz crystal necessary?
Replies: 2
Views: 760

Re: is the 32-kHz crystal necessary?

The firmware will try to autodetect the presense of an external 32kHz crystal (LSE). If the LSE fails to start then the firmware will fallback to the LSI setting (internal osc). So, to answer your question, if you remove the crystal and use the pre-complied PYBv1.x firmware then it will (or at leas...
by v923z
Wed Nov 15, 2017 10:01 pm
Forum: MicroPython pyboard
Topic: is the 32-kHz crystal necessary?
Replies: 2
Views: 760

is the 32-kHz crystal necessary?

Hi all, If I don't care about the RTC, do I need the 32-kHz crystal on the pyboard? I have to make my own board, because the pyboard is just a tad large, and I would like to strip everything that is not required. On the pyboard lite this crystal is optional. Apart from the target, and as far as the ...