I just did another test with a new PIC18F45K20, the HPC curiosity plate, MPLAB XPRESS and the microchip software example. The result is the same, the device can NOT be programmed since a problem with the LVP is detected:
This thread bothered me because the schematic for the Curiosity HPC board has no indication of a connection between the PKOB circuitry and the RB5/PGM pin on the 40-pin socket for a PIC45K20. With the pragma that sets LVP to ON, the LVP mode is entered by the programmer setting the PGM pin high.
I had prepared a message stating my concern, but I didn't have a DIP version of the 'K20 to test, so I didn't post. I simply don't like to post unless I can test, not just guess.
Well, as of today I have obtained a PIC18F45K20 and have verified that it can not (that's NOT) be programmed PKOB on my Curiosity HPC board without taking special measures.
With a brand new PIC18F45K20, fresh out of the tube from Microchip, I get exactly
the same result as the OP: The programmer can not make the chip enter the programming mode.
It (erroneously) reports that, "MPLABX has detected that the device's low voltage configuration bit is set to OFF." I have seen this with other chips on various breadboards that were simply not connected correctly. In other words, if MPLABX finds that it can't make a chip enter LVP mode, it reports that the device's LVP bit is set OFF.
So, here's the thing:
Without doing anything else with the chip, I connected a 1K resistor from pin 38 of the MPU to one of the VDD pins on a header on the board and found that it could program the chip.
The "Starter Kit On Board" window of MPLABX now shows Target voltage detectedTarget device PIC18F45K20 found.Device ID Revision = 1cDevice Erased...Programming...The following memory area(s) will be programmed:program memory: start address = 0x0, end address = 0x117fconfiguration memoryProgramming/Verify complete
Of course, for normal operation (after programming/verification was complete), I had to pull down Pin 38 to Gnd. (I still used the resistor.) With the LVP bit ON for the device, if you leave the PGM pin just flapping in the breeze it may or may not appear to be functioning in normal operation, but it will be very flaky, as many have discovered over the years with these old chips. With the pull-down in place, my test program works as expected. Of course RB5 can not be used as a GPIO, but this is fully documented in the Data Sheet.
Now, my Curiosity board is pretty old, but the current schematic on Microchip's Curiosity web page appears to be the same as my schematic. I wonder if it is possible that later versions of the board have the necessary connection not shown on its schematic.
I don't know whether or not the following information is relevant:
- The label on the bottom of my Curiosity HPC board shows
- The silkscreen on the bottom of the board shows
Test setup: MPLABX version 5.05, XC8 version 2.00
I repeated the test with and without pullup/pulldown on PGM on this same MPU. Results were completely consistent: Programs OK with pullup, fails without pullup.
For supported chips that do not have a dedicated PGM pin for Low Voltage Programming, my Curiosity HPC board works just fine and dandy. I have tested a lot of them. With this device, it just flat won't work on my board without doing something extra. I haven't had any projects with devices having a dedicated PGM pin since before Curiosity days, so this is the only one that I have tried.
post edited by davekw7x - 2018/10/29 11:23:24