Searching \ for '[PIC]Copy from unprotected PIC then programming an' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devprogs.htm?key=programming
Search entire site for: 'Copy from unprotected PIC then programming an'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]Copy from unprotected PIC then programming an'
2010\06\10@174044 by RANDY ABERNATHY

flavicon
face
Hello:
 
I am fairly new to the PIC family and have some PICs with code in them, the code isn't protected, at least not according to my Melabs programmer and the person from whom I received the PIC.  I want to copy the code and then burn it into another PIC, possibly a different PIC.  This is a newbie question for sure. 
 
The one with the exisiting code is a PIC16C72A and I would like to be able to burn another PIC16C72A and also a Flash version of a PIC.  I have tried just copying and saving the code then burning it into another PIC of the same type but nothing works.  I know that an "include" file needs to be sent with the functional code and am wondering if that is my problem, even trying to burn the code into a PIC of the same type as the one from which the code was copied.
 
Your help will be greatly appreciated

Randy Abernathy
CNC and Industrial Machinery
service, repair, installation and
design

4626 Old Stilesboro Rd NW
Acworth, GA 30101
Fax: 770-974-5295
Phone: 678-982-0235
E-mail:
spam_OUTrandyabernathyTakeThisOuTspambellsouth.net

2010\06\10@175813 by Jan-Erik Soderholm

face picon face


On 2010-06-10 23:40, RANDY ABERNATHY wrote:
> Hello:
>
> I am fairly new to the PIC family and have some PICs with code in them,
> the code isn't protected, at least not according to my Melabs programmer
> and the person from whom I received the PIC.  I want to copy the code
> and then burn it into another PIC, possibly a different PIC.  This is a
> newbie question for sure.
>
> The one with the exisiting code is a PIC16C72A and I would like to be
> able to burn another PIC16C72A

That would probably be OK.

> and also a Flash version of a PIC.

Not "a PIC" as in "any PIC"
You probably want to use the PIC16F72.

> I have tried just copying and saving the code...

"Saving" how ? Using what tool ?
And what did you get efter the "save" ?

> then burning it into another PIC
> of the same type but nothing works.

Burning *how* ?
And what doesn't "work" ??

> I know that an "include" file needs to be sent...

Howe do you know that ? And what "include file" ?
What you need is the HEX file saved from the old PIC
containing the code. Nothing else.

{Quote hidden}

2010\06\10@181110 by RANDY ABERNATHY

flavicon
face
I copied the HEX code directly from the PIC16C72A.  Then I tried just burning it into another PIC16F72A and when I put the chip back into the circuit, nothing worked.  I also tried burning it into a PIC16F72 and that didn't work either.

I am using a Microengineering Labs USB programmer and I also have their EPIC parallel programmer.  This is what I used to copy the code to memory and also to burn the code into the new PIC.  I have tried both with the same results.
 
I hope this helps shed some additional light on the matter.
 
Thanks again,

Randy Abernathy
CNC and Industrial Machinery
service, repair, installation and
design

4626 Old Stilesboro Rd NW
Acworth, GA 30101
Fax: 770-974-5295
Phone: 678-982-0235
E-mail:
randyabernathyspamKILLspambellsouth.net

--- On Thu, 6/10/10, Jan-Erik Soderholm <.....jan-erik.soderholmKILLspamspam.....telia.com> wrote:


From: Jan-Erik Soderholm <EraseMEjan-erik.soderholmspam_OUTspamTakeThisOuTtelia.com>
Subject: Re: [PIC]Copy from unprotected PIC then programming another PIC
To: "Microcontroller discussion list - Public." <piclistspamspam_OUTmit.edu>
Date: Thursday, June 10, 2010, 5:57 PM




On 2010-06-10 23:40, RANDY ABERNATHY wrote:
{Quote hidden}

That would probably be OK.

> and also a Flash version of a PIC.

Not "a PIC" as in "any PIC"
You probably want to use the PIC16F72.

> I have tried just copying and saving the code...

"Saving" how ? Using what tool ?
And what did you get efter the "save" ?

> then burning it into another PIC
> of the same type but nothing works.

Burning *how* ?
And what doesn't "work" ??

> I know that an "include" file needs to be sent...

Howe do you know that ? And what "include file" ?
What you need is the HEX file saved from the old PIC
containing the code. Nothing else.

> with the functional code and am wondering if that is my
> problem, even trying to burn the code into a PIC of the same type as the
> one from which the code was copied.
>
> Your help will be greatly appreciated
>
> Randy Abernathy CNC and Industrial Machinery service, repair,
> installation and design
>
> 4626 Old Stilesboro Rd NW Acworth, GA 30101 Fax: 770-974-5295 Phone:
> 678-982-0235 E-mail: @spam@randyabernathyKILLspamspambellsouth.net

2010\06\10@182020 by Michael Watterson

face picon face
Jan-Erik Soderholm wrote:
>
> Howe do you know that ? And what "include file" ?
> What you need is the HEX file saved from the old PIC
> containing the code. Nothing else.
>  
Generally true, but with some Programmers/Applications you will need to
manually set configword/fuses after selection of  PIC type.
Could be that's what's wrong.


