2020/11/26 19:07:32
Mike432
I get the error message when trying to program my IC.  It is a very simple program to flash an LED On/Off.  I tried to switch to high voltage program entry mode but then it give a target voltage not detected error.  The only thing I have connected right now is the LED/resistor to pin 9 and a .1uF cap between Vdd and Vss.
 
added note... Using a 5V 2 amp power supply for power to the IC.
 
Connecting to MPLAB PICkit 3...
Currently loaded firmware on PICkit 3
Firmware Suite Version.....01.51.06
Firmware type..............dsPIC33F/24F/24H
Target voltage detected
Target device PIC24F08KL200 found.
Device ID Revision = 2
Device Erased...
Programming...
The following memory area(s) will be programmed:
program memory: start address = 0x0, end address = 0x3ff
configuration memory
configuration memory
Address: f8000c Expected Value: 7b Received Value: fb
Failed to program device
2020/11/26 19:22:19
BroadwellConsultingInc
This bit is the MCLRE bit in the FPOR configuration register.   There's a note on page 180 of the datasheet:
 
Note 1: The MCLRE fuse can only be changed when using the VPP-Based ICSP™ mode entry. This prevents a user from accidentally locking out the device from the low-voltage test entry.
 
Try changing your config bits to make RA5 a reset pin rather than an I/O pin and see if the programming is successful.
2020/11/26 19:48:24
Mike432
Setting the configuration "#pragma config MCLRE = ON" allowed me to program the device.
 
Does this mean that I can't use RA5 as an input or is there a way to set it as an input during startup of the device?  I was planning to use every I/O on this chip.
 
 
2020/11/26 19:57:08
BroadwellConsultingInc
I think you can if you can do high-voltage programming of the chip.  I've not used this chip before, but the way I read the datasheet note you have to program using a voltage higher than your Vdd voltage on the MCLR pin.  You'll need to look at your circuit design to make sure that having your programmer apply such a voltage (between 7.75 and 9 volts if you look in the PIC24F08KL200 flash programming specification) won't cook whatever you have hooked up that you intended to measure with RA5.
2020/11/26 20:08:46
ric
As above.
However, you must be very careful if you are connecting an "off board" signal to the MCLR pin, as any glitch higher than Vdd on that pin could cause the chip to jump into programming mode!
 
2020/11/26 20:24:54
Mike432
Currently I have nothing connected to RA5.  That can come later after I get the device programmed.
 
In "Project Properties", selecting "PICkit 3" under categories, selecting "Program Options" from the "Option categories:" drop down, and checking "Use high voltage programming mode entry" causes the below error when trying to program the IC.
 
Connecting to MPLAB PICkit 3...
Currently loaded firmware on PICkit 3
Firmware Suite Version.....01.51.06
Firmware type..............dsPIC33F/24F/24H
Target voltage detected
Target Device ID (0x0) is an Invalid Device ID. Please check your connections to the Target Device.
2020/11/26 21:02:00
ric
It would appear something is preventing it pulling the MCLR pin up to the high voltage.
Either there is some other device connected to MCLR, with internal protection diodes to Vdd, or MCLR is not connected to the PK3 at all.
(I doubt it is the latter, as that would have stopped low voltage programming from working too.)
 
© 2021 APG vNext Commercial Version 4.5

Use My Existing Forum Account