dagenius wrote:
It seems like there are some serious flaws in my memory map. I'll probably just redesign it completely so that it has RAM, ROM and I/O in bank 0, then I can add RAM and larger ROMs to the other banks.
There are as many ways to do it as there are hobbyists wanting to make a system - which is as much a joy as a curse, I suspect...
Traditionally, you need some ROM in the $00.FFxx region at power-on time, but with the right hardware (CPLD type thing) you can swap that out once booted for (faster?) RAM if required. Or just leave it there. One issue we have today is that small (e.g. 2KB) EPROMs are really hard to get so you end up with 256KB if not careful and while you don't need to use all of it, it's still something more than you really need.
IO is also traditionally in bank 0 - probably to mimic the old was of doing it in 6502 land. There are some people who suggest IO in page 0 (in Bank 0) is good too, as it's one cycle faster to access, however that's at the expense of precious page 0 RAM - less a problem in the '816 though as you can move the page 0 base address (called the direct page in '816 terms) Putting IO in higher regions on the '816 does require extra work to access though - it's not a linear 24-bit addressing scheme, but banks of 64KB, so again for ease of code, bring-up testing, bootstrap then having IO in bank 0 is easier.
Personally, I like to keep things a simple as possible. I have 512KB of RAM (8 banks of 64K) with a 256 byte window at $00.FExx for a single 65c22 VIA chip in my Ruby 816 board. I could decode that region further for more IO chips if needed.
Quote:
The reason I decided to go with 24 bit addressing is to avoid complexity and lots of banking, so I probably won't do that. It's easier to just use a different memory map.
Do have a good read of the 65816 data sheets and programming guides and think about what your goal is. The Apple II did really well with effectively 48KB of user RAM and 16K of ROM and IO space, the BBC Micro did well with 32KB of RAM although it did have a paged ROM system. I'm suggesting that unless you have a clear vision/roadmap then maybe you don't need more RAM... ???
And note that the 65816 is effectively a banked system - It's a 24-bit program counter, but the memory isn't quite as linearly addressed as you might think or want it to be. Index registers are 16-bit, not 24 and some operations will extend into the next bank and some will wrap.
Quote:
In other projects I've seen people have used MCUs to copy am EEPROM top RAM during reset. How would ths be implemented? I'm thinking that with something like an adafruit feather that has a micro SD card reader it could be possible to boot from SD without implementing FAT.
My Ruby system is ROMless. I use an MCU (ATmega) to bootstrap it. The area of RAM at $00.FFxx is shared between the 65816 and the MCU, so the MCU holds the '816 is reset, pokes the bootloader into the shared RAM area, then takes the 6502 out of reset (it's not truly shared as only one can access at a time) And while the MCU does have an SD card, it's not used to boot the CPU - the bootstrap code comes from the flash memory in the MCU.
Hope the project goes well - we need more 65816 projects going!
-Gordon
_________________
--
Gordon Henderson.
See my
Ruby 6502 and 65816 SBC projects here:
https://projects.drogon.net/ruby/