4 ms·
pyMCU - The Python Controlled Microcontroller
- Baliw 14y agoVery cool stuff. I always wanted to pick up PIC embedded programming, but always had too many other things in Python to play with. Now it seems I wouldn't have to learn a new language. I wonder how well this stacks up with hand written PIC code. What's the coolest thing you've done with a PIC?
- jrockway 14y agoWhy not just use a Raspberry Pi? This device doesn't actually run Python, it's just an interface between USB and I/O pins like the Bus Pirate (which is also controllable with Python).
- Baliw 14y agoCorrect me if I'm wrong, I don't have any experience with a Raspberry Pi, but wouldn't the end result from this be able to be embedded in a much smaller form factor than a Raspberry Pi? This looks like mainly a test board. Would one be able to take the end result of this and program a production PIC board with it? Seems like that might be useful for smaller form factors than what a Raspberry Pi is capable of.
- jmaygarden 14y agoNo. This thing doesn't do anything of use without a host PC connected over USB to control it.
- jrockway 14y agoIf you want to write production embedded code, you have two choices: C and assembly. That's the result of my extensive research, anyway: gcj doesn't work, the AVR forth implementation uses too much flash and can brick your chip at runtime (for other reasons), etc.
- watchdogtimer 14y agoYou can also program 8+bit PICs in JAL, a Pascal-like language.
- jmaygarden 14y agoDefinitely keep in mind that this thing needs to be connected to a host PC over USB to do anything. You are not actually programming the PIC and then having it do stuff on it's own. The pyMCU folks probably program the PIC in C or BASIC, and you would just be using the provided firmware.
- mkhattab 14y agoThis looks cool. It's unfortunate that it's Python-controlled rather than Python programmable. It uses a PIC16, so you'd probably have to throw out essentially all of Python's dynamic features. At that point, one might want to stick with Arduino or PIC Basic stamp. I think a Lisp programmable uC would be infinitely cool, but again using these types of uC you would have to forgo the dynamic features.
- duskwuff 14y agoPossibly of interest: Pycorn. It's a project a friend of mine is working on to port a Python interpreter to bare-metal ARM. https://github.com/tornewuff/pycorn https://github.com/tornewuff/pycorn From what I understand, though, it requires quite a bit more memory than is available on most microcontrollers. 64KB isn't enough for Python to even start up, let alone do anything useful.
- jwatte 14y agoI think the Cortex M4s that are coming out have 512 kB and up in their bigger variants. They also have more MHz and MIPS, and just need a cheap board available. The TI Stellaris Launchpad is looking good in this direction.
- duskwuff 14y agoThe Stellaris tops out at 96KB SRAM (and the part on the Launchpad is 32KB). I'd be interested to know what parts you're looking at, as right now I'm looking into building an SPI-based RAM expander for the Stellaris board. Regardless, I believe Torne was saying that Python ends up needing a few megabytes to work. So you still pretty much end up needing something with external RAM.
- Symmetry 14y agoWhen I first saw the link I was hoping it was a hardware python interpreter, sort of like what the Reduceron does for Haskell. http://www.cs.york.ac.uk/fp/reduceron/ http://www.cs.york.ac.uk/fp/reduceron/
- kqr2 14y agoAlso check out pymite: http://wiki.python.org/moin/PyMite http://wiki.python.org/moin/PyMite PyMite is a flyweight Python interpreter written from scratch to execute on 8-bit and larger microcontrollers with resources as limited as 64 KiB of program memory (flash) and 4 KiB of RAM. PyMite supports a subset of the Python 2.5 syntax and can execute a subset of the Python 2.5 bytecodes. PyMite can also be compiled, tested and executed on a desktop computer.
- haldean 14y agoThis sounds like it's a bunch of GPIO ports connected to a PC over serial, and a nice Python module that runs on the PC. It's not Python-on-a-microcontroller (they never claim it is, but that's the assumption I made upon seeing the website). For those who want this sort of thing, it's also easy to get an Arduino, write a quick sketch that receives and transmits over USB serial, and use pyserial to control it.
- jwatte 14y agoExactly my reaction. You can run Python actually ON a Raspberry Pi, btw. That device is just not as robust on GPIO (5V destroys it, weak current source.)
- orangethirty 14y agoYes, good point. Though getting an RPi these days is quite a chore. Its backordered until hell freezes over.
- Schwolop 14y agoMy preference for this style of thing is the series of controllers, sensors, and actuators made by TinkerForge. They use the same style of USB daemon to talk to the microcontroller(s), but there are then bindings in Python, C#, C++, Java, Perl, etc, etc. They also have more 'stuff' available to add (IMUs, I/O, motor controllers, all many of sensors, video controllers, etc.) I've no idea why they're not more popular. Low marketing budget I'd guess...