2010\06\10@182605 by Bob Blick

face
flavicon
face


On Thu, 10 Jun 2010 15:11:02 -0700 (PDT), "RANDY ABERNATHY" said:
> I copied the HEX code directly from the PIC16C72A.  Then I tried just
> burning it into another PIC16F72A and when I put the chip back into the
> circuit, nothing worked.  I also tried burning it into a PIC16F72 and
> that didn't work either.
>
> I am using a Microengineering Labs USB programmer and I also have their
> EPIC parallel programmer.  This is what I used to copy the code to memory
> and also to burn the code into the new PIC.  I have tried both with the
> same results.

A couple of things come to mind.

One is that the PIC may actually be protected so the data you read from
it is bad.

The second is that the fuses may not be getting saved correctly, so your
new PIC, although programmed correctly, may have the wrong oscillator or
WDT setting.

Cheerful regards,

Bob

--
http://www.fastmail.fm - One of many happy users:
 http://www.fastmail.fm/docs/quotes.html

2010\06\10@182744 by Jan-Erik Soderholm

face picon face

On 2010-06-11 00:11, RANDY ABERNATHY wrote:

> I copied the HEX code directly from the PIC16C72A.

To what ? Did you get a .HEX file ?

> Then I tried just
> burning it into another PIC16F72A and when I put the chip back into the
> circuit, nothing worked.  I also tried burning it into a PIC16F72 and
> that didn't work either.

Your software should probably have said exactly how much it
burned into the PIC's. What those figures reasonable
and what you expected ? That is, compared to how much it
read from the original PIC ?



{Quote hidden}

2010\06\10@182943 by Isaac Marino Bavaresco

flavicon
face
Em 10/6/2010 19:11, RANDY ABERNATHY escreveu:
> I copied the HEX code directly from the PIC16C72A.  Then I tried just burning it into another PIC16F72A and when I put the chip back into the circuit, nothing worked.  I also tried burning it into a PIC16F72 and that didn't work either.
>  

Did you save the file in the HEX file format? It is not just a binary
image, it is a formated text file with hexadecimal number in it, with a
definite structure.

Did you read back the PIC that you just programmed? Did the file compare
with the original?

Try opening the original hex file in MPLAB and check in the program
memory window to see if the instructions make sense.


Best regards,

Isaac


{Quote hidden}

__________________________________________________
Fale com seus amigos  de graça com o novo Yahoo! Messenger
http://br.messenger.yahoo.com/

2010\06\10@190651 by RANDY ABERNATHY

flavicon
face
Thanks, I take it that the programmer may report no protection but in reality there might be protection.  I do have the exact same PIC with almost the exact code that does show protection is ON.  The PIC I am trying to read and copy is one with some minor changes that were made to the code in the protected chip.  When I read it the protection shows OFF.  However, I will be the first to admit things are not always the way they appear.  I will check regarding the fuses you mention.

Randy Abernathy
CNC and Industrial Machinery
service, repair, installation and
design

4626 Old Stilesboro Rd NW
Acworth, GA 30101
Fax: 770-974-5295
Phone: 678-982-0235
E-mail:
EraseMErandyabernathyspamspamspamBeGonebellsouth.net

--- On Thu, 6/10/10, Bob Blick <RemoveMEbobblickKILLspamspamftml.net> wrote:


From: Bob Blick <bobblickSTOPspamspamspam_OUTftml.net>
Subject: Re: [PIC]Copy from unprotected PIC then programming another PIC
To: "Microcontroller discussion list - Public." <spamBeGonepiclistSTOPspamspamEraseMEmit.edu>
Date: Thursday, June 10, 2010, 6:26 PM



On Thu, 10 Jun 2010 15:11:02 -0700 (PDT), "RANDY ABERNATHY" said:
> I copied the HEX code directly from the PIC16C72A.  Then I tried just
> burning it into another PIC16F72A and when I put the chip back into the
> circuit, nothing worked.  I also tried burning it into a PIC16F72 and
> that didn't work either.
>
> I am using a Microengineering Labs USB programmer and I also have their
> EPIC parallel programmer.  This is what I used to copy the code to memory
> and also to burn the code into the new PIC.  I have tried both with the
> same results.

A couple of things come to mind.

One is that the PIC may actually be protected so the data you read from
it is bad.

The second is that the fuses may not be getting saved correctly, so your
new PIC, although programmed correctly, may have the wrong oscillator or
WDT setting.

Cheerful regards,

Bob

--
http://www.fastmail.fm - One of many happy users:
  http://www.fastmail.fm/docs/quotes.html

2010\06\10@190848 by RANDY ABERNATHY

flavicon
face
According to the programmer software, when it verified the burn, it was OK.

Randy Abernathy
CNC and Industrial Machinery
service, repair, installation and
design

4626 Old Stilesboro Rd NW
Acworth, GA 30101
Fax: 770-974-5295
Phone: 678-982-0235
E-mail:
KILLspamrandyabernathyspamBeGonespambellsouth.net

--- On Thu, 6/10/10, Jan-Erik Soderholm <EraseMEjan-erik.soderholmspamEraseMEtelia.com> wrote:


