• 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.

16c64 into 16f877

Status
Not open for further replies.

kevinssmith

New Member
hi all. i have a prog in 16c64 that i want to work in a 16f877 so i can make changes to prog without blowing and wasting a pic.
could i disassemble the '64' and reassemble it in '877'?
does anyone know of an assembler that will do this please?

cheers
kevin
 

motion

New Member
First try using the 16C64 assembled code on the 16F877. You can always erase and reprogram the F877 if it does not work.
 

kevinssmith

New Member
have tried that! don't work. i have now loaded the program into the 877 as a 64. will try that when i get to work. thanks for help
 

Exo

Active Member
have you compared the two chips datasheets yet?
I briefly looked at the 64's datasheet and there are some differences between the 2 chips, memory size for examples...

perhaps some memory adresses vary between both chips...
In any case, porting code from one pic to another takes more then just copying it. You need to see that all the things you use are the same between the two.
 

motion

New Member
Have you verified if the configuration fuses are correctly set for the F877? Some programming software do not correctly load the configuration fuses from the HEX file. You may have to manually set them.

Also, the 16F874 is a closer match to the 16C64. This might increase your chances of it working as replacement.
 

kevinssmith

New Member
thanks for everybody's input. i'll try a few things and get back to you!
 

kevinssmith

New Member
just thought, would disassembling it in 64 and reassembling it it 877 do the trick?
 

motion

New Member
As far as I can tell, the PIC16F877 is object code compatible with the PIC16C64. There are additional register definitions. However, code disassembled from a PIC16C64 hex file will generate the same object code even if the processor definition is changed.

I assembled a generic program for the 16C64 and compared it with the output hex file with the procesor definition changed to PIC16F877 and both files are identical.

How about attaching the hex file in zip form here and maybe I or someone else can check what part is preventing it from running.

You said it does not work. Could you be more specific? What does not work?
 

kevinssmith

New Member
i'm sorry, i can't send hex out as it's for my work. you would need one of our boards to run it up anyway. what happens is on the display, you should get four dashes. then you know the board is working ok. when i use 877, the display brings up a '0' and it flashes off and on about once every two seconds.
 

motion

New Member
It may be code in the 16C64 which on the 16F877 may be sending the program to jump to the wrong bank. You should try using the 16F874.
 

Exo

Active Member
It could indeed be something with banks or memory locations that don't match. Using a 874 will not solve this.

Code should be easely ported IF you had the sourcecode...
Disassembling the code and then porting it is a lot more complicated. Only the fact that most disassemblers directly show register adresses instead of there names (06 in stead of PORTB,...) and label names don't make any sense (label1, label2, doesn't really tell alot) makes it a tough task.
 

kevinssmith

New Member
yes! i have the hex source! i can't find a disassebler for the 64 and 877 though
 

Exo

Active Member
874 is esentially the same as a 877. Only diffirence is it got 4K in stead of 8K (16c64 has 2K). So if it doesn't work on a 877 it won't work on a 874 eighter.
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top