Hacker News new | past | comments | ask | show | jobs | submit login
[dupe] Micro Python store is now open and taking pre-orders (micropython.org)
94 points by momentofinertia on Sept 25, 2014 | hide | past | favorite | 29 comments



I have one of these. It's great, especially because you can just fire up a serial session to it and get a REPL.

Here's a little video: https://www.flickr.com/photos/ruicarmo/14877450055/


I wish there was more detailed technical information on the page. I've been trying to figure out how precise the timer is, or at what frequency you can read from the pins. The answer seems to be provided on pages 112+ in the datasheet of the micro controller, but in a not very easy to understand format for the aspiring programmer without EE knowledge.

http://www.st.com/web/catalog/mmc/FM141/SC1169/SS1577/LN1035...


If I recall correctly, at least some of the STM32F4 timers can be clocked at the same frequency as the system clock, so 168MHz maximum.

The GPIOs can be configured with a maximum 100MHz clock, though your software likely cannot read the registers that quickly if it is going to do much else.

EDIT: The reference manual actually contains a lot of the peripheral details, with the datasheet containing the chip specific details, like clock speed and which peripherals are present.

http://www.st.com/stonline/stappl/resourceSelector/app?page=...


Ask somebody on IRC (#micropython on freenode)?


Python for embedded? How micro is micro? What kind of memory footprint are we talking about compared to C? Garbage collection on an embedded controller?


It's a micro version of python so that it can run on embedded devices, this is just a demo board. You can play with the code on your local machine. Differences from CPython are here: https://github.com/micropython/micropython/wiki/Differences


> How micro is micro?

The reference board for Micropython is the Pyboard, which has a 32-bit ARM chip running around 168 MHz and with 192 kB of RAM. It's legitimately the kind of thing that gets called a microcontroller. Quite a bit cheaper and less powerful than for instance a Raspberry Pi. (Though note the Pyboard isn't significantly cheaper than a RasPi, because it's not being manufactured at the same scale).

Regarding memory footprint compared to C, well it's Python. Reading from the Kickstarter page, the interpreter binary is 60 kB and it can run 'hello world' with an additional 4 kB of RAM. And there's memory overhead for Python objects (32 bytes each apart from integers). Garbage collection takes around 4 ms.

I got my Pyboard a few weeks ago when the store was opened to people who expressed interest after the Kickstarter campaign had finished. I haven't pushed it on performance yet, but it's easy to use and it works. It feels strange (but great!) to have Python running on such a limited system.


I can get a full raspberry pi for less than one of these though and run linux with python. Seems less useful/practical for a hobbyist.


The micro python board has a way smaller footprint and consumes less power than a pi. And sometimes, there are projects where a full OS and all the peripherals of the pi are just overkill.

Don't discount this board as useless just because you in particular have no need for it.


I didn't say useless, I said less useful to a hobbyist.


Depends on the hobby. As a controller for a model railway signal box, for instance, or "arduino, but with an easier language" this could be perfect.


This is way cool for weekend hackers. I think I'm most excited about the python prompt. Using arduinos, writing code, compiling and uploading just to debug an input is super annoying. A live console is way cool.


I have a small python library that does this for stock Arduino boards: https://github.com/thearn/Python-Arduino-Command-API

Not quite as cool as the micro python boards though!


Those are some seriously expensive pin headers. Almost comical when compared to the price of the Micro Python board itself, which seems pretty reasonable!


Cheap pin headers are just punched and shoved into nylon housing. They have very little contact with a male connector.

These pin headers are machined and have far better contact with anything plugged in.


To be fair, it's pretty expensive breaking them into chunks and packaging them individually and they're turned pin ones by the looks. This isn't massive production run bags of them.



Very cool board. I wonder how difficult it would be to port the software to other ARM boards like an Arduino Due or Teensy 3.1.


Its cool. But a language like Go would be much better suitable for these microcontrollers.


This criticism has no content. You like Go better, that's fine. But that doesn't mean it would be "more suitable" for these microcontrollers, because the whole point of these is to run a dialect of Python, which is novel. If you want to write in a low-level language there are already many microcontrollers you can trivially program in C or whatever.


Go binaries are too large for microcontrollers, you'd need some cut down version. Hello World comes out to ~500k on its own see: (shameless self link) https://donatstudios.com/Golang-Binary-Sizes


"It's cool. But a language like C would be much better suitable for these microcontrollers."

When you realize why the above doesn't sound right to you, then you'll realize why your sentence doesn't sound right to the rest of us.


Well, writing in Go is just as nice as writing in Python in my opinion. But I understand the whole point of these are to support python. Thats ok.


Can you elaborate on this? I'd like the understand what you mean.


First of all, if you want to use python, use it. However go is imho more suitable since

- Python doesnt do parallel programming well, Go does (and low level programming is often async) - Go compiles to machinecode already (it will be faster, which is often important on lowend hardware) - Go is just as nice to write in as in Python (!debateable i know!)

So all in all, python doesnt seem a right fit.


Why?


Presumably because Go is hip, new, favoured by people on HN for some reason, etc. ?

The attitude that once a new language comes out we need to drop all the old ones is not very helpful. Python is used by many, many people (more than Go, I'd venture) and having it available in something like this instead of having to work with Arduino and others which can be less user-friendly is spectacular.


I'm a python developer myself. I just started with Go. I'm just saying that Go fits microcontrollers better. Its cool to use Python. It doesn't matter much.

I'm just saying that cool would also have been a good fit.


Actually you said "much better suitable for these microcontrollers" which you haven't explained yet. I think that's why you're getting these comments. I don't use GO, and think the Rasberry Pi is better than this thing anyway.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: