Jump to content

PIC16F877 and JDM Programmer: Programming Failure


Guest sstandfast
 Share

Recommended Posts

Guest sstandfast

I am having a problem programming my PIC16F877. Whenever I attempt to program my PIC, I get an error message saying that "Programming failed at Code address 0000h".

I have seen others on here with similar problems but nobody has been able to give a definitive reason as to what is causing this error. They simply say that it is a hardware problem. I am inclined to believe them, as I have tried my programmer on two separate machines, one running Windows 2000 and the other running Windows 98 SE, and it hasn’t worked on either machine.

My question is “what kind of a hardware problem am I looking for?†I am using a modified version of the JDM programmer. Below are links to the schematic and webpage that I used to build my programmer. I have checked and double-checked the circuit against the schematic and I am positive that it is wired correctly. I have used hardware check in IC-Prog and verified that all the voltages are correct.

I am using a FLUKE 27 multimeter and have measured these voltages:

With MCLR enabled the voltage between Vss (pin 12/31) and MCLR was 13.25V

With Vcc enabled the voltage between Vss (pin 12/31) and Vdd (pin 11/32) was 5.04V

With clock enabled the voltage between Vss (pin 12/31) and RB6 (pin 39) was a little funny. The max voltage that I was able to measure was about 4.5v but it was continuously dropping. I couldn’t ever get a constant 5.0 volts across these two pins.

With Data Out enabled the voltage between Vss and RB7 (pin 40) was a steady 4.53V

With a PIC in the socket and the read command selected the voltage between Vss (pin 12/31) and MCLR was 13.25V and the voltage between Vss and Vdd was 5.04V

I know that this sounds more like a hardware problem and not a software problem but I was just wondering if anyone could give me some advice on how to fix this. I appreciate any help you guys can offer.

Thanks in advance!

Shawn

sstandfast@yahoo.com

Link to comment
Share on other sites

Guest sstandfast

I am having a problem programming my PIC16F877. Whenever I attempt to program my PIC, I get an error message saying that "Programming failed at Code address 0000h".

I have seen others on here with similar problems but nobody has been able to give a definitive reason as to what is causing this error. They simply say that it is a hardware problem. I am inclined to believe them, as I have tried my programmer on two separate machines, one running Windows 2000 and the other running Windows 98 SE, and it hasn’t worked on either machine.

My question is “what kind of a hardware problem am I looking for?†I am using a modified version of the JDM programmer. Below are links to the schematic and webpage that I used to build my programmer. I have checked and double-checked the circuit against the schematic and I am positive that it is wired correctly. I have used hardware check in IC-Prog and verified that all the voltages are correct.

I am using a FLUKE 27 multimeter and have measured these voltages:

With MCLR enabled the voltage between Vss (pin 12/31) and MCLR was 13.25V

With Vcc enabled the voltage between Vss (pin 12/31) and Vdd (pin 11/32) was 5.04V

With clock enabled the voltage between Vss (pin 12/31) and RB6 (pin 39) was a little funny. The max voltage that I was able to measure was about 4.5v but it was continuously dropping. I couldn’t ever get a constant 5.0 volts across these two pins.

With Data Out enabled the voltage between Vss and RB7 (pin 40) was a steady 4.53V

With a PIC in the socket and the read command selected the voltage between Vss (pin 12/31) and MCLR was 13.25V and the voltage between Vss and Vdd was 5.04V

I know that this sounds more like a hardware problem and not a software problem but I was just wondering if anyone could give me some advice on how to fix this. I appreciate any help you guys can offer.

Thanks in advance!

Shawn

sstandfast@yahoo.com

Link to comment
Share on other sites

Guest sstandfast

I have made some progress in solving my programming problems. After examining my programmer again for the nth time, I found two possible problems. The first problem I discovered was that on resistor R3 I tied the collector pin of transistor 2 to the wrong side of R3. I fixed this and retried to program with no luck.

The second problem that I found was that on the inside row of pins <pins 6-9> of the right angle DB9 serial connector, I found a solder "blob" hidden by the top of the connector. Apparently when soldering the connector in place some solder flowed down the pin and pooled on the other side of the board where it may have been shorting pins 8 and 9. I hadn’t noticed it before because the DB9 connector was covering it. Thinking that was the problem, I quickly removed the excess solder from the pin and retried to program my PIC.

