Firstly, I have to say that I'm new to PIC family. I am trying to build USB-CAN converter from USB-TIN page using PIC18f14k50 microcontroller, PICkit3 programmer and MPLAB IDE.

After writing hex file to flash memory device is not detected by PC. I tried on different OS and PCs.

I decided to read back flash memory after writing. It turned out that hex file that I've read is different from what I've tried to write!

What have I made wrong? Any ideas?

what i read before write

what i write

Look at my hex files. I read a lot of "FFFFFFF..FFF" sectors. Some adresses and data are consistent, but only just a few.

  • 1
    \$\begingroup\$ Are you using a Microchip development board or your own circuit? If the latter, is it on a PCB or just a breadboard? If it is your own design, post a schematic. \$\endgroup\$ – tcrosley Jan 17 '17 at 22:21
  • \$\begingroup\$ I use perfboard. I also bouble checked wire connections. Schematic you can find in link posted above. \$\endgroup\$ – bart266 Jan 17 '17 at 22:40
  • \$\begingroup\$ In what way were the hex files different? Post a photo of the perfboard. \$\endgroup\$ – Bruce Abbott Jan 17 '17 at 22:56
  • \$\begingroup\$ s28.postimg.org/8uwslsoil/bottom.jpg s28.postimg.org/w99tuucrh/top.jpg board photos. Hex files i posted in asnwer somewhere below \$\endgroup\$ – bart266 Jan 18 '17 at 13:22

Your question is way too broad to give a definitive answer to.

If you just dumped the HEX file to the micro without debugging, then you should have read back the same data. If you programmed the device from inside MPLAB, then various MPLAB settings could have overridden the data in the HEX file. If you did this in debug mode, then MPLAB pretty much has to override the debug bit.

  • \$\begingroup\$ I use MPLAB IPE for programming. Each time when i load .hex to IPE i see warning about clearing debug information by IPE. In makefile i saw programm memory offset set to 0x1000, but i cant find that option in IPE. \$\endgroup\$ – bart266 Jan 17 '17 at 22:34

Not the answer you're looking for? Browse other questions tagged or ask your own question.