6502 Design & concept questions.
Posted: Sat Oct 05, 2013 8:50 am
My prototype is running happily, and I’m having plans on a more permanent version.
What I’m not happy about is the memory map I’ve worked out so far.
I would like to use 512k of SRAM at $0000-$7FFF switchable at 16 x 32k.
The first 1k or 2k would always be bank 0 while the rest is bankable.
I/O is planned from $8000-$BFFF in 16 x 1k chunks. (with two 138’s)
As ROM I’d like a 29F010 128k FLASH at $C000-$FFFF switchable at 8 x 16k.
RAM 628512 SRAM
ROM 29F010 FLASH
A latch of 8 bits could take care of banking and write protect.
CBBBAAAA
A = 16 x RAM bank select.
B = 8 x ROM bank select.
C = ROM write enable.
What I don’t like about it is 1. the vast I/O map at $8000-$BFFF and 2. the ROM not that easy to alter. I would have to erase 16k at once and reprogram the whole sector, and of course write a program to do that.
1. I’d like a more convenient location for I/O, near zeropage and stack.
What would be a good location and how big should the I/O blocks have to be to fit most needs? 64 bytes?
Of course $8000-$BFFF becomes available and could be added to the RAM or the ROM. Any thoughts about if it should be ROM or RAM?
2. I’d like rather use RAM with battery and write protect instead of ROM.
How do I get the firmware in “ROM” the first time or when ram gets corrupted or erased? This is my biggest issue.
A possible memory map could look like this:
RAM 628512 SRAM
ROM 628512 SRAM (battery backed and write protected)
Or perhaps:
RAM 628512 SRAM
ROM 628128 SRAM (battery backed and write protected)
Any perspective would be helpful.
edit: changed title
What I’m not happy about is the memory map I’ve worked out so far.
I would like to use 512k of SRAM at $0000-$7FFF switchable at 16 x 32k.
The first 1k or 2k would always be bank 0 while the rest is bankable.
I/O is planned from $8000-$BFFF in 16 x 1k chunks. (with two 138’s)
As ROM I’d like a 29F010 128k FLASH at $C000-$FFFF switchable at 8 x 16k.
Code: Select all
0000 zeropage
0100 stack
0200 512 bytes (the first 1k always bank 0)
0400 16 banks of 31k RAM
8000 I/O 0
8400 I/O 1
8800 I/O 2
.
.
.
BC00 I/O F
C000 8 banks of 16k ROM
ROM 29F010 FLASH
A latch of 8 bits could take care of banking and write protect.
CBBBAAAA
A = 16 x RAM bank select.
B = 8 x ROM bank select.
C = ROM write enable.
What I don’t like about it is 1. the vast I/O map at $8000-$BFFF and 2. the ROM not that easy to alter. I would have to erase 16k at once and reprogram the whole sector, and of course write a program to do that.
1. I’d like a more convenient location for I/O, near zeropage and stack.
What would be a good location and how big should the I/O blocks have to be to fit most needs? 64 bytes?
Of course $8000-$BFFF becomes available and could be added to the RAM or the ROM. Any thoughts about if it should be ROM or RAM?
2. I’d like rather use RAM with battery and write protect instead of ROM.
How do I get the firmware in “ROM” the first time or when ram gets corrupted or erased? This is my biggest issue.
A possible memory map could look like this:
Code: Select all
0000 zeropage
0100 stack
0200 I/O 0
0240 I/O 1
0280 I/O 2
02C0 I/O 3
.
.
.
05C0 I/O F
0600 512 bytes (the first 2k always bank 0)
0800 16 banks of 30k RAM
8000 16 banks of 32k ROM (battery backed and write protected RAM)
ROM 628512 SRAM (battery backed and write protected)
Or perhaps:
Code: Select all
0000 zeropage
0100 stack
0200 I/O 0
0240 I/O 1
0280 I/O 2
02C0 I/O 3
.
.
.
05C0 I/O F
0600 512 bytes (the first 2k always bank 0)
0800 8 banks of 46k RAM
C000 8 banks of 16k ROM (battery backed and write protected RAM)
ROM 628128 SRAM (battery backed and write protected)
Any perspective would be helpful.
edit: changed title