From: Jan-Erik Soderholm <@spam@jan-erik.soderholm@spam@spamspam_OUTtelia.com>
Subject: Re: [PIC]Copy from unprotected PIC then programming another PIC
To: "Microcontroller discussion list - Public." <spamBeGonepiclistspamKILLspammit.edu>
Date: Thursday, June 10, 2010, 6:27 PM



On 2010-06-11 00:11, RANDY ABERNATHY wrote:

> I copied the HEX code directly from the PIC16C72A.

To what ? Did you get a .HEX file ?

> Then I tried just
> burning it into another PIC16F72A and when I put the chip back into the
> circuit, nothing worked.  I also tried burning it into a PIC16F72 and
> that didn't work either.

Your software should probably have said exactly how much it
burned into the PIC's. What those figures reasonable
and what you expected ? That is, compared to how much it
read from the original PIC ?



{Quote hidden}

>> 678-982-0235 E-mail: RemoveMErandyabernathyspamspamBeGonebellsouth.net

2010\06\10@191045 by RANDY ABERNATHY

flavicon
face
I didn't exactly do what  you are suggesting so I will try that.  I did compare the code in the newly burned PIC to the code I copied from the original PIC and it did appear to match.  Of course I could have missed something.

Randy Abernathy
CNC and Industrial Machinery
service, repair, installation and
design

4626 Old Stilesboro Rd NW
Acworth, GA 30101
Fax: 770-974-5295
Phone: 678-982-0235
E-mail:
spamBeGonerandyabernathy@spam@spamspam_OUTbellsouth.net

--- On Thu, 6/10/10, Isaac Marino Bavaresco <TakeThisOuTisaacbavarescospamspamyahoo.com.br> wrote:


From: Isaac Marino Bavaresco <isaacbavarescoEraseMEspamyahoo.com.br>
Subject: Re: [PIC]Copy from unprotected PIC then programming another PIC
To: "Microcontroller discussion list - Public." <RemoveMEpiclistEraseMEspamspam_OUTmit.edu>
Date: Thursday, June 10, 2010, 6:29 PM


Em 10/6/2010 19:11, RANDY ABERNATHY escreveu:
> I copied the HEX code directly from the PIC16C72A.  Then I tried just burning it into another PIC16F72A and when I put the chip back into the circuit, nothing worked.  I also tried burning it into a PIC16F72 and that didn't work either.
>   

Did you save the file in the HEX file format? It is not just a binary
image, it is a formated text file with hexadecimal number in it, with a
definite structure.

Did you read back the PIC that you just programmed? Did the file compare
with the original?

Try opening the original hex file in MPLAB and check in the program
memory window to see if the instructions make sense.


Best regards,

Isaac


{Quote hidden}

__________________________________________________
Fale com seus amigos  de graça com o novo Yahoo! Messenger
http://br.messenger.yahoo.com/

2010\06\10@193021 by ivp

face picon face
> I take it that the programmer may report no protection but in
> reality there might be protection

If you look at the hex file you'd soon find out whether you have blank
data. Are you doing this through an editor or just chip-to-chip ?

2010\06\10@194900 by Bob Blick

face
flavicon
face

On Fri, 11 Jun 2010 11:30:14 +1200, "ivp" said:
> > I take it that the programmer may report no protection but in
> > reality there might be protection
>
> If you look at the hex file you'd soon find out whether you have blank
> data. Are you doing this through an editor or just chip-to-chip ?
>

I remember the old eprom PICs read out data when protected, but one of
the bits was always high or something like that. But just looking at it,
you'd think you read real program memory.

Cheers, Bob

--
http://www.fastmail.fm - Does exactly what it says on the tin

2010\06\10@203414 by Oli Glaser

flavicon
face


--------------------------------------------------
From: "Isaac Marino Bavaresco" <RemoveMEisaacbavaresco@spam@spamspamBeGoneyahoo.com.br>
Sent: Thursday, June 10, 2010 11:29 PM
To: "Microcontroller discussion list - Public." <.....piclist@spam@spamEraseMEmit.edu>
Subject: Re: [PIC]Copy from unprotected PIC then programming another PIC

{Quote hidden}

If you are doing this remember to set the correct processor in
configure->select device, otherwise it may interpret the opcodes incorrectly
IIRC. Then you can step through the dissassembly using MPLAB SIM if you
wish, to see if the code runs correctly.


2010\06\10@212035 by ivp

face picon face
> I remember the old eprom PICs read out data when protected, but
> one of the bits was always high or something like that. But just looking
> at it, you'd think you read real program memory

Yes, the OP has a 16C, which I've not used, so can't comment. Most
of my time with 16s was 16F using MPLAB and the PICStartPlus.
Those two together will not give you useable data from a protected chip
(IIRC the file is all 3FFF), as you'd hope from protection

If Randy's 16C is unprotected the contents should be able to be read,
edited, confirmed and written, like any imported hex file

2010\06\11@000047 by Craig Stevens

flavicon
face
Are you erasing the chip before programming?
Have you erased its clock calibration?heers
Craig

c

