Page 1 of 10

pic programming failed

PostPosted: Wed Jul 29, 2009 5:02 am
by oliboy
i can't program my pic....can you help me...pls...pls...pls....
this is the message i get from winpic...

Info: Loading definitions for "PIC18F2550" from C:\Program Files\WinPic\devices.ini .
Info: Support for some newer PIC18F devices added by Martin v.d. Werff 2005
Couldn't find "devices\PIC18F2550.dev", please borrow/copy from MPLAB !
PIC18F: family='21'=4550, WriteLatch=32 bytes, EraseLatch=64 bytes .
Failed read back of DATA line (HIGH) !
WARNING: Could not initialize programmer !
Testing: delay(500ms) took 0.50 seconds, timer_freq=2800.0600 MHz ... ok
Programming...
Erasing ("bulk" or "chip") ...
Programming CODE, 0x000000..0x001692
Verifying CODE, 0x000000..0x001692
Verifying 0x000000..0x001692
Verify Error: 000000: read 000000, wanted 00EF30, mask 00FFFF ==> diff=00EF30
Verify Error: 000002: read 000000, wanted 00F00B, mask 00FFFF ==> diff=00F00B
Verify Error: 000004: read 000000, wanted 000012, mask 00FFFF ==> diff=000012
Verify Error: 000006: read 000000, wanted 000012, mask 00FFFF ==> diff=000012
More Verify Errors, unable to list all (total=2875)
Programming CONFIG, 0x300000..0x30000C
Verifying CONFIG, 0x300000..0x30000C
Verifying 0x300000..0x30000C
Verify Error: 300000: read 000000, wanted 000E22, mask 00FFFF ==> diff=000E22
Verify Error: 300002: read 000000, wanted 001E3F, mask 00FFFF ==> diff=001E3F
Verify Error: 300004: read 000000, wanted 0081FF, mask 00FFFF ==> diff=0081FF
Verify Error: 300006: read 000000, wanted 00FF85, mask 00FFFF ==> diff=00FF85
More Verify Errors, unable to list all (total=7)
ERROR: Programming FAILED !

Re: pic programming failed

PostPosted: Wed Jul 29, 2009 8:42 am
by Firelord
oliboy wrote:WARNING: Could not initialize programmer !

Check port settings in WinPic and your programming cable (I'd check the cable first). Your PIC cannot be programmed because the programmer does not initialize (wrong port or programmer type selected in WinPic, problems with the cable or its wiring, or even problems with the board, etc). Otherwise, there is a thread here which addresses a similar problem.

Re: pic programming failed

PostPosted: Fri Jul 31, 2009 1:55 am
by oliboy
when i start winpic i get this message
WARNING:could not initialize programmer...
i haven't connected anything to com port...
is this normal?..
what message should i get when i start winpic?..

Re: pic programming failed

PostPosted: Fri Jul 31, 2009 8:42 am
by Firelord
oliboy wrote:when i start winpic i get this message
WARNING:could not initialize programmer...
i haven't connected anything to com port...
is this normal?..
what message should i get when i start winpic?..

It is normal, because you actually have no programmer connected and there is nothing to initialize.

By the way, did you power up the board via USB when trying to flash the PIC with the programming cable? Did you follow these steps altogether?

Re: pic programming failed

PostPosted: Sat Aug 01, 2009 1:23 am
by oliboy
i did follow the steps...
this is that i get when i try to program...

Programming...
Erasing ("bulk" or "chip") ...
Programming CODE, 0x000000..0x001692
Verifying CODE, 0x000000..0x001692
Verifying 0x000000..0x001692
Verify Error: 000000: read 000000, wanted 00EF30, mask 00FFFF ==> diff=00EF30
Verify Error: 000002: read 000000, wanted 00F00B, mask 00FFFF ==> diff=00F00B
Verify Error: 000004: read 000000, wanted 000012, mask 00FFFF ==> diff=000012
Verify Error: 000006: read 000000, wanted 000012, mask 00FFFF ==> diff=000012
More Verify Errors, unable to list all (total=2875)
Programming CONFIG, 0x300000..0x30000C
Verifying CONFIG, 0x300000..0x30000C
Verifying 0x300000..0x30000C
Verify Error: 300000: read 000000, wanted 000E22, mask 00FFFF ==> diff=000E22
Verify Error: 300002: read 000000, wanted 001E3F, mask 00FFFF ==> diff=001E3F
Verify Error: 300004: read 000000, wanted 0081FF, mask 00FFFF ==> diff=0081FF
Verify Error: 300006: read 000000, wanted 00FF85, mask 00FFFF ==> diff=00FF85
More Verify Errors, unable to list all (total=7)
ERROR: Programming FAILED !

Re: pic programming failed

PostPosted: Sat Aug 01, 2009 8:39 am
by Firelord
Please provide more information on the type of board you are using.

A bunch of quick thoughts (possible reasons for failure):

- if you are trying to program the PIC via a USB-COM or cheap PCMCIA-COM -- it will not work;
- the programming cable is defective, too long or incorrectly wired;
- the board is defective, there are shorts/breaks somewhere, or some component(s) around the PIC is not working properly, also check that you are using a correct crystal in there.

Re: pic programming failed

PostPosted: Sat Aug 01, 2009 11:02 am
by jman 31
I ended up switching to a different computer. I still got the error but the computer recognized it and it flashed fine.

Re: pic programming failed

PostPosted: Sat Aug 01, 2009 12:53 pm
by Firelord
jman 31 wrote:I ended up switching to a different computer. I still got the error but the computer recognized it and it flashed fine.

Yeah, it's always a good idea to try that. But you didn't get this error:
WARNING: Could not initialize programmer !

did you?

Re: pic programming failed

PostPosted: Sat Aug 01, 2009 1:01 pm
by dmitri
oliboy wrote:Verify Error: 000000: read 000000, wanted 00EF30, mask 00FFFF ==> diff=00EF30

The fact that it reads zeros everywhere means one of these:
1. PIC is not powered up when you try to program it.
2. ICSP cable is wired incorrectly.
3. Wrong or faulty COM port.
4. WinPic is not configured correctly.

Re: pic programming failed

PostPosted: Sat Aug 01, 2009 1:07 pm
by jman 31
Firelord wrote:
jman 31 wrote:I ended up switching to a different computer. I still got the error but the computer recognized it and it flashed fine.

Yeah, it's always a good idea to try that. But you didn't get this error:
WARNING: Could not initialize programmer !

did you?


No actually, I think you are right. I guess that changing the computer wouldn't help there.