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:
randyab...@bellsouth.net
--
http://www.piclist.com PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
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.
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:
randyab...@bellsouth.net
--- On Thu, 6/10/10, Jan-Erik Soderholm <jan-erik....@telia.com> wrote:
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
> 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 ?
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
__________________________________________________
Fale com seus amigos de graça com o novo Yahoo! Messenger
http://br.messenger.yahoo.com/
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:
randyab...@bellsouth.net
--- On Thu, 6/10/10, Bob Blick <bobb...@ftml.net> wrote:
From: Bob Blick <bobb...@ftml.net>
Subject: Re: [PIC]Copy from unprotected PIC then programming another PIC
To: "Microcontroller discussion list - Public." <pic...@mit.edu>
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:
randyab...@bellsouth.net
--- On Thu, 6/10/10, Isaac Marino Bavaresco <isaacba...@yahoo.com.br> wrote:
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
--------------------------------------------------
From: "Isaac Marino Bavaresco" <isaacba...@yahoo.com.br>
Sent: Thursday, June 10, 2010 11:29 PM
To: "Microcontroller discussion list - Public." <pic...@mit.edu>
Subject: Re: [PIC]Copy from unprotected PIC then programming another PIC
> 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.
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.
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
c
On Thu, Jun 10, 2010 at 4:10 PM, RANDY ABERNATHY <
randyab...@bellsouth.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...
Tamas
--
int main() { char *a,*s,*q; printf(s="int main() { char *a,*s,*q;
printf(s=%s%s%s, q=%s%s%s%s,s,q,q,a=%s%s%s%s,q,q,q,a,a,q); }",
q="\"",s,q,q,a="\\",q,q,q,a,a,q); }
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
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
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
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
--------------------------------------------------
From: "Xiaofan Chen" <xiao...@gmail.com>
Sent: Friday, June 11, 2010 8:14 AM
To: "Microcontroller discussion list - Public." <pic...@mit.edu>
Subject: Re: [PIC]Copy from unprotected PIC then programming another PIC
> On Fri, Jun 11, 2010 at 11:53 AM, Craig Stevens <cr...@catalyst.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).
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.
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.
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.
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:
randyab...@bellsouth.net
--- On Thu, 6/10/10, Oli Glaser <oli.g...@talktalk.net> wrote:
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:
randyab...@bellsouth.net
--- On Thu, 6/10/10, ivp <joeco...@clear.net.nz> wrote:
From: ivp <joeco...@clear.net.nz>
Subject: Re: [PIC]Copy from unprotected PIC then programming another PIC
To: "Microcontroller discussion list - Public." <pic...@mit.edu>
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:
randyab...@bellsouth.net
--- On Fri, 6/11/10, Xiaofan Chen <xiao...@gmail.com> wrote:
From: Xiaofan Chen <xiao...@gmail.com>
Subject: Re: [PIC]Copy from unprotected PIC then programming another PIC
To: "Microcontroller discussion list - Public." <pic...@mit.edu>
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.
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/
--
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.
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.
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/
--
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.
> ------------------------------------------------------------------------
>
>
> Internal Virus Database is out of date.
> Checked by AVG - www.avg.com
> Version: 9.0.783 / Virus Database: 271.1.1/2746 - Release Date: 03/14/10 03:33:00
> 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
--
int main() { char *a,*s,*q; printf(s="int main() { char *a,*s,*q;
printf(s=%s%s%s, q=%s%s%s%s,s,q,q,a=%s%s%s%s,q,q,q,a,a,q); }",
q="\"",s,q,q,a="\\",q,q,q,a,a,q); }
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 <dwa...@planet.eon.net>
Trinity Electronics Systems Ltd Edmonton, AB, CANADA
(780) 489-3199 voice (780) 487-6397 fax
www.trinity-electronics.com
Custom Electronics Design and Manufacturing
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:
randyab...@bellsouth.net
--- On Fri, 6/11/10, Olin Lathrop <olin_p...@embedinc.com> wrote:
From: Olin Lathrop <olin_p...@embedinc.com>
Subject: Re: [PIC]Copy from unprotected PIC then programming another PIC
To: "Microcontroller discussion list - Public." <pic...@mit.edu>
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:
randyab...@bellsouth.net
--- On Fri, 6/11/10, Isaac Marino Bavaresco <isaacba...@yahoo.com.br> wrote:
From: Isaac Marino Bavaresco <isaacba...@yahoo.com.br>
Subject: Re: [PIC]Copy from unprotected PIC then programming another PIC
To: "Microcontroller discussion list - Public." <pic...@mit.edu>
Date: Friday, June 11, 2010, 6:43 PM
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:
randyab...@bellsouth.net
--- On Fri, 6/11/10, Olin Lathrop <olin_p...@embedinc.com> wrote:
From: Olin Lathrop <olin_p...@embedinc.com>
Subject: Re: [PIC]Copy from unprotected PIC then programming another PIC
To: "Microcontroller discussion list - Public." <pic...@mit.edu>
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:
randyab...@bellsouth.net
--- On Fri, 6/11/10, Olin Lathrop <olin_p...@embedinc.com> wrote:
From: Olin Lathrop <olin_p...@embedinc.com>
Subject: Re: [PIC]Copy from unprotected PIC then programming another PIC
To: "Microcontroller discussion list - Public." <pic...@mit.edu>
Date: Friday, June 11, 2010, 6:46 PM