Code Interoperability -- ATMEGA324PA <--> ATMEGA1284P

Starhawk wrote 11/16/2017 at 01:08 0 points

I'm trying to build a thing (namely, https://hackaday.io/project/75-z80-microcomputer-system) and the original dev is rather busy and can't answer questions as fast as I'd like. (In related news, I'm an impatient f***. At least I know it!)

Within that design for that retrocomputer at that link, is an ATMEGA324PA microcontroller, tasked with operating the system's video, keyboard, RS-232 (except level translation), and IDE interfaces as well as some low-level timing stuff.

I have a complete build, which I kludged into the bottom half of a Commodore 1571 housing that still had the drive's power supply intact. (For the record, the previous owner of the, er, drive had removed the mechanicals and scrapped out the logic board due to an issue with said mechanicals that apparently wasn't worth the trouble to repair.) In doing so, and wiring it up to run off said supply, I uhm accidentally reversed the rails, putting 12v through the board instead of 5v.

Oops.

I now have a quite thoroughly deceased ATMEGA324PA (internal short... good for making hot chocolate, now, but not for anything electronic...), along with potentially other damage -- which I can't troubleshoot (or even really discover) until I replace the microcontroller, because its timing aspects, which I mentioned earlier, include driving the CPU clock...

Herein lies the problem. '324PAs are essentially unobtanium right now. eBay wants a fairly princely sum, and there's only one seller with the part, and he's in China. Mouser is out of stock until December 1 at the earliest. Digikey wants $20ish for two with Priority Mail shipping, or a bit more than $16 for one.

At this point I'm running out of swear words, as well...

HOWEVER... I have two ATMEGA1284P chips sitting on dev boards that I'll never ever ever use. I checked, and the pinout is identical, so /physically/, the chips are drop-in replacements for each other. I don't have the source code for the '324PA -- at least, if I do, it's not in any form I can recognize and therefore use. BUT the ZIP archive, on that linked page way up at the beginning of all this, has a *.hex file that is what I need for flashing the '324PA. I have a TL866x programmer, too, and the software to make it dance.

What I *DON'T* know, because I'm no coder, and thus ultimately what I'm asking the HaD[dot]IO community here, is -- is the 1284P interoperable with the 324PA enough inside (i.e. in terms of code) that I can just throw that *.hex file (and the fuse settings) at one of my 1284P chips and have it, like, just work? or does the code need to be specifically compiled for the different chip...?