PDA

View Full Version : F877 to F877A Brain transplant w/HEX



boroko
- 22nd December 2008, 14:47
Hi all,
I have an unusual problem that one of you may have run into.
I have a couple of controllers on the bench for repair. Same board and configuration but one uses a 16F877 and the other used a 16C74A.
The one with the '74A took a hit that blew it up.
The rest of the board is the same and I can get the HEX out of the 877, but I only have 877A's here.
I don't believe that I can load the '877 HEX file into the "A" and use it. It seems logical that the HEX could be disassembled and recompiled for the "A", but I haven't ever tried.
I imagine I'm likely to run into a flood of people screaming that I'm trying to rip someone off, but I'm not. I just want to duplicate a burnt chip (in this case , with a newer version) and use it back in it's original device.

I don't know if I can even get plain 877's any more.

Any thoughts?

UPDATE: Next Day Air'd a couple of plain 'ol 877's from Digikey. We'll see if I can transfer and run the code on a new chip without any problems.

Thanks
Bo

nomad
- 24th December 2008, 11:32
---------------- deleted wrong assumptions -------------------

wow, was i wayyyy off..

Melanie
- 24th December 2008, 14:31
The 'A' has Comparators and a Voltage Reference Module... switch them off and any code for the plain vanilla will run on the 'A' after recompiling.

Acetronics2
- 24th December 2008, 16:49
Hi, Boroko and Mel

The goal is just to find some free program lines at the very beginning of the program to place the 2 asm lines to disable comparators ... CVRCON default is Disabled ...

or just a "GOTO past the program last line" , and here place the config lines ; another GOTO will drive back to the "classical" program following line ... That allows to change one existing line to a "GOTO" and re-place it in the config stubb.

Alain

boroko
- 26th December 2008, 17:18
Thanks all for the replies.

As I mentioned in the update, I found and ordered a plain '877. I got it in and was able to burn a copy of the hex into it and it ran in the controller that originally had an '877. The one that ran a 16c74 still has issues (significant "smoke" leakage), so I can't tell if the upgrade to the '877 will work, but for now, the crisis is over, at least until I can't get obsolete parts anymore.

A deeper question still looms. Is it possible to disassemble when you only have hex to start with? I am treading on a slippery slope here, as I realize the implications of being able to do that. Sorry, and I understand if no one chooses to dig into this.

The changes to the code that you guys mentioned are the reasonable way to do that if you first have the code to reassemble. Obviously, a HEX file is a complete picture of the program, minus the chosen substitute names for

variables and the like, but is there a legitimate way to reverse the process so that you could get into it and make the changes that you suggest? MPASM will only seem to work if you have the original. Probably for obvious reasons.

I'm imagining that mapping out the register hex addresses would give you a place to start. You might be able to see what the original op-codes were, at least in the beginning and add your patch code, but it looks like it would get pretty murky pretty fast without a systematic approach.

Like I said, this dragon has been slain, but I'm sure it has some relatives that will show up again. I'm not trying to steal someone's work, just trying to reasonably repair a multi-thousand dollar controller.

BTW, I was quite excited to see that one of our sweet little PICs was the core of such an expensive device.

Bo

Acetronics2
- 29th December 2008, 12:47
Thanks all for the replies.


The changes to the code that you guys mentioned are the reasonable way to do that if you first have the code to reassemble. Obviously, a HEX file is a complete picture of the program, minus the chosen substitute names for

variables and the like, but is there a legitimate way to reverse the process so that you could get into it and make the changes that you suggest? MPASM will only seem to work if you have the original. Probably for obvious reasons.


Bo

Hi,

You DO NOT need to re-assemble the code ... simply told, you just use an HEX editor to modify existing lines or add some ASSEMBLER lines past the ones existing.
In MPLAB, you can easily do it in the "Program window" ...

The ABSOLUTE MUST is just not to modify the existing lines numbering ...

I've done it mostly to change the menu language ( just changing letters HEX code ... ) or add some I/O functions ...

Once more : do not worry ! ... turning to 877A is really easy. - turning to 887 would, of course, be a little trickier ...

Alain