Author Topic: Cannot reprogram a microchip PIC12F1822  (Read 3722 times)

0 Members and 1 Guest are viewing this topic.

Offline ggchabTopic starter

  • Frequent Contributor
  • **
  • Posts: 276
  • Country: be
Cannot reprogram a microchip PIC12F1822
« on: November 13, 2015, 09:19:52 am »
I could program once a 12F1822 with the PICKIT3 from MPLAB X. My application needs 6 I/O lines. So I selected the internal clock and mclr is used as an input (for the SPI CS line). Now, I can no longer reprogram it (MPLAB X says "The target circuit may require more power than the debug tool can provide"). The PIC is directly connected with a ZIF socket (not in circuit) and powered by the PICKIT 3.
Is there any way the blank the chip ? Thank you for your ideas.
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12856
Re: Cannot reprogram a microchip PIC12F1822
« Reply #1 on: November 13, 2015, 09:49:09 am »
Have you used the PGC and or PGD pins as outputs in your code?
 

Offline hli

  • Frequent Contributor
  • **
  • Posts: 255
  • Country: de
Re: Cannot reprogram a microchip PIC12F1822
« Reply #2 on: November 13, 2015, 10:02:24 am »
When the PK3 cannot power it, why not power it externally (from your circuit)? MPLAB X has a setting for that in the PK3 config screen.
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12856
Re: Cannot reprogram a microchip PIC12F1822
« Reply #3 on: November 13, 2015, 10:19:32 am »
Wont help if there is a bus conflict with the programmer on PGC or PGD, causing the PIC to exceed the programmer's 30mA VDD current capibility.  Fortunately the 50mA polyfuses inside the PICkit 3 should prevent any programmer damage if you do power the chip externally at no more than 5V.
 

Offline H.O

  • Frequent Contributor
  • **
  • Posts: 813
  • Country: se
Re: Cannot reprogram a microchip PIC12F1822
« Reply #4 on: November 13, 2015, 10:37:20 am »
I'm thinking the same thing as Ian.M - are you using the PGD and PGC pins as outputs in your code?
If so, and you'er going to try with a new PIC, make sure you insert a short delay at the top of the program, before clearing TRIS for those two pins.
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12856
Re: Cannot reprogram a microchip PIC12F1822
« Reply #5 on: November 13, 2015, 11:19:23 am »
It can probably be salvaged with the PICkit 3 v3.10 standalone software as that allows you to set a Vpp first mode that prevents code executing before the chip can be put iinto programming mode.  N.B. it is IMPOSSIBLE to use Vpp first mode with external power.

It may also need you to reduce the programming Vdd as much as possible to get the chip successfully detected and erased.

Once you've recovered it, to prevent further problems, if possible reallocate the pins to avoid having outputs on PGC,PGD, and if you cant do that, add a minimum of a 1/2 second delay after startup before making them outputs (as H.O. just recommended).
 

Offline ggchabTopic starter

  • Frequent Contributor
  • **
  • Posts: 276
  • Country: be
Re: Cannot reprogram a microchip PIC12F1822
« Reply #6 on: November 13, 2015, 12:44:59 pm »
Many thanks. With the standalone software for the PICKIT3, I could erase the chip and then, reprogram it from MPLAB X   :)
I will also try to add the delay before changing TRIS to output.
 

Offline KL27x

  • Super Contributor
  • ***
  • Posts: 4100
  • Country: us
Re: Cannot reprogram a microchip PIC12F1822
« Reply #7 on: November 13, 2015, 12:56:15 pm »
Quote
It can probably be salvaged with the PICkit 3 v3.10 standalone software as that allows you to set a Vpp first mode that prevents code executing before the chip can be put iinto programming mode.
 
IPE defaults to Vpp first, too.

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf