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.
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.
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.
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.
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.