Program the opensensor by ICD2 or PICkit2

To program your software to the opensensor you need to connect a 9 volt battery and the Microchip ICD2 or PICkit2 programming interface to your opensensor. IMPORTANT: It is very important that the nRF905 module is disattached while programming the opensensor.

If you are using the ID2 programmer you only have to do step 1 and 2. Step 3 and forward are for the PICkit2 programmer.

NOTICE: If you are using the PICkit2 programmer you are not able to program the opensensor directly from MPLAB. Instead you need to use the software for the PICkit2 programmer, which will be desribed in step 3 to 5.

Rasmus Jacobsen from Aalborg University has made a howto program the opensensor from Linux using the PICkit2 programmer. This howto can be found here.

Step 1

Before you start programming the opensensor with the ICD2 programmer make sure that the battery and ICD2 programmer is connected to the opensensor and that the nRF905 module is not attached.

Select ICD2 programmer from the Programmer menu to connect to the programmer interface. The output window will show MPLAB ICD 2 Ready.

Step 2

To program your project to the opensensor select Program target device. This will take a minute and when the process is finish the output window will print MPLAB ICD 2 Ready.

Step 3

To program the opensensor by the PICkit2 programmer you need to download and install the PICkit 2 software described here. Before you start the program make sure that  the battery and PICkit2 programmer is connected to the opensensor and the nRF905 is removed (PICkit2 must be connected with the LEDs facing up). When you start the program you will see that the PICkit2 and opensensor was found.

Step 4

To find the compiled code from MPLAB go to the "Import Hex" in the file menu and find your hex file in the project directory. The program will display "Hex file successfully imported" when the file is imported. If  the message "Powered target detected . VDD source set to target." is displayed just select OK.

Step 5

To program the opensensor select "Write". When the box turns green and displays "Programming successful" the opensensor has been programmed correctly.

Department of Electronic Systems | Aalborg University | Niels Jernes Vej 12 | DK-9220 Aalborg | Denmark
Phone: (+45) 9635 8695 | Fax (+45) 9815 1583 | E-mail ies(at)
Copyright © 2006 Department of Electronic Systems

Last update:07-07-2008