The microcontroller runs a program, and like every other piece of software this program has bugs and missing features. So you might want to update this program as new versions comes out.
This tutorial describes how to update the firmware in the Firebee's PIC microcontroller using a PICkit2 programmer with Linux. The same tool exists for OSX and this guide should apply for OSX as well.
PICkit 2 pin # | Firebee pin # |
1 | 4 |
2 | 6 |
3 | 1 |
4 | 3 |
5 | 2 |
6 | 5 |
For debian and derived systems (like Ubuntu) you can also download it here.
pk2cmd -?V
You should now get a response similar to this:
Executable Version: 1.20.00
Device File Version: 1.55.00
OS Firmware Version: 2.32.00
If not, something's wrong. You might not have access to the USB port as a user, try to run pk2cmd as root ("sudo pk2cmd...") instead. If that doesn't help it's time to google.
Now check that the programmer is correctly connected to your Firebee and recognise the PIC:
pk2cmd -P
pk2cmd will now try to detect the type of PIC in your Firebee. The following is the correct response:
Auto-Detect: Found part PIC18F4520.
If this is what you got you're fine. If not, check that the cable is wired and connected correctly. If the cable is OK but still not the response above, consult google.
Now it's time to flash the PIC:
pk2cmd -PPIC18F4520 -M -F/home/joska/Prosjekt/Firebee/firebee_pic-20120308.hex
Change the path to the firmware to the correct one on your system. For some reason pk2cmd needs a complete path, so "-Ffirebee_pic-20120308.hex" won't work even if you're in the same directory as the firmware.
When pk2cmd is finished you should verify that the programming went ok:
pk2cmd -PPIC18F4520 -Y -F/home/joska/Prosjekt/Firebee/firebee_pic-20120308.hex
This will compare the specified file with the contents of the PIC's flash memory. You should now get this response:
Verify Succeeded.
PICkit 2 Verify Report
14-12-2013, 21:42:41
Device Type: PIC18F4520
If not (very unlikely), try programming the chip again.