Some compiler generates an unsorted HEX file, i.e. the hex code of the main( ) function put before startup and some interrupt code. The current EZ3 makes the number of byte to be sent to the programmer board less than the actual byte. Kurnia Wijaya, my friend lives in Jakarta Indonesia sent me the Window version hex file sorter. I have tested with code produce by some compiler, it's work very nice.
Here is the example hex code, "hello.hex" generated by some commercial C compilers.
We see that the bold lines are the startup code while above two lines should be a main( ) hex code. Of course this hex file is a standard intel hex file. But what happen when invoke send hex file via EZ3 shown below;
The EZ Uploader computes wrong number of byte to be sent, i.e., 18 bytes. It sends only the bold lines. If we see the number of byte in that file, it should be exactly 37 bytes. Each line shows number of byte, i.e., 10H, 03, 03 and 0FH, totally is 16+3+3+15 = 37 bytes. See illustration of HEX file here Understanding Intel Hex File.
Kurnia Wijaya found such BUG of Easy-Downloader when he used the Easy-Downloader with his C compiler. He got a very good idea to write a program used to sort the line by sequencing from the low addressing to higher. It's work very nice with Easy-Downloader.
Here is the source program written with Delphi 5, source.zip and the sorter program is here HexSort.exe
After using Kurnia's Sorter, see the sorted hex code in "hello1.hex" below;
When invoke Send button with "hello1.hex" again see below;
See above, the number of byte that sent to the programmer board is now corrected, i.e., 37 bytes.
I hope this contributed work by Kurnia Wijaya will enable the use of simple programmer with many compilers. Some compiler may generates say 16-bit intel HEX file, now we knew the limitation of the EZ3, then we may write the program to convert such hex code into appropriate hex file for the Easy-Downloader easily. I shall provide next time, the description of communication protocol between programmer board and host PC, then you may write your own uploader software that fixes any BUG then. Please wait and see.
This is our style, I means hobbyist not a professional, just for fun and happy for building the circuit at home. Try a simple method but produce a very nice output. You know, Simple is Beautiful!
I'm so glad for his help, thanks so much Kurnia Wijaya. You may reach him via email@example.com
updated 27 Nov 2543