Progress was made after this but by no means was the problem solved. I can now read the contents of the chip and can verify that the chip is blank. As opposed to before when I would try to read the chip I would get a return of all zeros indicating that the chip hasn’t been read. Now when I read the chip, I am getting the correct return of all 3FFFh, indicating that a signal from the programmer has been read and the chip is blank. Blank Check also now confirms this new development. I know for a fact that these chips are blank because they are brand new chips. With these developments it would appear that I am now able to read the contents of the chip.

However, I am still unable to write to the chip. I still get the same "programming error at Code address 0000h" when I attempt to program. I am using a JAL compiled .HEX file; the code used for the file was given with the compiler as example code so it is functioning correctly. I can get a successful program/verify if I try to program all 3FFFh or all zeros.

I still cannot measure a stable voltage across RB6 (pin 39) and Vss (pin 12/31), the voltage still drops consistently, however at a much slower rate now. All other voltages are within .5v or better. I have had other people examine my circuit and they could find nothing wrong with it. The only other piece of relevant information that I can think to give to you is that instead of using the BC547B transistor like the schematic says to, I used the similar C644. The only difference between the two transistors that I know of is the pin function and this was compensated for.

The fact that the voltage across RB6 and Vss shrinks over time tells me that there is either a short somewhere bleeding voltage off, one of the diodes is faulty, or there is a “leaky†capacitor somewhere but I’ve checked for all these to no avail. Short of handing you my programmer that is all the information that I know to give you. Please help as I am currently stumped. A fresh perspective on things might help me solve this puzzle.

Thanks in advance for your help.

Shawn

sstandfast@yahoo.com

Btw- one more quick question before I go. Should flow control for the COM port be turned on under Windows when using IC-Prog? If so, should I leave it as hardware control or should I switch it to software? I know that the JDM programmer that I’m using uses the CTS <clear to send> and RTS <request to send> pins in the design and was wondering if flow control had any bearing on what could be causing my problem. It is a long shot but I thought I’d ask anyway. Thanks again. Shawn

Link to comment
Share on other sites

Guest sstandfast

I have made some progress in solving my programming problems. After examining my programmer again for the nth time, I found two possible problems. The first problem I discovered was that on resistor R3 I tied the collector pin of transistor 2 to the wrong side of R3. I fixed this and retried to program with no luck.

The second problem that I found was that on the inside row of pins <pins 6-9> of the right angle DB9 serial connector, I found a solder "blob" hidden by the top of the connector. Apparently when soldering the connector in place some solder flowed down the pin and pooled on the other side of the board where it may have been shorting pins 8 and 9. I hadn’t noticed it before because the DB9 connector was covering it. Thinking that was the problem, I quickly removed the excess solder from the pin and retried to program my PIC.

Progress was made after this but by no means was the problem solved. I can now read the contents of the chip and can verify that the chip is blank. As opposed to before when I would try to read the chip I would get a return of all zeros indicating that the chip hasn’t been read. Now when I read the chip, I am getting the correct return of all 3FFFh, indicating that a signal from the programmer has been read and the chip is blank. Blank Check also now confirms this new development. I know for a fact that these chips are blank because they are brand new chips. With these developments it would appear that I am now able to read the contents of the chip.

However, I am still unable to write to the chip. I still get the same "programming error at Code address 0000h" when I attempt to program. I am using a JAL compiled .HEX file; the code used for the file was given with the compiler as example code so it is functioning correctly. I can get a successful program/verify if I try to program all 3FFFh or all zeros.

I still cannot measure a stable voltage across RB6 (pin 39) and Vss (pin 12/31), the voltage still drops consistently, however at a much slower rate now. All other voltages are within .5v or better. I have had other people examine my circuit and they could find nothing wrong with it. The only other piece of relevant information that I can think to give to you is that instead of using the BC547B transistor like the schematic says to, I used the similar C644. The only difference between the two transistors that I know of is the pin function and this was compensated for.

The fact that the voltage across RB6 and Vss shrinks over time tells me that there is either a short somewhere bleeding voltage off, one of the diodes is faulty, or there is a “leaky†capacitor somewhere but I’ve checked for all these to no avail. Short of handing you my programmer that is all the information that I know to give you. Please help as I am currently stumped. A fresh perspective on things might help me solve this puzzle.

Thanks in advance for your help.

Shawn

sstandfast@yahoo.com

