Author Topic: PIC ICSP Programming Circuit  (Read 1442 times)

0 Members and 1 Guest are viewing this topic.

Offline NorthGuy

  • Super Contributor
  • ***
  • Posts: 2086
  • Country: ca
Re: PIC ICSP Programming Circuit
« Reply #25 on: July 19, 2020, 08:07:39 pm »
For PIC16F88, you need to make sure the PGM pin is tied down (through a resistor or driven by the programmer), even if you only use HVP programming.
 
The following users thanked this post: Ian.M, jpanhalt

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 1750
  • Country: us
Re: PIC ICSP Programming Circuit
« Reply #26 on: July 20, 2020, 01:47:08 am »
I tend to disable the "Low voltage programming" in the PIC fuses
and set the PGM pin as I/O.

I only use "High voltage programming".

Then just add a simple jumper between the PIC/ICSP and the rest of your circuit.
With the jumper, you can then switch between "programmer powered" and "circuit powered".
This way you can have the PCB manufactured, program the PIC and then solder a jumper for delivery/testing.

[attachimg=1 width=600]
 

Offline NorthGuy

  • Super Contributor
  • ***
  • Posts: 2086
  • Country: ca
Re: PIC ICSP Programming Circuit
« Reply #27 on: July 20, 2020, 04:44:49 am »
I tend to disable the "Low voltage programming" in the PIC fuses
and set the PGM pin as I/O.

When you program the device, the programmer does bulk erase first. This restores the default LVP=ON setting. If the programmer resets the PIC while in this state, and PGM is high, the PIC may enter LVP mode causing the programming to fail. Not all PICs with PGM pin are vulnerable to this, but many are.
 

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 1750
  • Country: us
Re: PIC ICSP Programming Circuit
« Reply #28 on: July 20, 2020, 05:03:24 am »
I tend to disable the "Low voltage programming" in the PIC fuses
and set the PGM pin as I/O.

When you program the device, the programmer does bulk erase first. This restores the default LVP=ON setting. If the programmer resets the PIC while in this state, and PGM is high, the PIC may enter LVP mode causing the programming to fail. Not all PICs with PGM pin are vulnerable to this, but many are.

If you are doing 'High Voltage Programming', is this even possible?
Wouldn't that prevent you from ever disabling LVP?
 

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 1750
  • Country: us
Re: PIC ICSP Programming Circuit
« Reply #29 on: July 20, 2020, 05:59:03 am »
Not sure.  But it looks like the OP is using a pic16f648a.
According to the Errata, the state of the PGM pin during 'High voltage programming' doesn't matter.

[attachimg=1 width=400]

For safety, put a 100KΩ resistor to GND on the PGM pin. 
That size resistor will not impact the rest of the circuit if you want to use the PGM pin.
 

Offline girishv

  • Contributor
  • Posts: 25
  • Country: in
Re: PIC ICSP Programming Circuit
« Reply #30 on: July 20, 2020, 12:07:20 pm »
Not sure.  But it looks like the OP is using a pic16f648a.
According to the Errata, the state of the PGM pin during 'High voltage programming' doesn't matter.

The MCU in question is PIC16F684, not PIC16F648A.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 8796
Re: PIC ICSP Programming Circuit
« Reply #31 on: July 20, 2020, 12:40:42 pm »
Life's too short to wade through Microchip's (incomplete) errata, and anecdotal evidence on their forum to figure out exactly which of the early LVP capable PICs can be affected by glitches or high levels on PGM at HV programming mode entry, or while HV programming  is in progress.

In all cases, if a PIC has a seperate PGM pin for LVP mode entry, wire it to pin 6 (AUX/LVP) of the ICSP connector, and if the target board is capable of driving it with a 'stiff' logic '1', add an isolation resistor between it and the rest of the target board.  Ensure HV programming is selected in whatever software your programmer uses, and simply let the programmer handle it.

The fuse to disable LVP programming cant be disabled in LVP mode.  If its left enabled, you cant disable /MCLR or use the PGM pin for I/O.  Also a floating PGM pin at runtime can cause unwanted LV Programming mode entry, which if its brief enough has apparent symptoms closely resembling an unintended device reset.

« Last Edit: July 20, 2020, 12:44:36 pm by Ian.M »
 
The following users thanked this post: girishv

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 1750
  • Country: us
Re: PIC ICSP Programming Circuit
« Reply #32 on: July 20, 2020, 07:44:12 pm »
Not sure.  But it looks like the OP is using a pic16f648a.
According to the Errata, the state of the PGM pin during 'High voltage programming' doesn't matter.

The MCU in question is PIC16F684, not PIC16F648A.

The pic16f684 doesn't have a PGM.  So, this discussion is mute.
I mentioned the pic16f648a because you said it might be a replacement with a PCB design change.


Life's too short to wade through Microchip's (incomplete) errata, and anecdotal evidence on their forum to figure out exactly which of the early LVP capable PICs can be affected by glitches or high levels on PGM at HV programming mode entry, or while HV programming  is in progress.

It's just good engineering practice to 'wade' through the manufacture's documentation for the device you're using.  Complete or not.  The more you know about a device the better.  Why leave it to 'Murphy'?
If it's for a personal project, then by all means roll-the-dice.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 8796
Re: PIC ICSP Programming Circuit
« Reply #33 on: July 20, 2020, 08:16:04 pm »
Yes,its good practice to read  the documentation and all relevant errata, and absolutely essential for commercial product development,  but when the 'smoking gun' that there is probably a hardware issue is *NOT* in the errata but is buried in a several years old forum thread where it was admitted off-the-cuff by a Microchip 'staffer', if you don't have sufficient background to remember that forum thread, you'll be rolling-the-dice anyway, without even realising it.

I'd be much more impressed with Microchip if they'd implement a hardware bug-tracker, updated by level two and higher support and the chip development teams, and publicly searchable and viewable.   (Not publicly or level one support updatable to prevent it being spammed with non-bugs by numpties!)
 

Offline girishv

  • Contributor
  • Posts: 25
  • Country: in
Re: PIC ICSP Programming Circuit
« Reply #34 on: July 21, 2020, 12:17:30 am »
Not sure.  But it looks like the OP is using a pic16f648a.
According to the Errata, the state of the PGM pin during 'High voltage programming' doesn't matter.

The MCU in question is PIC16F684, not PIC16F648A.

The pic16f684 doesn't have a PGM.  So, this discussion is mute.
I mentioned the pic16f648a because you said it might be a replacement with a PCB design change.


 :-[ It was a typo. I am sorry for creating confusion. The chip used is PIC16F684.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf