# Writing high bytes in Intel Hex file to PIC 16F886 using MiniPro TL866A

I'm a newbie trying to write an Intel hex file to a PIC 16F886 using a MiniPro TL866A. When I try, I get the message:

\$ minipro -p PIC16F886 -f ihex -w downloaded-file.hex
Found TL866A 03.2.86 (0x256)
Chip ID OK: 0x2062 Rev.0x2060
Found Intel hex file.
Incorrect file size: 3145742 (needed 16384)


Looking at the hex file in the parser at Nordic Semiconductor, I can see that there are two parts that are outside the range of the PIC:

Block starting at 2097152 (0x200000), 8 (0x8) bytes long
Block starting at 3145728 (0x300000), 14 (0xe) bytes long


What are these 8 and 14-byte values, and how do I write them to the PIC?

• You may need to consult the source of the file. I believe I once saw a local tradition of putting fuse settings at implausible addresses in a file to keep them associated with the code, but such a scheme only works if the user of the file shares that tradition. – Chris Stratton Dec 24 '19 at 21:05
• The ID and configuration bits for that chip are supposed to be at 0x2000-2003 and 0x2007-0x2008 which is already outside the program memory space. What's the hex file saying should be in those very high locations? Where did the file come from? – Spehro Pefhany Dec 24 '19 at 21:27
• This is what's in my file: :020000040020DA :08000000FFFFFFFFFFFFFFFF00 :020000040030CA :0E000000FF38193CFF3580FF08800FE00F40ED. The file came from an antenna tuner manufacturer who no longer supports the model I have with the bad PIC. – user3486184 Dec 24 '19 at 21:31

## 1 Answer

Microchip assembler seems to set the configuration and ID locations using those very high addresses. For example, from the manual:

So it appears there is some incompatibility between the third-party programmer and Microchip's hex files. Maybe you can update the programmer firmware, or if it's an illegal clone use some tool like a Pickit.

• The problem was indeed the MiniPro TL866A programmer. Even using the latest firmware available, it had issues - apparently this isn't uncommon. Switching to a PICKit 2 and using Microchip's pk2cmd, I was able to write just fine. – user3486184 Jan 9 at 5:46