-----Original Message-----
From: .....piclist-bouncesRemoveMEspammit.edu [.....piclist-bouncesSTOPspamspam@spam@mit.edu] On Behalf Of RANDY ABERNATHY
Sent: Friday, 11 June 2010 9:07 AM
To: Microcontroller discussion list - Public.
Subject: Re: [PIC]Copy from unprotected PIC then programming another PIC

Thanks, I take it that the programmer may report no protection but in reality there might be protection.  I do have the exact same PIC with almost the exact code that does show protection is ON.  The PIC I am trying to read and copy is one with some minor changes that were made to the code in the protected chip.  When I read it the protection shows OFF.  However, I will be the first to admit things are not always the way they appear.  I will check regarding the fuses you mention.

Randy Abernathy
CNC and Industrial Machinery
service, repair, installation and
design

4626 Old Stilesboro Rd NW
Acworth, GA 30101
Fax: 770-974-5295
Phone: 678-982-0235
E-mail:
randyabernathyEraseMEspam@spam@bellsouth.net

--- On Thu, 6/10/10, Bob Blick <RemoveMEbobblickspamspamBeGoneftml.net> wrote:


From: Bob Blick <spamBeGonebobblickKILLspamspam@spam@ftml.net>
Subject: Re: [PIC]Copy from unprotected PIC then programming another PIC
To: "Microcontroller discussion list - Public." <piclistspam_OUTspam@spam@mit.edu>
Date: Thursday, June 10, 2010, 6:26 PM



On Thu, 10 Jun 2010 15:11:02 -0700 (PDT), "RANDY ABERNATHY" said:
> I copied the HEX code directly from the PIC16C72A.  Then I tried just
> burning it into another PIC16F72A and when I put the chip back into the
> circuit, nothing worked.  I also tried burning it into a PIC16F72 and
> that didn't work either.
>
> I am using a Microengineering Labs USB programmer and I also have their
> EPIC parallel programmer.  This is what I used to copy the code to memory
> and also to burn the code into the new PIC.  I have tried both with the
> same results.

A couple of things come to mind.

One is that the PIC may actually be protected so the data you read from
it is bad.

The second is that the fuses may not be getting saved correctly, so your
new PIC, although programmed correctly, may have the wrong oscillator or
WDT setting.

Cheerful regards,

Bob

--
http://www.fastmail.fm - One of many happy users:
  http://www.fastmail.fm/docs/quotes.html

2010\06\11@005019 by Sarin Sukumar A

picon face
YOurs SaRIn....


On Thu, Jun 10, 2010 at 4:10 PM, RANDY ABERNATHY <
spamBeGonerandyabernathy@spam@spambellsouth.net> wrote:

> I didn't exactly do what  you are suggesting so I will try that.  I did
> compare the code in the newly burned PIC to the code I copied from the
> original PIC and it did appear to match.  Of course I could have missed
> something.
>

If you try with Pickit2 you might get good results...

{Quote hidden}

>

2010\06\11@025139 by Tamas Rudnai

face picon face
I have never used C parts so I might wrong, however, I always thought that
you cannot read the program out as that is for OTP / production, not for
development. Can you confirm, that the data you read out is valid?

Tamas


On Fri, Jun 11, 2010 at 12:10 AM, RANDY ABERNATHY <
spam_OUTrandyabernathyspam_OUTspamspam_OUTbellsouth.net> wrote:

{Quote hidden}

>

2010\06\11@031141 by Xiaofan Chen

face picon face
On Fri, Jun 11, 2010 at 12:50 PM, Sarin Sukumar A
<KILLspamsarinsukumarspamBeGonespamgmail.com> wrote:
> If you try with Pickit2 you might get good results...

No, PICKit 2 does not support the OTP parts like 16C72A.
PICkit 3 and MPLAB ICD 2 do not support OTP parts either.
Last time when I worked with 16C72A, I was using Promate II.
But PICStart+ and PM3 should work as well.


--
Xiaofan http://mcuee.blogspot.com

2010\06\11@031238 by Xiaofan Chen

face picon face
On Fri, Jun 11, 2010 at 2:51 PM, Tamas Rudnai <@spam@tamas.rudnaiSTOPspamspam@spam@gmail.com> wrote:
> I have never used C parts so I might wrong, however, I always thought that
> you cannot read the program out as that is for OTP / production, not for
> development. Can you confirm, that the data you read out is valid?

You can of course read back the contend of the OTP chip
if they are not protected. If not, how do you verify the chip?

--
Xiaofan http://mcuee.blogspot.com

2010\06\11@031445 by Xiaofan Chen

face picon face
On Fri, Jun 11, 2010 at 11:53 AM, Craig Stevens <craigspamBeGonespamspamBeGonecatalyst.net.au> wrote:
> Are you erasing the chip before programming?
> Have you erased its clock calibration?heers

PIC16C72A has no calibration part. And it is an OTP part,
so no erase actually. You can blank check it. If it is not
blank, pretty much you can not use it any more (not
exactly right, since there are tricks to use it in certain
cases, but that is just exception).



--
Xiaofan http://mcuee.blogspot.com

2010\06\11@031855 by Xiaofan Chen

