PIC18f- "Target Device ID (0x0) does not match expected Device ID

Thread Starter

talkcircuit

Joined Dec 16, 2015
6
PIC18f- "Target Device ID (0x0) does not match expected Device ID"

hi everyone,

im new here but i read a similar topic about programming and erasing with pickit3 and a flash pic18f and was hoping some one could help me get these pic18f to read and program again.

i got a few development boards with pic18f flash micro controllers on them. they work fine but I want to use them for something else.

when i try to read or erase them with the pickit3 and MPLAB IPE it keeps telling me "Target Device ID (0x0) does not match expected Device ID"
I even took them off and put them in a socket to dip to isolate any problems.

I tried all voltages from 4v-5v in MPLAB IPE and tried erasing at all voltages even tried LVP. I tried to fill in the entire memory and erase again but all attempts to program fail.

I not sure where the BULK ERASE function is but im pretty sure the erase button i used is sufficent.


Does any one know how I can erase or reset this microchip pic18f chips so I can program them?
 

Picbuster

Joined Dec 2, 2013
1,047
Hi man, You have a problem.
the message Target Device ID (0x0) does not match expected Device ID" indicates that programmer is not getting an answer or not able to talk into the pic18
Please follow the following steps.
A:check connection chip pgd to pin4 from pickit 3
B:check connection chip pgc to pin5 from pickit 3
C; check if mclr pin is not connected direct to a cap. ( minimum 1K between cap and mclr pin.
d: vdd to pin 2 of pickit ( check if this is feeding the chip normaly you have to switch powersup on)
e: gnd pin 3
carefull with voltage via pickit some pic18F go @ vdd=5V+ to microchips heaven.

If all fail: sit in the corner and cry.
clean your face and keep us posted for futher help.
 

ErnieM

Joined Apr 24, 2011
8,377
Look at the target ID number: 0x0 is zero, and indicated the programmer did not find your target device, it found nothing.

Check the connects. Check them again. My favorite way to screw it up is to swap the data and clock lines.
 

Papabravo

Joined Feb 24, 2006
21,159
Windoze can also do this to you with cute little apps that prevent the USB ports from working correctly. In my case it was a piece of Dell crapware called SyncUp that hosed my USB ports. I used CCleaner to remove it from the Startup process and have not had a problem since.
 

Thread Starter

talkcircuit

Joined Dec 16, 2015
6
Thank all for the tips,

Let me also add that I bought a new pic18f device chip and i can read and program it fine with the Pickit3 setup so I believe my whole setup is working fine. Like I said I am using a socket with dip direct to the pickit3, so I dont think I need to add caps and resistors as it already works just find with another pic18f device chip.

I read on other forums that locked pic chips seem to not read or report no id until you do a full erase or fill them up or do something special things to get to to unlock. Im not sure. Im sure this is a locked pic i just want to erase it and use it for something else.

Also a different question. Does any one know if there is any program to convert a hex from one microchip pic device to another without modifying all the config hex bits?
 

Papabravo

Joined Feb 24, 2006
21,159
Thank all for the tips,

Let me also add that I bought a new pic18f device chip and i can read and program it fine with the Pickit3 setup so I believe my whole setup is working fine. Like I said I am using a socket with dip direct to the pickit3, so I dont think I need to add caps and resistors as it already works just find with another pic18f device chip.

I read on other forums that locked pic chips seem to not read or report no id until you do a full erase or fill them up or do something special things to get to to unlock. Im not sure. Im sure this is a locked pic i just want to erase it and use it for something else.

Also a different question. Does any one know if there is any program to convert a hex from one microchip pic device to another without modifying all the config hex bits?
That would be a really tall order. How would you fix something if it was wrong?
 

JohnInTX

Joined Jun 26, 2012
4,787
Also a different question. Does any one know if there is any program to convert a hex from one microchip pic device to another without modifying all the config hex bits?
The config bits are appended to the end of the Intel HEX file. You can use a text editor to delete those. Import the .HEX into MPLAB 8.x with the new processor selected. Set the config bits manually in the project then export the .HEX to a new file.

All of this is of limited use since different PICs have different memory maps etc. but I've used the procedure to update old .hex files to a newer, compatible chip that has extended config bits.
 

Thread Starter

talkcircuit

Joined Dec 16, 2015
6
That would be a really tall order. How would you fix something if it was wrong?
what do you mean tall order?

the microchip PIC chip converter or resetting the protected pic18f chip so you can program it again?

I read that all the pic with the letter F should be re-programmable unlimited times but it appears as if I have 3 here that work in circuit but are completely locked. Peoples stories dont add up.
 

JohnInTX

Joined Jun 26, 2012
4,787
(F)lash PICs can be reprogrammed many but not unlimited times. The typical number is in the databook for your PIC.
A write-protected PIC can be erased and reprogrammed (but not read) using a suitable Microchip programmer. You need to know if the config bits are set for Low Voltage Programming for ICSP but in a socket, you should be able to use HighVoltage programming (apply Vpp to MCLR/) - for most chips.. and if your programmer supports it.
If you have specific questions about your particular PIC18Fxxx, download the Programming Specification for your chip.
But first, as the others say, you have to fix the 'Target is 0x00' message. That means no communication between programmer and chip - for the reasons listed above. If you get a 'Target 0xdddd does not match..." that means that you are connected, comms are good but the programmer is expecting a different chip.
As far as moving a .HEX file to another 18F chip, like PB says, its a tall order i.e. it could be relatively easy or impossible, depending on the chip you want to move it to. Not all 18F are the same inside. Which PIC do you have the code for and which one do you want to move it to?

What happened to the source code?
 

Papabravo

Joined Feb 24, 2006
21,159
what do you mean tall order?

the microchip PIC chip converter or resetting the protected pic18f chip so you can program it again?

I read that all the pic with the letter F should be re-programmable unlimited times but it appears as if I have 3 here that work in circuit but are completely locked. Peoples stories dont add up.
The tall order is having a .hex file for one type of PIC, and a database of all PICs or maybe just PICs from the same family so you could apply an algorithm to read in in a .hex file, analyze what the file is doing, look for things that won't work and, write out a result with new config bits.

I agree that you can do this by hand pretty quickly. Automating the process is still in my estimation a tall order. I was responding to the last line in the original post.
 

Thread Starter

talkcircuit

Joined Dec 16, 2015
6
I understand,

I was just inquiring about possible converter software. It seems I never know everything about whats out there.

I understand these pic chips are very different and have very different config settings and options so its not really easy to convert. I just asked and it really does not matter.


The real problem is this pic18f that wont unlock and keeps reading as device 0x0 . This is quite odd to me because the new pic18f i bought from mouser works perfect in my pickit3 programmer setup.

I don't know why its not working.
 
Last edited:

Papabravo

Joined Feb 24, 2006
21,159
I'm not certain that you are interpreting the evidence correctly. As has been mentioned, getting a return code of 0x0, is different than preventing you from reading the contents. The usual meaning of "locked" is that you are prevented from reading the contents of Program(Code) memory and/or non-volatile data memory. The property of being locked says nothing about being able to identify the chip. In any case you can always erase a chip that you cannot read. That achieves the security objective of the original maker. Your problem is fundamentally different.
 
Top