Status update: The PyMite embedded Python virtual machine works on the Web Platform now, and can execute Python bytecode. The UART is also working, and bytecode which prints something out, sends this output via the UART to the host. The other peripherals are not yet supportet.
The PIC branch can be checked out here [1]. When compiling, the DANGEROUS_WEB preprocessor macro must be set to get proper config settings for the Web Platform:
-DDANGEROUS_WEB. For your convenience I attached a precompiled firmware image to this post.
When running the firmware, LD1 is constantly blinking to show a "heartbeat" indicating a running mainloop. The current Python program on the PIC reads the input from the UART, evaluates the bytecode, and sends any output back via the UART. The
src\tools\ folder contains
ipm.py which can be used to run an interactive Python session on the PIC. It reads the input, bytecompiles it, sends the bytecode to the PIC, and displays any output. The serial COM port must be specified, and the default baudrate is currently 230400:
D:\home\PyMite\issue_0066_bjones_pic24port\src\tools>ipm.py -s COM8 230400Here is some example output:
ipm> map(range, range(5))
[[], [0], [0, 1], [0, 1, 2], [0, 1, 2, 3]]
ipm> d = {}; d['foo'] = 1; d['bar'] = 'hi'
ipm> d
{'bar':'hi', 'foo':1}
You can watch a 4 minutes lighting talk from PyCon 2009 here [2].
Have fun!
[1]
http://code.google.com/p/python-on-a-chip/source/browse/#svn/branches/issue_0066_bjones_pic24port[2]
http://blip.tv/file/1996853/