Btw- one more quick question before I go. Should flow control for the COM port be turned on under Windows when using IC-Prog? If so, should I leave it as hardware control or should I switch it to software? I know that the JDM programmer that I’m using uses the CTS <clear to send> and RTS <request to send> pins in the design and was wondering if flow control had any bearing on what could be causing my problem. It is a long shot but I thought I’d ask anyway. Thanks again. Shawn

Link to comment
Share on other sites

Hi Shawn,

the slow voltage dropping at RB6 and the power pins is the normal behaviour of the JDM circuit. It will get stable during programming. But 13.25V at MCLR# seems to be too low. You can increase this voltage in the hardware configuration setup by lowering the I/O delay. Best results with "delay = 1"

Best Regards, Thorsten.

Link to comment
Share on other sites

Hi Shawn,

the slow voltage dropping at RB6 and the power pins is the normal behaviour of the JDM circuit. It will get stable during programming. But 13.25V at MCLR# seems to be too low. You can increase this voltage in the hardware configuration setup by lowering the I/O delay. Best results with "delay = 1"

Best Regards, Thorsten.

Link to comment
Share on other sites

  • 2 weeks later...
Guest sstandfast

Hi, I'm back and I am still having the same problem with my JDM.  Since my last posting several modifications have been made.  They are as follows:

1)  I have since rebuilt the programmer on a PCB using the board layout found on Thorsten's webpage.  I used all new components on this board save the resistors and the 8v2 zenner (the 5v1 zenner was replaced- fried during removal&#61516;).  Therefore all components are in working condition.

2)  IC-Prog was upgraded from version 1.04A to 1.05A.

However, with these new developments I am still unable to program my PIC.  I still receive the error "Programming Failed at Code address 0000h".  The voltages I am reading with this new programmer that I have read are:

Vss to MCLR:  13.29V (still a little low)

Vss to Vcc:      5.06V

Vss to RB7 (pin 40):  4.66V (very low but within the .5v tolerance)

Vss to RB6 (pin 39):  still an unstable (but apparently normal) reading of a falling voltage starting from about 5v falling to around 3v.

With a chip in the socket and the read command issued I read a voltage of 13.28V across MCLR and 5.06V across Vcc.

All voltages were read with a digital multimeter and I/O Delay in IC-Prog set to "1".  (On a side note changing the I/O delay did not effect the voltages any.  I still measured 13.29v across MCLR with delay raised all the way up to 10)

Now according to Thorsten's previous posting on this topic the unstable voltage measured on the serial clock is normal and will stabilize when the chip is being programmed.  With regard to this statement, is the voltage also supposed to drop across the rest of the circuit as well when this test is administered?  The reason I ask this is because whenever I start the "Enable Clock" test in IC-Prog, the voltage drops across the entire circuit.  MCLR drops from its normal 13.29 to around 11v or so and continues to decrease.  On Vcc the voltage drops to 2.5v and continues to diminish.  The "enable clock" is the only test where a discernable voltage drop is detected, all other tests return normal. Like Thorsten said however this may be normal behavior of the JDM (as I am able to measure the correct voltages when reading a chip) and I should not worry about it but I just thought it was worth mentioning.

Also according to Thorsten's previous posting, the 13.25 V on MCLR with my previous vector board version of the JDM seemed a bit to low to him.  I am assuming that 13.29V is also somewhat low as well.  Swapping the 8v2 zenner out with an 8v7 zenner should increase this voltage shouldn&#8217;t it?  Also the 4.66V on the data pin (pin 40) seams a bit low to me as well.  With &#8220;data out&#8221; enabled the voltage on the DTR/CTS (DB9 pins 4 and 8) side of the transistor, which I believe is the collector if I remember correctly, the voltage is 5.06 just like it should be.  However on the PIC side of the transistor (pin 40) the voltage is like I said earlier 4.66V.

One other quick question before I close; does anyone know how I would set up a serial port monitoring software, like HyperTerminal, so I can monitor the traffic that IC-Prog Is producing on the RS232 port.  This might give me a chance to see which end my problem lies on, computer hardware/software or JDM hardware.  If anyone has any suggestions please let me know.  You can respond by posting a reply on this forum or you can email your reply to me at sstandfast@yahoo.com.  

Thanks,

Shawn

Link to comment
Share on other sites

Guest sstandfast

Hi, I'm back and I am still having the same problem with my JDM.  Since my last posting several modifications have been made.  They are as follows:

