HEX FILE converter



Use SPARKFUN bootloader with the MikroElektronika compilers




SPARFUN Bootloader  is usable with the 16F88 under reserve to comply with certain rules. Some compilers produce an HEX file which is not recognized as valid by the SPARKFUN downloader although these rules are complied with. This utility will enable you to put HEX file in a format which makes it possible to be recognized by the bootloader.

First Stage: The problem

The bootloader checks that no code is present at addresses 1, 2 and 3 of page 0 of memory, failing this it will announce by an error message that the code is not compatible with the bootloader. Some compilers, as those of mikroelektronika fill this zone during construction of HEX file with values 3FFF which correspond to an empty zone. Others, do not assign any value to this zone.
The utility that I propose here will modify the structure of HEX file to remove the codes observers with the prohibited addresses if they are equal to 3FFF. It is a question most of the time of analyzing the line of code to address 0 and of converting it into two lines.

Second Stage: TRANSLATOR utility

Translator is easy to use, point file HEX to be modified then click on 'Translate' and the program will replace HEX file by a new HEX file bearing the same name but in conformity with the specifications of the SPARKFUN bootloader. Then you can launch Screamer v14 to download the program in the PIC.

To download the program: TRANSLATOR
This program was downloaded
003124 time.

The current version is version 1.0, it has to evolve.

Third Stage: Example in PASCAL language with MikroPascal

Here the structure of a program in PASCAL language written with MikroPascal which will function with the bootloader agter modifying HEX file with the translator:

The same program could be tested on a processor of series 16F87X by removing lines 9 and 10.

Fourth Stage: Example in BASIC language with MikroBasic

The structure of a program in BASIC is identical in its principle, here an example written below for MikroPascal:

These programs function without problems with SPARKFUN bootloader.