face picon face
On Fri, Jun 11, 2010 at 6:11 AM, RANDY ABERNATHY
<spamBeGonerandyabernathyspambellsouth.net> wrote:
> I copied the HEX code directly from the PIC16C72A.
> Then I tried just burning it into another PIC16F72A and when I
> put the chip back into the circuit, nothing worked.  I also tried
> burning it into a PIC16F72 and that didn't work either.

16C72A and 16F72 are not the same, you may have to change some
settings to get it work.

There are no such thing as PIC16F72A.

And be careful there are PIC16C72 and PIC16C72A. They are
not the same.


--
Xiaofan http://mcuee.blogspot.com

2010\06\11@034116 by Oli Glaser

flavicon
face


--------------------------------------------------
From: "Xiaofan Chen" <spam_OUTxiaofancSTOPspamspamgmail.com>
Sent: Friday, June 11, 2010 8:14 AM
To: "Microcontroller discussion list - Public." <RemoveMEpiclistspamspammit.edu>
Subject: Re: [PIC]Copy from unprotected PIC then programming another PIC

{Quote hidden}

I *think* they did have a JW suffix for a windowed version of this part that
could be erased. Its possible the OP has this version.


2010\06\11@080247 by Olin Lathrop

face picon face
RANDY ABERNATHY wrote:
> The one with the exisiting code is a PIC16C72A and I would like to be
> able to burn another PIC16C72A

That should work if your original PIC truly isn't code protected and your
programmer+software reads back everything.  Check your programmer software
docs.  Maybe it needs some option to read back everything into a HEX file?

Why not create a HEX file again from the source code?

> and also a Flash version of a PIC.

There will most likely be config bit differences, and possibly memory map
differences depending on how different a PIC you chose.  These should be
small changes to the source code if it was written right, then rebuild for
the new PIC from there.

2010\06\11@082048 by Olin Lathrop

face picon face
Tamas Rudnai wrote:
> I have never used C parts so I might wrong, however, I always thought
> that you cannot read the program out as that is for OTP / production,
> not for development.

No, you can read C parts as long as they are not code protected.  Think
about it.  How else would the programmer be able to verify the code got into
the part correctly.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2010\06\11@182457 by RANDY ABERNATHY

flavicon
face
Isaac:
 
I was told you couldn't disassemble the HEX code when read from the PIC.  From what you are telling me I can.  That would enormously helpful if I can. This code is so old that the original source code no longer exists but I do have, what I have told, is an unprotected OTP chip.  My Melabs programmer also indicates it is unprotected so I am assuming it is.  I also had a typo in the post to which you responded, when I said I tried burning it into "another PIC16F72A" I meant "another PIC16C72A" of course.
 
I will see if I can do what you suggest, that would be fantastic if I can.  Please bear with me, I am pretty new to the PICs and have been finding out they are somewhat different from the older MCUs I have worked with like the 8051 - 8052 stuff.
 
Many thanks to you and everyone for all the suggestions and help.

Randy Abernathy
CNC and Industrial Machinery
service, repair, installation and
design

4626 Old Stilesboro Rd NW
Acworth, GA 30101
Fax: 770-974-5295
Phone: 678-982-0235
E-mail:
KILLspamrandyabernathyspamspamspam_OUTbellsouth.net

--- On Thu, 6/10/10, Oli Glaser <oli.glaserRemoveMEspamtalktalk.net> wrote:


From: Oli Glaser <EraseMEoli.glaserSTOPspamspamRemoveMEtalktalk.net>
Subject: Re: [PIC]Copy from unprotected PIC then programming another PIC
To: "Microcontroller discussion list - Public." <spam_OUTpiclistRemoveMEspamEraseMEmit.edu>
Date: Thursday, June 10, 2010, 8:34 PM




--------------------------------------------------
From: "Isaac Marino Bavaresco" <TakeThisOuTisaacbavarescoRemoveMEspam@spam@yahoo.com.br>
Sent: Thursday, June 10, 2010 11:29 PM
To: "Microcontroller discussion list - Public." <EraseMEpiclistRemoveMEspammit.edu>
Subject: Re: [PIC]Copy from unprotected PIC then programming another PIC

{Quote hidden}

If you are doing this remember to set the correct processor in
configure->select device, otherwise it may interpret the opcodes incorrectly
IIRC. Then you can step through the dissassembly using MPLAB SIM if you
wish, to see if the code runs correctly.

2010\06\11@182907 by RANDY ABERNATHY

flavicon
face
I would say chip to chip since I have  been reading the old PIC with my programmer then inserting another and attempting to burn it.  I know that normally, when a PIC is protected you usually show all FFFF in the memory and the protected chips I do have show exactly that, however this one does not, it has different HEX data in each address location which leads me to think it truly isn't protected.  The person that sent it to me said it wasn't.  It is from a rather old controller that operates a heater, fan, etc. and he couldn't find any of the actual source code left in his files.  Which doesn't surprise me.

Randy Abernathy
CNC and Industrial Machinery
service, repair, installation and
design

4626 Old Stilesboro Rd NW
Acworth, GA 30101
Fax: 770-974-5295
Phone: 678-982-0235
E-mail:
spamrandyabernathy.....spamspambellsouth.net

