Introduction To Embedded System I/O Architectures and Buses
Introduction To Embedded System I/O Architectures and Buses
System Bus
A3
Address
A2 Decoder
A1 Output
A0
Hardware allows only one tri-state gate at a time to drive a bus signal!
Bus Clock
I/O Write
Bus Clock
Valid Address
Address
I/O Read
Address Tri-state
Address Bus Decoder Control
Circuit Data bit x
Data Bus bit x in from
I/O Device
One tri-state
gate is needed
for each bit on
the data bus
Typical I/O Output Port Hardware
Operation
R
Address e
Address Bus Decoder g
Circuit Data Bus i Data out to
s I/O Device
t
e
r
Problems: Does not port to other processors and many people do not
understand assembly language!
ARM Assembly Language
• See mbed wiki page on ARM assembly
language:
– https://developer.mbed.org/cookbook/Assemb
ly-Language
• I/O registers (ports) are memory mapped
on RISC processors, so Load and Store
instructions can be used directly for I/O
(unlike “in” and “out” special case on X86)
Example X86 I/O Port R/W Functions
• READ_PORT_UCHAR(I/O_Address)
– Returns 8-bit input value from input port
• WRITE_PORT_UCHAR(I/O_Address,I/O_Data)
– Sends 8-bit data value to output port
• Used in some versions of Windows
• Typically used in code for low-level device
drivers
ARM I/O Registers
• On RISC processors, I/O registers are memory
mapped, but not on X86 processors.
• C pointers set to the correct address are the
fastest way to access these I/O registers (faster
than function calls). Pointers are used in mbed’s
I/O API library code.
• Wiki page with details and examples at:
– https://developer.mbed.org/users/4180_1/notebook/cc
-io-register-names/