PyMite: Python-on-a-chip

Posted on Saturday, March 12th, 2011 in Arduino, Chips, code, hacks, PIC by the machinegeek

Python-on-a-Chip (p14p) is a project to develop a reduced Python virtual machine (codenamed PyMite) that runs a significant subset of the Python language on microcontrollers without an OS. The other parts of p14p are the device drivers, high-level libraries and other tools. They’ve released ports for the Microchip PIC/24dcPIC, Teensy 2.0, Arduino Mega and others. Here is their PyCon 2011 Lightning Talk slide presentation.

Some features of PyMite include a memory requirement of roughly 55 KB program memory, supports integers, floats, tuples, lists, dicts, functions, modules, classes, generators, decorators and closures, supports 25 of 29 keywords and 89 of 112 bytecodes from Python 2.6 and is licensed under the GNU GPL ver. 2. However, it lacks a built-in compiler, and does not include any of Python’s libraries. If you know C, Python and how to work with microcontrollers, it might be worth checking out.

This entry was posted on Saturday, March 12th, 2011 at 7:25 pm and is filed under Arduino, Chips, code, hacks, PIC. You can follow any responses to this entry through the RSS 2.0 feed. You can skip to the end and leave a response. Pinging is currently not allowed.

5 Responses to “PyMite: Python-on-a-chip”

  1. J. Peterson says:

    …does not include any of Python’s libraries

    Um, that’s kind of like a car without seats, brakes and a steering wheel.

  2. Ed Marshall says:

    Lack of libraries doesn’t seem like that big of a deal to me; most of them wouldn’t make sense in a micro environment anyway:

    – Anything that touches the filesystem, network, OS, processes, threads, etc
    – Anything linked against external libraries like SQLite, curses, etc
    – Anything dealing with Python internals

    That’s almost the entire standard library ( Most of the modules left after trimming all of that probably aren’t slim enough to work as-is in a tiny environment like this.

    The system requirements are interesting; it’s an exceptionally tight fit on a few of the platforms they’ve implemented. Really cool stuff; I’d love to see what they could come up with if they put their heads together with the PyPy guys. :)

  3. 7 says:

    This is a very good news!

    even without libraries, this is still a very good start.

    I hope python will fully make its way to microcontroller development arena on different microcontrollers, just like C… [maybe in the years to come….]

  4. chuck says:

    according to their new video, (begins at 3:45 in the video)

    the ram requirements (vm initialization) is only 2k? Am I understanding that correctly?

    Also anyone know how a normal python script will control the hardware of a microcontroller?

  5. Alan H says:

    It makes sense if your micro controller has some form of host controlled storage like a USB OTG/Host controller with a stick plugged in or SD card. You could then offer a microcontroller specific Python library and use python as a soft glue for functionality. eg. Write a Python script, plug it into the MCU, and watch it run!

Leave a Reply

Notify me of followup comments via e-mail. You can also subscribe without commenting.

Recent Comments

  • KH: Well, I'm sure the HDD can handle a little vibration *cough*. What I am more interested in is this: the fan appears to be placed...
  • Alan: The Si5351 runs on 3.3V, and several FPGA dev boards now include "Arduino compatible" headers [if you stick to 3.3V logic levels]. Maybe it's time...
  • hli: Sunday++
  • JB: Hi
  • Peter: Sunday