Memory Mapped I/O Flashcards
What are the control registers
Control registers are flip flops which can be used for reading/ writing AND connected to other circuits
What are the two methods for a CPU to interact with the control registers
I/O instructions included in the processors instruction set
Memory Mapped I/O, registers with addresses reserved in memory space
What are some factors which affect the choice between using memory mapped I/O and using I/O instructions
The size of the address space
The addressing mode
The size of the instruction set
Any caching complications
C assumes Von-Neumann Architecture (single address space), but Memory mapped IO contradicts this by having registers separate to RAM, how can we get around this
We can use a offset for the start of the address space such that C views it as one big address space
What type should unsigned, 8 bit registers be represented with in c
uint8_t
What does the _BV(bit)
macro do
The _BV(bit)
macro allows for a byte value with a singular bit in the set position set
#define _BV( bit ) ( 1<<(bit))
What does register |= _BV(2);
do
Sets bit 2 in register to true
What does register &= ~(_BV(2));
do
Sets bit 2 in the register to false
What does register ^= _BV(2);
do
Toggles bit 2 in the register