GoodFET firmware on the Telos B reveals the Flash chip.
[goodfet] / firmware / apps / pic / README.txt
1 PIC programmer
2 March-May 2010.
3
4 Scott Livingston  <slivingston AT caltech.edu>
5
6
7 Currently targeted at 16-bit PIC chip families (i.e., PIC24F,
8 dsPIC30F, PIC24H, dsPIC33F) and tested on
9
10 dsPIC33FJ128GP710,
11 dsPIC33FJ128GP708,
12 PIC24HJ12GP201.
13
14 Expansion in the 8-bit and 32-bit directions is in the works.
15
16
17 For the 14-pin GoodFET port (size 2x7), the pinout is
18 3 -> PGD
19 5 -> !MCLR
20 7 -> PGC
21 2 -> Vcc
22 9 -> GND
23
24 Programming is done over a protocol similar to 2-wire SPI (i.e., MOSI
25 and MISO are combined into a single data line), where the GoodFET is
26 the master. Currently only ICSP is supported, i.e., the programming
27 executive (similar to a bootstrap loader in other architectures) is
28 ignored, if present. Note that dsPIC33F/PIC24H chips seem to ship
29 without the programming executive present. Confer Microchip document
30 "dsPIC33F/PIC24H Flash Programming Specification" (DS70152G).
31
32 When receiving from (resp. replying to) host, data on the PGD line is
33 latched (resp. written) by the dsPIC33f/PIC24H chip on the rising edge
34 of PGC. A statement to this effect appears as a note in section 5.3,
35 Chapter 5, of the dsPIC33F/PIC24H Flash Programming Spec.
36
37 In the dsPIC33F/PIC24H flash programming spec, there is a typo
38 regarding verification of the presence of the programming
39 executive. In Section 5.11, it is stated that an Application ID of
40 0xBB indicates the programming executive is resident. As of 4 April
41 2010, the correct App ID is 0xCB, as listed later in the spec
42 document, Section 7 "Device ID". To dump the device and application
43 IDs and hardware revision number of an attached dsPIC33F/PIC24H chip,
44 use the goodfet.pic client:
45
46 $ ./goodfet.pic devid
47
48
49 Much more documentation is needed for the programmer and is
50 forthcoming. For now, here are some quick examples. To bulk erase program
51 memory (this is necessary before programming),
52
53 $ ./goodfet.pic erase
54
55 Then to program the device with a code file, foo.hex,
56
57 $ ./goodfet.pic program foo.hex
58
59 To verify programming results,
60
61 $ ./goodfet.pic verify foo.hex
62
63 Please note that only addresses in given hex file are verified. A
64 quick visual check of results might be a dump of the first few
65 instruction words.
66
67 $ ./goodfet.pic - 0x200 0x220 pretty
68
69 This command prints (24-bit width) contents of program memory at
70 addresses 0x200 through 0x220 to stdout.
71
72
73 For setting up your development environment, I suggest matt's article
74 on installing Microchip's GCC port for dsPIC/PIC24 microcontrollers
75 under GNU/Linux (and almost certainly extends to other Unix-like
76 environments):
77
78 http://www.electricrock.co.nz/blog/2009/08/installing-microchips-c-compiler-for-pic24-mcus-and-dspic-dscs-c30-on-ubuntu-9-04/
79
80 The port is called C30 by Microchip.