View previous topic :: View next topic |
Author |
Message |
rovtech
Joined: 24 Sep 2006 Posts: 262
|
ICD3 and pullups on other than RB6,RB7 16F884 |
Posted: Tue Jan 17, 2017 8:10 pm |
|
|
My circuit uses 27 inputs with 10k SIPs on them with common to +5v and connected to individual switches which ground the inputs.
When I added the last SIP (8 x 10k) the ICD would not program the PIC16F884. I removed the SIP and now it can be programmed but I notice that it is not 100%. There is nothing on SPD/RB7, SPC/RB6, RX/RC7, TX/RC6, SDA/RC4, SCL/RC3, except the ICSP connector, I have been using the same 5 pin header and short cable for years. MCLR has 47k to +5v, no capacitor. At this time the connectors are removed from all headers so just 1" traces to the SIPs.
I bought a new ICD3 suspecting the old one but it does the same thing. It (they) program other PICs fine.
Is there something about loading too many inputs that causes the programming to fail. Would 47k SIPs solve the problem? Probably, but can someone explain this. Would 27 10k resistors on inputs mess up the programming? Note the pins the resistors were NOT connected to, above.
I am not connecting anything but the ICD3 to the RB6,RB7.
It does not make sense to me but when I ran out of ideas I reversed the last change which was a SIP of 10k on each of RB0 thru RB5 and RD6,RD7 ( that is D6,D7 not B6,B7). |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Jan 17, 2017 8:18 pm |
|
|
Look at your fuses at the end of the .LST file. Is it set for LVP or NOVLP ?
It should be NOLVP. |
|
|
newguy
Joined: 24 Jun 2004 Posts: 1908
|
|
Posted: Tue Jan 17, 2017 9:02 pm |
|
|
Stupid question, as I don't know your circuit and don't use that particular programmer but is the programmer powering the circuit or is the circuit powered by some other means? |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9229 Location: Greensville,Ontario
|
|
Posted: Wed Jan 18, 2017 6:00 am |
|
|
Newguy and I are thinking the same! I know that Pickit3 is 'power limited' so your ICD probably is.
It sounds like you're _just_ at that threshold and sometimes it'll work, more often it won't.
Have a look at the ICD specs to see what it's capable of
Now if you're powering from a wallwart or other supply, hmm..., well look at that unit's specs as well
If you're powering through a USB port from the PC, there's yet another 'gotya'! USB ports are current limited. Use the 'wrong' one and you won't have 500ma available. for some unknown reason the one port I always used was 'reconfigured' to only supply 100ma ! Some program,sure wasn't NOT me, altered the USB port setup. I only found that out by using USBView and saw the change !
Jay |
|
|
newguy
Joined: 24 Jun 2004 Posts: 1908
|
|
Posted: Wed Jan 18, 2017 6:41 pm |
|
|
temtronic wrote: | Newguy and I are thinking the same! |
Thinking back through the years and all the weird "software" problems that were ultimately traced back to power...... As a result, I never trust the reply "it's okay" when I ask someone about the power supply. |
|
|
rovtech
Joined: 24 Sep 2006 Posts: 262
|
|
Posted: Wed Jan 18, 2017 7:06 pm |
|
|
Thanks PCM Programmer, you were on the right track. Thanks also Newguy and Temtronic, good points also.
A couple of guys on the Microchip forum came up with the solution:
If you have a pullup resistor on the LVP pin, in this case PIC16F884 pin RB3, you must ground it in order to program the PIC. A high tells the chip that LV programming is selected and it interferes with HV programming.
I simply set the switch connected to that pin to low (ground) and all was fine. They said it would mess up any programmer, not just the ICD3, because the chip is being told in hardware that LVP is selected.
I'm not sure if I place NOLVP in the Fuses header if it will help, I suspect not although NOLVP is in the .h file.
After years of programming I was amazed to learn about this. However I started with UV erasable PICs and LVP was probably not around. Search the data sheet for LVP and you will find vague mention of this but nothing that says to ground pullups on RB3 for programming. It does mention RB3 but I would not have guessed this was the problem from reading that part of the data sheet (page 212 out of 328). Check for the appropriate pin on other PICs.
Add this one to not placing resistors, capacitors, or diodes to RB6 & RB7 (usually), and no capacitor on MCLR.
I'm using a 7805 powered by a 12v battery for my board, the circuit is simple; just a 10k pullup resistor and a switch to ground it. I try not to use ICD3 powered programming. |
|
|
rovtech
Joined: 24 Sep 2006 Posts: 262
|
|
Posted: Sun Jan 22, 2017 8:58 am |
|
|
I ran a test and placing 'NOLVP' in the fuses does not solve the problem.
RB3 MUST be floating or grounded in order to program the PIC with normal HV programming on MCLR.
I placed a comment at the start of my program so I don't forget to flip the appropriate switch before programming. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19518
|
|
Posted: Sun Jan 22, 2017 9:41 am |
|
|
This is actually in the errata sheet for this chip, when in LVP mode.
That it applies even when you are not in LVP mode, is in this thread at MicroChip:
<http://www.microchip.com/forums/tm.aspx?m=484624&mpage=1&key=񶔐>
Look at the 4th reply down.
This is about the only PIC family this applies to. |
|
|
rovtech
Joined: 24 Sep 2006 Posts: 262
|
|
Posted: Sun Jan 22, 2017 1:31 pm |
|
|
Thank you Ttelmah.
I read the Errata sheet carefully but still would not guess that it applies to normal ICD3 (HV) programming, even knowing the problem. I notice in the link you gave that others have had problems programming if the LVP pin is not connected to anything.
Is this a fault with the one PIC (16F88x) or is it common for others?
Note that the first reference to LVP is on page 212 of the data sheet (16F884) but it does identify RB3 as PGM on the pin description which did not raise any flags for me. This is a real trap for a novice programmer and cost me $300 Cdn for a new ICD3 that I did not need. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19518
|
|
Posted: Sun Jan 22, 2017 3:30 pm |
|
|
On most PIC's the PGM pin need only be tied low when LVP is selected.
The rest of the time it functions as a normal pin. It seems that for this particular set of PIC's, the NOLVP setting is not fully disabling the PGM pin. |
|
|
|