
The Cerebellum supports a subset of the Intel 16-bit Hex Format for use in downloading code onto the main PIC. Files generated by common compilers and/or Microchip's MPASM tool are in this format. The files are easily recognizable by the postfix '.HEX'.
Example hex file:
:1000000000308A0081280000FF00030E8301A10058
:100010000A08A0008A010408A2007708A300780853
:10002000A4007908A5007A08A6007B08A70083131E
...
:1001A0008316061083120614D928831606118312AB
:1001B00006150430B500FA30B6006E20B50BDB280A
:0401C0009C28630014
:02400E00FA3F77
:00000001FF
;PIC16F877
Line Format
- Line Indicator
- Each data line begins with ':', indicating the start of data. A ';' usually indicates a comment. Comments are ignored by the Cerebellum programmer.
- Data Length
- The first two characters indicate the data length, in hex(0x10 in this case, or 16 bytes). Only even numbers are supported, as the Cerebellum programmer writes data words(pairs of bytes).
- Data Address
- The next four characters indicate the data address of the start of the data block. This is twice the actual data address, as the PIC is actually addressed in words, not bytes. For example, address '0x400E' is actually references memory location '0x2007'.
- Data Type
- The next two characters give the data type. The two supported types are:
- '00' - Data
- '01' - End of File
- Data Block
- Then comes the actual data, in little endian format. So the hex value '0x3FFA' is written 'FA3F'. There are as many bytes of data as indicated in the length field.
- Checksum
- The last two characters are the checksum. The sum of all bytes(except the ':') + checksum = 0.
|
|

