Thanks for your reply again.
Not sure what endianess has to do with the banking scheme. The U5 bank register only handles a byte.
I was getting myself confused. What I meant was whether D0 or D7 was the least significant bit. I've gone back to the datasheet and confirmed that D0 is the LSB. Now that I have sorted that out, I realised I was correct with my first drawing.
Your bank register is mapping 64K segments because each possible combination of bits 0-3 affects a RAM or ROM address line that is A15 or higher.
No, sorry, A15 selects the lower 32K when 0, and the upper 32K when 1, so by switching A15 to activate the banking scheme, I am mapping 32K segments.
Your table is almost correct. I think there may be copy-paste errors.
It should be:
Code: Select all
Upper Memory
BITS 0-3 A15 A16 A17 A18 Address Range
————————————————————————————————————————————————
%0000 0 0 0 0 000000-007FFF
%0001 1 0 0 0 008000-00FFFF
%0010 0 1 0 0 010000-017FFF
%0011 1 1 0 0 018000-01FFFF
%0100 0 0 1 0 020000-027FFF
%0101 1 0 1 0 028000-02FFFF
%0110 0 1 1 0 030000-037FFF
%0111 1 1 1 0 038000-03FFFF
%1000 0 0 0 1 040000-047FFF
%1001 1 0 0 1 044000-04FFFF
%1010 0 1 0 1 050000-057FFF
%1011 1 1 0 1 058000-05FFFF
%1100 0 0 1 1 060000-067FFF
%1101 1 0 1 1 068000-06FFFF
%1110 0 1 1 1 070000-077FFF
%1111 1 1 1 1 078000-07FFFF
————————————————————————————————————————————————
I wrote a quick Python program to confirm this.
Also, as you have it wired, if bit 7 of the pattern written to the register is cleared, ROM will be selected. With bit 7 set, RAM will be selected.
This is as desired. When the latch is reset, for example at boot, then the ROM will be selected. This allows the 6502 to read the starting PC from the ROM at 0xFFFC and 0xFFFD.
You need to invert the /WB signal and use that to clock the bank register.
Thanks, I've incorporated that into the latest schematic.