Program the opensensor in Linux
Thanks to Rasmus Jacobsen from Aalborg University for this howto.
Howto program OpenSensor v3 using PICkit2 with firmware >= 2
Makefile can be downloaded here makefile
The following was performed with PICKit firmware version 2.10.0
First: Be sure that you are a member of the usb group. Otherwise nothing will work.
For ubuntu: you need build-essential and libusb-dev.
Then download pk2cmd for linux from home.pacbell.net/theposts/picmicro/pk2cmdLinux-0.6.tar.gz (check for newer version).
Untar the file and modify cmd_app.cpp.
Go to line 151 and set the string PIC to nothing, e.g. substitute
_TCHAR partString[MAX_PATH] = "PIC";
_TCHAR partString[MAX_PATH] = "";
Uncomment line 39 if you are using Linux 2.6.x
Compile using make.
Now pk2cmd is ready to run!
To install pk2cmd copy
pk2cmd and PK2DeviceFile.dat to /usr/local/bin
To erase/clear the device
./pk2cmd -pdsPIC30F3013 -erase
check that it was erased
./pk2cmd -pdsPIC30F3013 -clear
To program the device type
./pk2cmd -pdsPIC30F3013 -M -Fthe_file_to_program.hex