Accessing I/O

guddler

Busting vectors like it's 1982!
vacBacker
Feedback
10 (100%)
Credits
4,058CR
So, here's something that's been bugging me this morning. The answer may be obvious, but here goes.

When you're using tools like a Fluke 9010 / 9100 (basically Fluke PODs) or the Arduino In-Circuit tester, if you want to access memory mapped I/O you prefix the I/O address with something. Usually a 1. So 0x4000 becomes 0x14000.

Why?

I mean, by it's very nature, memory mapped I/O has a memory address which can be accessed, so why do you need to differentiate it from normal address space? Obviously the answer is that something different happens when the extra 1 is supplied, but what?

I know I'm going to go "DOH! Of course" when someone tells me. It's been a while. So someone, please humour me.
 

guddler

Busting vectors like it's 1982!
vacBacker
Feedback
10 (100%)
Credits
4,058CR
OK, that makes sense if there is a different pin on the CPU that needs to be involved like /IOREQ for Z80.

I guess I need to look up 8085 which is what I was looking at last night to see if it applies there too.
 

ArcadePCB

User
vacBacker
Credits
509CR
While e.g. the 6502 has just one adress space, all devices (RAM, ROM, I/O) have to be arranged within this 64k address space.

Some processors use different address spaces for different purposes. The 8051 family e.g uses 3 address spaces in parallel: the program address space (64k, accessed by MOVC), the external RAM address space (64k, accessed by MOVX) and the internal data address space, (256 byte, accessed by MOV). This allows to access 64k of RAM directly without bank switching, but on the other hand no program code can be executed in RAM address space. SFRs/ports are part of the internal address space, but there's no extra address space for I/O beyond the processor ports.

The 8080/8085/Z80 family has an address space for ROM/RAM (64k, similar to the 6502, accessed by MOV or simmilar commands), but it has an additional I/O address space (256 byte) accessed by IN and OUT.

These are just examples, for details of other processors, just have a look on the manual of the processor you want to use.

So because different address spaces are logically independent, there was a need for the user to tell the tester which address space has to be addressed by the tester. Fluke just used that 'prefix' method.
 

guddler

Busting vectors like it's 1982!
vacBacker
Feedback
10 (100%)
Credits
4,058CR
Thank you for this explanation - it makes complete sense!

The very much abbreviated version then is that stuff like memory and peripherals can occupy the same memory address. From a software point of view you use different commands depending on what you need access to. From a hardware point of view something different needs to be done (8085 appears to have an IO/M1 pin for example). Both amount to the same thing, because let's say, 0x4000 could refer to RAM, or it could refer to I/O hardware, test kit get's you to tell it which you mean by adding this prefix on the front, because you're not giving it assembler commands.
 
Top