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