|
Hi-Tech introduces Hexmate for its PIC C Compilers |
|
|
|
Hexmate is a new utility which will be included with all future versions
of the HI-TECH C® compilers (including PICC, PICC-18 and dsPICC).
Essentially, Hexmate is a tool for making modifications to the HEX file
generated by the compiler. Hexmate has many tricks up its sleeves, but
in this article we will focus on one handy feature - embedding serial
numbers.
Often when producing a product, it is necessary for each one
to be uniquely identifiable, ie: have a serial number. Since each unit
will have a different serial number, this means the program memory
image will be different for each unit. This can be done a couple of
different ways. For each unit, re-compile your application and change
only the serial number (impractical), or, compile once then use some
other tool to modify the program image for each unit. This is
where Hexmate can be of use. Hexmate will take your application
hexfile, the serial number you wish to use, the address where you want
the serial number to be stored and will generate a new hex file with
this serial number embedded.
Need more than one serial number? No
problem, Hexmate can insert multiple serial numbers at selectable
address intervals and even increment the number by a selectable amount.
Now if you just need to insert one simple number, then your chip
programmer may already offer this feature. If you need something more
complicated however, then Hexmate is probably up to the task. One
example of this is when used with mid-range PICs. Typically on a
mid-range, PIC constant data is stored as a series of return (RETLW)
instructions allowing only one byte per location. If you are using
serial numbers greater than one byte, this will mean not only dividing
your serial number into bytes but also storing them as instructions - a
feature many chip programmers cannot do but is trivial with Hexmate.
Inserting serial numbers is just one feature of Hexmate. Filling,
replacing, searching and merging Hex files are also possible.
To find out more about Hexmate or to download a free copy, visit the "Interesting Projects and
Tutorials" section of Hi-Tech’s on-line support forums at www.htsoft.com/forum.php
|