All,
I am working on a project where I need to write a firmware code to a chips SRAM (Pcap02). The firmware comes in a .hex file. Looks something like this;
00 00 00 7A C0 CF FF F0 D2 43 7A D0 34 72 62 63
00 65 7A C4 D1 43 7A D0 33 AB 5E 42 5C 48 B0 01
20 68 B1 02 78 20 60 B2 01 20 68 B3 1B 7A C2 D1
43 7A DB 33 AB 00 7F 7A D4 43 7A E4 44 7A C3 D1
43 7A DB 33 AB 00 78 20 60 B5 0B 72 62 7F 7A D4
43 7A E4 44 20 60 00 B7 02 78 20 60 84 01 25 80
01 00 00 00 00 00 20 1B 7A C0 D1 43 7A DB 33 AB
00 7F 23 98 84 01 25 80 20 91 43 58 7A C0 D1 43
6A C0 44 7A C4 D1 43 7A D0 3A 66 67 76 77 66 20
1B 7A C0 C0 C0 C8 D2 43 7A DE 44 7A C0 C0 C1 D1
D2 43 7A DD 44 7A C0 C0 C0 C8 D2 41 25 D1 6A D0
43 7A D9 44 6A D1 43 7A DA 44 6A D2 43 7A DB 44
The file is over 500 lines long, see attached if interested.
What I need to do is somehow load the file into an array of bytes in the IDE. However, I am not sure this is possible. Maybe something like
#include file.hex
byte array[] = {file.hex}
I know I can convert the file into an array by rewriting the whole set as
byte array[] = {0x00, 0x00, 0x00, 0x7A, 0xC0, ...
I am just wondering if there is a better way to do this.
Thanks.