--- On Thu, 6/10/10, ivp <joecolquittspam_OUTspam@spam@clear.net.nz> wrote:


From: ivp <.....joecolquittspamspam.....clear.net.nz>
Subject: Re: [PIC]Copy from unprotected PIC then programming another PIC
To: "Microcontroller discussion list - Public." <piclistKILLspamspamEraseMEmit.edu>
Date: Thursday, June 10, 2010, 7:30 PM


> I take it that the programmer may report no protection but in
> reality there might be protection

If you look at the hex file you'd soon find out whether you have blank
data. Are you doing this through an editor or just chip-to-chip ?

2010\06\11@183159 by RANDY ABERNATHY

flavicon
face
Sorry, that was a typo and it should have read "another PIC16C72A"  I realize there isn't a PIC16F72A but there is a PIC16F72.  I was tired and am getting old.

Randy Abernathy
CNC and Industrial Machinery
service, repair, installation and
design

4626 Old Stilesboro Rd NW
Acworth, GA 30101
Fax: 770-974-5295
Phone: 678-982-0235
E-mail:
EraseMErandyabernathy@spam@spam@spam@bellsouth.net

--- On Fri, 6/11/10, Xiaofan Chen <@spam@xiaofancspamspamKILLspamgmail.com> wrote:


From: Xiaofan Chen <spamBeGonexiaofancRemoveMEspamEraseMEgmail.com>
Subject: Re: [PIC]Copy from unprotected PIC then programming another PIC
To: "Microcontroller discussion list - Public." <RemoveMEpiclistKILLspamspamRemoveMEmit.edu>
Date: Friday, June 11, 2010, 3:18 AM


On Fri, Jun 11, 2010 at 6:11 AM, RANDY ABERNATHY
<TakeThisOuTrandyabernathyspambellsouth.net> wrote:
> I copied the HEX code directly from the PIC16C72A.
> Then I tried just burning it into another PIC16F72A and when I
> put the chip back into the circuit, nothing worked.  I also tried
> burning it into a PIC16F72 and that didn't work either.

16C72A and 16F72 are not the same, you may have to change some
settings to get it work.

There are no such thing as PIC16F72A.

And be careful there are PIC16C72 and PIC16C72A. They are
not the same.


--
Xiaofan http://mcuee.blogspot.com

2010\06\11@184336 by Olin Lathrop

face picon face
RANDY ABERNATHY wrote:
> I was told you couldn't disassemble the HEX code when read from the
> PIC. From what you are telling me I can.

Of course you can.  Obviously the machine can interpret each instruction, so
some interpretation program could too.  The problem is that while it is
possible to create a assembly file that results in the code you have, it's
only the bare instructions.  It won't tell you the intent of the programmer,
and all original label names, comments, and module structure will be lost.

All in all, if you've managed to lose the source code (look up something
called "backups"), it's probably easier to start with the spec and write the
code from scratch than to reverse engineer the dissassembly result.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2010\06\11@184347 by Isaac Marino Bavaresco

flavicon
face
Em 11/6/2010 19:29, RANDY ABERNATHY escreveu:
> I would say chip to chip since I have  been reading the old PIC with my programmer then inserting another and attempting to burn it.  I know that normally, when a PIC is protected you usually show all FFFF in the memory and the protected chips I do have show exactly that, however this one does not, it has different HEX data in each address location which leads me to think it truly isn't protected.  The person that sent it to me said it wasn't.  It is from a rather old controller that operates a heater, fan, etc. and he couldn't find any of the actual source code left in his files.  Which doesn't surprise me.
>  


By my experience, PICs read all FFs when erased and all 00s when protected.
Make sure you aren't reading an erased chip (or perhaps you erased it by
accident while messing around with your programmer).

Best regards,
Isaac

__________________________________________________
Fale com seus amigos  de graça com o novo Yahoo! Messenger
http://br.messenger.yahoo.com/

2010\06\11@184621 by Olin Lathrop

face picon face
RANDY ABERNATHY wrote:
> It is from a rather old controller
> that operates a heater, fan, etc. and he couldn't find any of the
> actual source code left in his files.

Idiot alert!  Unless he's paying you a lot, get out of there fast.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2010\06\11@184846 by Olin Lathrop

face picon face
Isaac Marino Bavaresco wrote:
> (or perhaps you erased it
> by accident while messing around with your programmer).

Not possible, since this is a OTP part.  It is possible to set 1 bits to 0,
but not to erase them back to 1s.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2010\06\11@185334 by Isaac Marino Bavaresco

flavicon
face
Em 11/6/2010 19:24, RANDY ABERNATHY escreveu:
> Isaac:
>  
> I was told you couldn't disassemble the HEX code when read from the PIC.  From what you are telling me I can.  That would enormously helpful if I can. This code is so old that the original source code no longer exists but I do have, what I have told, is an unprotected OTP chip.  My Melabs programmer also indicates it is unprotected so I am assuming it is.  I also had a typo in the post to which you responded, when I said I tried burning it into "another PIC16F72A" I meant "another PIC16C72A" of course.
>  
> I will see if I can do what you suggest, that would be fantastic if I can.  Please bear with me, I am pretty new to the PICs and have been finding out they are somewhat different from the older MCUs I have worked with like the 8051 - 8052 stuff.
>  
> Many thanks to you and everyone for all the suggestions and help.
>  