1)  I have since rebuilt the programmer on a PCB using the board layout found on Thorsten's webpage.  I used all new components on this board save the resistors and the 8v2 zenner (the 5v1 zenner was replaced- fried during removal&#61516;).  Therefore all components are in working condition.

2)  IC-Prog was upgraded from version 1.04A to 1.05A.

However, with these new developments I am still unable to program my PIC.  I still receive the error "Programming Failed at Code address 0000h".  The voltages I am reading with this new programmer that I have read are:

Vss to MCLR:  13.29V (still a little low)

Vss to Vcc:      5.06V

Vss to RB7 (pin 40):  4.66V (very low but within the .5v tolerance)

Vss to RB6 (pin 39):  still an unstable (but apparently normal) reading of a falling voltage starting from about 5v falling to around 3v.

With a chip in the socket and the read command issued I read a voltage of 13.28V across MCLR and 5.06V across Vcc.

All voltages were read with a digital multimeter and I/O Delay in IC-Prog set to "1".  (On a side note changing the I/O delay did not effect the voltages any.  I still measured 13.29v across MCLR with delay raised all the way up to 10)

Now according to Thorsten's previous posting on this topic the unstable voltage measured on the serial clock is normal and will stabilize when the chip is being programmed.  With regard to this statement, is the voltage also supposed to drop across the rest of the circuit as well when this test is administered?  The reason I ask this is because whenever I start the "Enable Clock" test in IC-Prog, the voltage drops across the entire circuit.  MCLR drops from its normal 13.29 to around 11v or so and continues to decrease.  On Vcc the voltage drops to 2.5v and continues to diminish.  The "enable clock" is the only test where a discernable voltage drop is detected, all other tests return normal. Like Thorsten said however this may be normal behavior of the JDM (as I am able to measure the correct voltages when reading a chip) and I should not worry about it but I just thought it was worth mentioning.

Also according to Thorsten's previous posting, the 13.25 V on MCLR with my previous vector board version of the JDM seemed a bit to low to him.  I am assuming that 13.29V is also somewhat low as well.  Swapping the 8v2 zenner out with an 8v7 zenner should increase this voltage shouldn&#8217;t it?  Also the 4.66V on the data pin (pin 40) seams a bit low to me as well.  With &#8220;data out&#8221; enabled the voltage on the DTR/CTS (DB9 pins 4 and 8) side of the transistor, which I believe is the collector if I remember correctly, the voltage is 5.06 just like it should be.  However on the PIC side of the transistor (pin 40) the voltage is like I said earlier 4.66V.

One other quick question before I close; does anyone know how I would set up a serial port monitoring software, like HyperTerminal, so I can monitor the traffic that IC-Prog Is producing on the RS232 port.  This might give me a chance to see which end my problem lies on, computer hardware/software or JDM hardware.  If anyone has any suggestions please let me know.  You can respond by posting a reply on this forum or you can email your reply to me at sstandfast@yahoo.com.  

Thanks,

Shawn

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

Hi all,

i have the same kind of problem while trying to program the PIC using the JDM (Thorsten pcb). I have a Win98 PC.

Here are the voltages measured :

with no pic in the socket :

 Enable MCLR : 13.41v (needed 14v)

 Enable VCC : 5.13v (needed 5v)

 Enable Clock : 4.56v (max raised then falls down, normal) (needed 5v+/-1v)

 Enable Data Out : 4.64v (needed 5v+/-0.5v)

 not exactly what excpected but i think it is ok as is ?

