Pages: [1]   Go Down
Author Topic: Imaging old Mac+ ROMs with Arduino  (Read 203 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 11
I came, I saw, and then I wrote code explaining what I saw.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Alright guys, I'll try to be as thorough as I can with the description so that you all get the best idea of what I'm trying to accomplish here.

What I'm doing is building an old Mac+ clone on combination original hardware, plus an FPGA for interfacing. Gonna work to make it modern. However, the ROM files and boot sequence codes aren't available online via ROM images, so I purchased an original logic board on eBay to get the ROM files to image.

Now, I figured the breadboard-friendliness of the Arduino would lend itself well in such a role, and I've already extracted the DIP slug ROMs from the board and put them on a breadboard, done the whole wiring shebang, etc. Now, I need to figure out how to write the code.

The memory exists in two banks of 64K * 8, paralleled to get the proper 68000 data width of 64K * 16.

We all know how ROMs/RAM generally function. In the case of ROMs, you make the address appear at the address bus and assert both the chip enable (CE#) and output enable (OE#) and the data at that address appears at the data bus output. Now, I've looked over the original schematics, and there isn't a quartz-window on the ROM slugs, nor is there a W/R# pin. So, it's probably mask ROM.

My question generally falls under the guidelines of:

1. How do I take an address (1, 2, 3, etc.) and convert it to not just a binary representation, but an int[16] number that I can then declare digitalWrite on? I know how I would move from the array to the output, e.g.

Code:
// Suppose the array is address[16]
for (int i = 0; i < 16; i++)
{
    if (i = 0)
    {
        digitalWrite(address[i], LOW);
    }
    else
    {
        digitalWrite(address[i], HIGH);
    }
}

Would itoa() be a good candidate for this operation?

I don't necessarily need to do this on the return (reading the ROM output) side of things as I'll be formatting the result to a string and serial writing it. I'll write a quickie Java util that will take that result, delimit and perform the opcode and arg discrimination.

Thanks in advance,
blasthash
Logged

Rapa Nui
Offline Offline
Edison Member
*
Karma: 60
Posts: 2071
Pukao hats cleaning services
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
1. How do I take an address (1, 2, 3, etc.) and convert it to not just a binary representation, but an int[16] number that I can then declare digitalWrite on?

Code:
typedef union {
unsigned long addrvalue;
struct {
unsigned char byte1: 8;  // lowest byte
unsigned char byte2: 8;
unsigned char byte3: 8;
unsigned char byte4: 8;  // highest byte
};
}
addrbytes ;

Then:
Code:
..
unsigned long address;
..
void put_addr_to_ports(address) {
addrbytes temp;
temp.addrvalue = address;
PORTA = temp.byte1;
PORTB = temp.byte2;
PORTC = temp.byte3;
PORTD = temp.byte4;
};
..
That is the fastest and simplest way how to put "bytes" of an "address"(for example 32bit one) out to the 8bit atmega ports. Adjust to your case accordingly.
« Last Edit: March 01, 2014, 06:31:18 am by pito » Logged

Pages: [1]   Go Up
Jump to: