The PIC24 and dsPIC33 port

Author:
Bryan A. Jones

Purpose

This is a sample project that demonstrates the use of PyMite on the PIC24 and dsPIC33 family of microcontrollers. Any PIC with at least 128 KiB of program memory and 4 KiB of RAM can run PyMite.

Details

This sample project demonstrates a simple use case of python-on-a-chip (p14p) on a microcontroller. The file main.c is used to initialize p14p and indicate the name of the module it should run. In this case, it will run the module main.py.

In the module main.py, we see that the program prints a "Hello world" message, defines and runs an initialization function and then executes ipm.

Additional sample code in sample_lib.py illustrates use of the PIC24/dsPIC33 library. The program robot.py gives code to operate a simple robot.

Building the Project

First, install Cygwin, manually selecting installation of make. To build documentation, install docutils and Doxygen.

Open the p14p.mcp project file with the Microchip MPLAB IDE then build the project. However, you must have the path to Cygwin's make.exe in your Windows path for this to work.

Alternatively, you can compile from the command line. Start with a clean PyMite tree. Edit src/platform/pic24/Makefile near line 14 to set the part number of your PIC. Then, execute the following at the command prompt, which will build the PyMite VM archive as well as the sample application.

    $ cd src/platform/pic24
    $ make

Flashing the Binary

The steps above result in the binary file that need to go on the PIC. Use a PICKit2/3 to program your PIC.

Generated on Mon Oct 18 07:40:49 2010 for Python-on-a-chip by  doxygen 1.5.9