with PIC in the socket :

 I unplugged the db9 connector before to plug the pic (as the firt time i didn't and got a pc "beep"  :-[ )

 "Read All" command gives me back a message : No Acknowledge received  :( then i click ok and measure the voltages :

MCLR# : 12.64v ! (needed 13.7v)

Vdd : 4.5v (needed 5v)

changing the I/O delay to 1 has got NO effect on the MCLR# voltage.

So i tried the "Shielded ground connection" but it doesn't change the results.

what about this "code protection" option, i cant find it.

any ideas  ???

Link to comment
Share on other sites

Hi all,

i have the same kind of problem while trying to program the PIC using the JDM (Thorsten pcb). I have a Win98 PC.

Here are the voltages measured :

with no pic in the socket :

 Enable MCLR : 13.41v (needed 14v)

 Enable VCC : 5.13v (needed 5v)

 Enable Clock : 4.56v (max raised then falls down, normal) (needed 5v+/-1v)

 Enable Data Out : 4.64v (needed 5v+/-0.5v)

 not exactly what excpected but i think it is ok as is ?

with PIC in the socket :

 I unplugged the db9 connector before to plug the pic (as the firt time i didn't and got a pc "beep"  :-[ )

 "Read All" command gives me back a message : No Acknowledge received  :( then i click ok and measure the voltages :

MCLR# : 12.64v ! (needed 13.7v)

Vdd : 4.5v (needed 5v)

changing the I/O delay to 1 has got NO effect on the MCLR# voltage.

So i tried the "Shielded ground connection" but it doesn't change the results.

what about this "code protection" option, i cant find it.

any ideas  ???

Link to comment
Share on other sites

JDM should work, if you follow the programming instructions on Thorsten's website to the letter! I was getting the same errors, until I followed the instructions properly. You need to check the CONFIGURATION pages on IC PROG, if still no joy, there is a step by step walkthrough on this forum, with screenshots of what it should look like. try this, and I'm sure it will work! if not, then requst help from here again. ;D

Link to comment
Share on other sites

JDM should work, if you follow the programming instructions on Thorsten's website to the letter! I was getting the same errors, until I followed the instructions properly. You need to check the CONFIGURATION pages on IC PROG, if still no joy, there is a step by step walkthrough on this forum, with screenshots of what it should look like. try this, and I'm sure it will work! if not, then requst help from here again. ;D

Link to comment
Share on other sites

JDM should work, if you follow the programming instructions on Thorsten's website to the letter! I was getting the same errors, until I followed the instructions properly. You need to check the CONFIGURATION pages on IC PROG, if still no joy, there is a step by step walkthrough on this forum, with screenshots of what it should look like. try this, and I'm sure it will work! if not, then requst help from here again. ;D

So here we are...

in my last posts, i gave all the results of the Thorsten's tests to the letter, and tried it again with no luck.

I would request some step by step help if someone is available  ::).

well, on a first start here's the config i have :

  • PC running Win98SE
  • Grounded to earth
  • COM2 is used (COM1 goes to my chameleon rack, wich is powered off)
  • JDM programmer with soldering verified multiple times by me  :P
  • Ic-prog v1.05a

 :-[

waiting for that i'll continue with pots soldering.

thanks for your help

RAF

Link to comment
Share on other sites

JDM should work, if you follow the programming instructions on Thorsten's website to the letter! I was getting the same errors, until I followed the instructions properly. You need to check the CONFIGURATION pages on IC PROG, if still no joy, there is a step by step walkthrough on this forum, with screenshots of what it should look like. try this, and I'm sure it will work! if not, then requst help from here again. ;D

So here we are...

in my last posts, i gave all the results of the Thorsten's tests to the letter, and tried it again with no luck.

I would request some step by step help if someone is available  ::).

well, on a first start here's the config i have :

  • PC running Win98SE
  • Grounded to earth
  • COM2 is used (COM1 goes to my chameleon rack, wich is powered off)
  • JDM programmer with soldering verified multiple times by me  :P
  • Ic-prog v1.05a

 :-[

waiting for that i'll continue with pots soldering.

thanks for your help

RAF

Link to comment
Share on other sites

hi thorsten,

finally my PIC "is able to groove"

in fact, my JDM was ok

blindly following the instructions given on the jdm webpage, i forgot a selection wich wasn' mentioned :

 choosing a DEVICE !

with PIC16F877 in the device list, all goes corectly now (reading/programming).

So maybe you could add this in the webpage so other people meticulous like me won't mess up ?

Only the screenshot had this specified, wich led me on the good way.

thank you for your consideration, and may midibox be the next generation of award winning midi controllers  :D

RAF

Link to comment
Share on other sites

hi thorsten,

finally my PIC "is able to groove"

in fact, my JDM was ok

blindly following the instructions given on the jdm webpage, i forgot a selection wich wasn' mentioned :

 choosing a DEVICE !

with PIC16F877 in the device list, all goes corectly now (reading/programming).

So maybe you could add this in the webpage so other people meticulous like me won't mess up ?

Only the screenshot had this specified, wich led me on the good way.

thank you for your consideration, and may midibox be the next generation of award winning midi controllers  :D

RAF

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...