The F411 takes the place of an AT28C64 rom chip and the need for a special programmer.
I compile my BIOS to binary then convert it as a C header which I include into the F411 code.
The F411 is connected as a real ROM, Here's the connections:
- PB12: ROM CS
- PB8: RD
- PB9: WR
- PA0-PA7: A0-A7 of 8088
- PB0: A8 of 8088
- PA8-PA15: D0-D7 of 8088
My BIOS is 512bytes so only A0-A8 are needed to address the F411. The ROM emulation is done only at startup, the BIOS copies it self to RAM so the F411 is free for VGA and SD tasks !!!
Here's the code for the F411:
void rom(){
register unsigned short data1; // data sent by 8088
register unsigned short data2; //
register unsigned short address;
unsigned short mask = 1 << 9 | 1 << 8; // RD and WR mask
for(;;){
// wait until PB12 ROM_CS becomes LOW
data2 = GPIOB->idata;
if(!(data2 & (1 << 12))){ // ROM selected
while((GPIOB->idata & mask) == mask); // wait until PB8 (RD) or PB9 (WR) is LOW
if(!(data2 & (1 << 8))){ //RD
// get address
data1 = GPIOA->idata; // A0-A7
data2 = GPIOB->idata; // A8
address = (data2&0x0001)<<8 | data1&0x00FF;
GPIOA->odata = (bios_bin[address])<<8;
// Switch PORTA_H to output
GPIOA->moder = 0x55550000; // PA8-15 outputs
while(!(GPIOB->idata & (1 << 8))); // wait until PB8 (RD =1)
GPIOA->moder = 0; // PA8-15 inputs
}
// quit ROM emulation
// Do a dummy write to ROM to exit ROM emulation mode
else if(!(data2 & (1 << 9))) break; // if WR exit
}
}
}
I don't have all the details, but here is a list of the major parts:
Tom's Computer Info / tom@mmto.org