1 - Make sure your file is really HEX file format compliant with ".hex"
extension;
2 - In MPLAB IDE:
a) click "Configure" -> "Select Device" and select the correct device;
b) Click "File" -> "Import" and import the file;
c) Click "View" -> "Program Memory", tab "Symbolic".


Best regards,

Isaac


PS.: If your file is not a real HEX file but rather a binary file, there
are old command-line tools often called "bin2hex.exe" or the like that
can convert from binary to a valid HEX file.

__________________________________________________
Fale com seus amigos  de graça com o novo Yahoo! Messenger
http://br.messenger.yahoo.com/

2010\06\11@190551 by MCH

flavicon
face
You can read it, but I think any original labels will be replaced with
their generic chip references.

For example, a jump to something called "display" will be replaced with
jump to (address), and store to Displaylocation will be replaced with
store to (address). And of course any notes or comments will not be there.

Joe M.

RANDY ABERNATHY wrote:
{Quote hidden}

2010\06\11@203120 by Tamas Rudnai

face picon face
On Fri, Jun 11, 2010 at 11:24 PM, RANDY ABERNATHY <
spamrandyabernathy.....spam.....bellsouth.net> wrote:

> I was told you couldn't disassemble the HEX code when read from the PIC.
> From what you are telling me I can.  That would enormously helpful if I can.
> This code is so old that the original


You may can give a go with this tool I wrote a while back:

http://www.mcuhobby.com/articles.php?article_id=9

Tamas




{Quote hidden}

> -

2010\06\11@204628 by Dwayne Reid

flavicon
face
At 03:40 PM 6/10/2010, RANDY ABERNATHY wrote:
>Hello:
>
>I am fairly new to the PIC family and have some PICs with code in
>them, the code isn't protected, at least not according to my Melabs
>programmer and the person from whom I received the PIC.  I want to
>copy the code and then burn it into another PIC, possibly a
>different PIC.  This is a newbie question for sure.

I don't have any experience with the MELABS programmer so all I can
is suggest a couple of things.

First, and most important: Make Sure that your programmer is set up
to work with the exact chip that you are trying to copy.

1) Your programmer software probably has somewhere that you can pick
and choose what you are going to read and program.  For your 'C'
chip, pretty much all you need to read and program is the program
memory and the configuration bits.

That means that you have to tell your programmer to read both the
program and configuration.  Check the menus to see if there is
somewhere that you can check or change those settings.

2) When you put your chip with the program that you want to copy into
the programmer and hit the 'Read' button, you place a copy of the
contents of that chip into your computer's RAM.

3) If you now place a blank chip in the programmer socket, you can
hit the 'Program' button and program that brand-new empty chip with
what you read from the first chip.

That's pretty much all that you need to do.

Couple of things to check on first:

1) Make sure that your programmer is reading and writing the
configuration bits.  Your brand-new PIC with a perfect copy of the
program burned into it still won't run if the configuration bits are wrong.

2) Make sure that those new chips that you are trying to program are
in fact brand-new and have not already been programmed with
anything.  That particular PIC family is One Time Programmable (OTP)
and you can generally only program them once.

If nothing seems to work, see if you can find someone with a PIC
Start Plus programmer.  I could then give you an exact step-by-step
procedure on how to copy your original PIC into a new one.

Hope this helps!

dwayne

--
Dwayne Reid   <RemoveMEdwaynerspamBeGonespamspamplanet.eon.net>
Trinity Electronics Systems Ltd    Edmonton, AB, CANADA
(780) 489-3199 voice          (780) 487-6397 fax
http://www.trinity-electronics.com
Custom Electronics Design and Manufacturing

2010\06\11@220331 by RANDY ABERNATHY

flavicon
face
Thanks, I assumed any disassembly would lose comments, etc.  It is the same with other MCUs with which I have worked in the past.  Although I can't say I haven't done something that stupid, it wasn't me this time.  Someone else lost the source code for this one.  I am beginning to think it might be easier to just do this from scratch myself.
 
Thanks again,

Randy Abernathy
CNC and Industrial Machinery
service, repair, installation and
design

4626 Old Stilesboro Rd NW
Acworth, GA 30101
Fax: 770-974-5295
Phone: 678-982-0235
E-mail:
@spam@randyabernathyspamspambellsouth.net

--- On Fri, 6/11/10, Olin Lathrop <TakeThisOuTolin_piclistKILLspamspam@spam@embedinc.com> wrote:


From: Olin Lathrop <.....olin_piclistRemoveMEspamembedinc.com>
Subject: Re: [PIC]Copy from unprotected PIC then programming another PIC
To: "Microcontroller discussion list - Public." <KILLspampiclistspamTakeThisOuTmit.edu>
Date: Friday, June 11, 2010, 6:43 PM


RANDY ABERNATHY wrote:
> I was told you couldn't disassemble the HEX code when read from the
> PIC. From what you are telling me I can.

Of course you can.  Obviously the machine can interpret each instruction, so
some interpretation program could too.  The problem is that while it is
possible to create a assembly file that results in the code you have, it's
only the bare instructions.  It won't tell you the intent of the programmer,
and all original label names, comments, and module structure will be lost.

All in all, if you've managed to lose the source code (look up something
called "backups"), it's probably easier to start with the spec and write the
code from scratch than to reverse engineer the dissassembly result.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2010\06\11@220551 by RANDY ABERNATHY

flavicon
face
This chip doesn't read all 0000 or all FFFF.  Regardless, I am pretty certain this one is not erased. 

Randy Abernathy
CNC and Industrial Machinery
service, repair, installation and
design

4626 Old Stilesboro Rd NW
Acworth, GA 30101
Fax: 770-974-5295
Phone: 678-982-0235
E-mail:
TakeThisOuTrandyabernathyspamspam_OUTbellsouth.net

--- On Fri, 6/11/10, Isaac Marino Bavaresco <RemoveMEisaacbavarescospamspamSTOPspamyahoo.com.br> wrote:


From: Isaac Marino Bavaresco <.....isaacbavarescoEraseMEspamyahoo.com.br>
Subject: Re: [PIC]Copy from unprotected PIC then programming another PIC
To: "Microcontroller discussion list - Public." <spamBeGonepiclistspamRemoveMEmit.edu>
Date: Friday, June 11, 2010, 6:43 PM


Em 11/6/2010 19:29, RANDY ABERNATHY escreveu:
> I would say chip to chip since I have  been reading the old PIC with my programmer then inserting another and attempting to burn it.  I know that normally, when a PIC is protected you usually show all FFFF in the memory and the protected chips I do have show exactly that, however this one does not, it has different HEX data in each address location which leads me to think it truly isn't protected.  The person that sent it to me said it wasn't.  It is from a rather old controller that operates a heater, fan, etc. and he couldn't find any of the actual source code left in his files.  Which doesn't surprise me.
>   


By my experience, PICs read all FFs when erased and all 00s when protected.
Make sure you aren't reading an erased chip (or perhaps you erased it by
accident while messing around with your programmer).

Best regards,
Isaac

__________________________________________________
Fale com seus amigos  de graça com o novo Yahoo! Messenger
http://br.messenger.yahoo.com/

2010\06\11@220741 by RANDY ABERNATHY

flavicon
face
Olin:
 
I am afraid this is a "government" job for my brother-in-law and I am working on it whenever I get the time.  I am retired anyway and this just helps keep what little brain I have left working.  But, you are correct this would a good one for an "idiot alert"

Randy Abernathy
CNC and Industrial Machinery
service, repair, installation and
design

4626 Old Stilesboro Rd NW
Acworth, GA 30101
Fax: 770-974-5295
Phone: 678-982-0235
E-mail:
.....randyabernathyEraseMEspambellsouth.net

--- On Fri, 6/11/10, Olin Lathrop <spamolin_piclistspam_OUTspam@spam@embedinc.com> wrote:


From: Olin Lathrop <spamolin_piclist@spam@spamSTOPspamembedinc.com>
Subject: Re: [PIC]Copy from unprotected PIC then programming another PIC
To: "Microcontroller discussion list - Public." <spamBeGonepiclistspamBeGonespam@spam@mit.edu>
Date: Friday, June 11, 2010, 6:46 PM


RANDY ABERNATHY wrote:
> It is from a rather old controller
> that operates a heater, fan, etc. and he couldn't find any of the
> actual source code left in his files.

Idiot alert!  Unless he's paying you a lot, get out of there fast.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2010\06\11@221035 by RANDY ABERNATHY
flavicon
face
Olin also the persone that deleted his source code is just  guy that had done basically the same type of thing for himself for a wood heater in his house.  I can guarantee if I had written the original code I would have every version I created right from the first line.  Guess I am a pack rat in that sense.  I do use up a lot of disk space that way tho. 

Randy Abernathy
CNC and Industrial Machinery
service, repair, installation and
design

4626 Old Stilesboro Rd NW
Acworth, GA 30101
Fax: 770-974-5295
Phone: 678-982-0235
E-mail:
RemoveMErandyabernathyRemoveMEspamRemoveMEbellsouth.net

--- On Fri, 6/11/10, Olin Lathrop <olin_piclistKILLspamspamspamembedinc.com> wrote:


From: Olin Lathrop <spam_OUTolin_piclist@spam@spamembedinc.com>
Subject: Re: [PIC]Copy from unprotected PIC then programming another PIC
To: "Microcontroller discussion list - Public." <TakeThisOuTpiclistspam_OUTspammit.edu>
Date: Friday, June 11, 2010, 6:46 PM


RANDY ABERNATHY wrote:
> It is from a rather old controller
> that operates a heater, fan, etc. and he couldn't find any of the
> actual source code left in his files.

Idiot alert!  Unless he's paying you a lot, get out of there fast.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

More... (looser matching)
- Last day of these posts
- In 2010 , 2011 only
- Today
- New search...