Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

MPLAB ICD2 initialization error

Status
Not open for further replies.
I got this PCB of RS-232 ICD2 from a friend of mine.Kinda DIY stuff.The MCU implemented is PIC16F877A,while its HEX file is from a cyber resource without source code.I managed burning the chip elsewhere and detecting the ICD in MPLAB.But an error occured during the self test phase as below:

Connecting to MPLAB ICD 2
...Connected
Setting Vdd source to target
ICDWarn0020: Invalid target device id (expected=0xE2, read=0x0)
...Reading ICD Product ID
Running ICD Self Test
... Failed Self Test. See ICD2 Settings (status tab) for details.
MPLAB ICD 2 Ready

I accessed the status tab and found the settings there,but don't know how to prevent such error from occuring again.I suppose there's something wrong with the hardware,most probably the supply voltage.Could anyone offer a clue?By the way,I have 6 free samples of PIC16LF877A.What exactly is the difference between it and F877A?Only low voltage?

My thanks in advance.
 
Alex_rcpilot said:
I got this PCB of RS-232 ICD2 from a friend of mine.Kinda DIY stuff.The MCU implemented is PIC16F877A,while its HEX file is from a cyber resource without source code.I managed burning the chip elsewhere and detecting the ICD in MPLAB.But an error occured during the self test phase as below:

Connecting to MPLAB ICD 2
...Connected
Setting Vdd source to target
ICDWarn0020: Invalid target device id (expected=0xE2, read=0x0)
...Reading ICD Product ID
Running ICD Self Test
... Failed Self Test. See ICD2 Settings (status tab) for details.
MPLAB ICD 2 Ready

I accessed the status tab and found the settings there,but don't know how to prevent such error from occuring again.I suppose there's something wrong with the hardware,most probably the supply voltage.Could anyone offer a clue?By the way,I have 6 free samples of PIC16LF877A.What exactly is the difference between it and F877A?Only low voltage?

My thanks in advance.
Your problem are voltage levels, can you take a screen shot of your measured voltages (MPLABs windows of them), also take a Voltmeter and measure them in the ICD2.
16LF877A should be the same as 16F877A, but make sure you have the special 'A' bootlader version (standart ICD2 bootloader is for non-A versions of PIC16F877).
 
Thanks Jay I think I found the problem - the power supply is too high.I found it in the tab this time.Then I when to the MPLAB help file for power supply standard.It says 9V.I used some other programer's transformer with nominal 12V output just becaused the ICD2 is a DIYed device with no wall cube coming along.

Will 12V(actual output around 13.3V)cause a real problem during usual operation?Do I have to get a new power supply of 9V/0.75A?

If the LF877A is every bit the same with F877A logically(maybe product IDs are slightly different?),can I just choose PIC16F877A in MPLAB and burn the HEX into an LF877A?Yes,the file is for chips with an 'A' type.

By the way.When I program a pic from 'programer>program' in MPLAB,is it possible that the configuration word is left out?The datasheet says 'It is important to note that address 2007h is beyond the user program memory space which can be accessed
only during programming.' So the decimal address should be 8199.Higher than the 8K ROM's top addr.That's what worries me.
 
'It is important to note that address 2007h is beyond the user program memory space which can be accessed
only during programming.'
yes you can neither read nor write to the config word during normal running of the PIC.
only during programming can the config be changed.
 
It should .. have you changed the config word ? in your assembly program that you are burning.?
 
No,I thought you said it's impossible to change the config word in the assembly code.I can set the word in MPLAB settings(Configure>Configuration bits).Just not sure whether it was written into the chip.I became suspicious because when I found my device not working.I had the firmware written into 2 16F877A chips elsewhere,to DIY two identical ICD2.And I think I've made a mistake setting the config word while writting one of them.It turn out as I expected when I ran them both - one of them didn't work.So I tried rewriting this one with the other,with the correct configuration settings in MPLAB.However it still didn't work after that.Eventually I used another third party ICSP programer to set the config word only,just as I set it in MPLAB,and then it worked!Does that mean ICD2 failed in writing the configuration word?
 
You should be able to read the config word during Programming of the F877
No,I thought you said it's impossible to change the config word in the assembly code.
no that is not what i said ..
i said during programming of the PIC is the "only time " that you can read and write the config word..
anyway you should be able to read back what you wrote to the config word , during programming ..
 
Then I misunderstood you :) I saw you asking about assembly code.
williB said:
It should .. have you changed the config word ? in your assembly program that you are burning.?
Naturally thought you might have implied that I attempted accessing the config word in my firmware.But why did you ask about the assembly indeed?Coz I don't think it has anything to do with config word as it's set in MPLAB.

I tried reading the config word but I'm not sure if the config settings are refreshed after that.It just remained as I set it before programing.And if it had been refreshed indicating a successful configuring operation,the device should have worked.

I will keep checking for unexpected problems existing elsewhere.
 
First I have to make it clear that I didn't design it.It's from a friend of my friend's.

I believe this very man didn't design the whole stuff either.He must have got some info from a website and did some modification.I know this website and I have a pdf from it explaining how to DIY an ICD2.But unfortunately both the site and the file are in Chinese,which most of the people here don't understand.Yet I think there must be some English site with samilar information.Why don't you do a web search?

I lent someone my digital cam,so I can't take a shot of the real stuff right now.Just copied a 3D image generated by Protel.Sorry for this.If you need a picture you may need to wait a few days :)
 

Attachments

  • icd2.jpg
    icd2.jpg
    328.9 KB · Views: 1,285
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top