I think I see what you're asking. I should admit that I have not used expanded mode yet in 9S12 (only HC12), but I think the info is clear enough to explain.
First, that says it is conceptual, which means it is intended to demonstrate one concept, so might not show other concepts of the complete system. It is simplifying it by leaving out the PPAGE concept. They also leave out the fact that `lda 0` would by default access the PORTA register, not external memory.
Because the 16-bit address space (64K) does not use PPAGE, you would only have 64K of space (i.e. `lda $0000` to `lda $ffff`). I suppose that you could access external memory at all of these addresses, but you need to know that internally mapped space overrides external, and there are a few ways to get past this. Mainly, either move or turn off the internal block that is in the way. In other words, `lda 0` will not normally even try to retreive external mem because the hw register (PORTA) is still enabled and mapped there.
Look at Figure 2. This shows that in expanded modes, you might only find certain spots to access external mem, and perhaps only if you hold pin PK7 (ROMONE) low on powerup (to automatically disable internal Flash if booting from external mem).
I think one confusion might be how to tell whether you are accessing "near" addr (direct 64K) or "far" (using PPAGE). The best way I can tell is decoding the whole address. Since XADDR[19:14] directly indicate PPAGE contents, they can be used along with the low 14 bits of expanded bus ADDR[13:0]:
MCU External Device
XADDR19 -- A19
...
XADDR14 -- A14
ADDR13 -- A13
...
ADDR0 -- A0
With these connections, the external address space is contiguous 1 Megabyte, but not internal method of addressing!
The intended method of addressing the first external byte above (0x00000) is
movb #$00,PPAGE
lda $8000
That is not a "near" access. If you tried this
lda $0000
I assume you could get the same memory contents if PORTA was not mapped there, but there would be no way for external memory to distinguish between that and the 00:8000 address. Hopefully an expert will correct me if I'm wrong.
The solution is to add an external circuit to decode ADDR[15:14]. If it is (binary) 00, this is an access to "near" space. If 10, this is accessing the bank window in [0x8000..0xbfff].
I am actually not sure what happens with the fixed banks at $4000 and $c000. Are XADDR lines automatically set to access these?
See the
MEBI reference guide for better details.
Message Edited by imajeff on 05-11-200611:21 AM