This code is used to Covert Hex file to Txt file, so you can easily extract hex bytes into array in 'txt' file.
- First you need to understand Intel Hex Format
- This code is simple just open the hex file:
- Reads every line byte by byte.
- Check the number of data bytes in this line and reads these data.
- Store these data in the output txt file which i named OutputArray.txt and fill the reset of bytes by 0xFF until the code size is equivlent to const integer * PAGE_SIZE in ATmega-16. The Page size in AVR is 128 bytes = 64 word.
- The OutputArray.txt file contains the Data bytes of the Application code, Code size, and number of pages needed for this code in the flash memory.