Reputation: 941
I have inherited a hex file for a PIC design, which contains the programming for a USB device. Is there a way I can open it in order to find out exactly what it means and how it works? i.e. something beyond the raw hexadecimal digits.
Complete beginner here - is there a documentation manual? Is PIC a language of its own? This shows the 'Code' section is usually the first item: https://www.kanda.com/blog/microcontrollers/pic-microcontrollers/pic-hex-file-format/. Is the Code section human-readable?
Here are the first few lines of one of the hex files:
:020000040000FA
:06000000D8EF17F012001A
:020006001200E6
:0600080025EF14F01200C8
:02000E000004EC
:02001000FFFFF0
:0400120000000000EA
:0600180070EF14F012006D
:02001E000500DB
:1000200073300000DC000000210000001F300000E1
:100030006000000054000000120000001E050000D7
:10004000040000000C30000000000000130000005D
:0C0050000E00000035000000040000005D
:04005C000F0E9212DF
:10006000070E9412968093680150030B136E010ED5
:10007000135204E0E846FE0B1306FCE1E81C0F0BEC
:100080008C6E956A841C010B800DF3CF14F0821CDA
:10009000070B100DF3CF13F0801C0F0B131014106F
:1000A000126E12380F0B070B100DF3CFDCF0020E9F
:1000B000E66E4EEC17F0E552086E08500F0802E2AB
:1000C0000F0E086E0950085C02E20950086EFDEC44
:1000D0000AF00F0E1214010F156E0A0E166E16C0DE
:1000E00031F015C02CF0E6EC17F02C50136E146AAA
:1000F000135000019213145093130F0E1214010F9A
Upvotes: 0
Views: 3309
Reputation: 10937
Actually the default hex format in MPLAB X IDE is Microchip INHX32 HEX-record Format
more about: https://www.lucidtechnologies.info/inhx32.htm. You can change the file format under project settings.
However there is possibility to invoke Microchip *.hex
file into MPLAB X IDE. This tutorial is valid for MPLAB X IDE v5.35.
1)Select from main menu File/Import/Hex
2)Press Browse
button and select desired *.hex
file.
3)Select debugger tool like Simulator
and press Next
button.
4)Press Finish
button.
5)In Projects tree you will find new Project
with the same name like imported hex file.
6)Press with the right mouse button on project name and select Set as main project
7)Select from main menu Production
and select Set Configurations Bits
8)New Tab named "Configurations Bits" is opened. Under the bottom of window press to Memory
and select Program memory
and set Format
to Code
!
9)Now you are able to see disassembled code, like:
Upvotes: 1