Memory Mapped I/O

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/19

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 2:23 PM on 3/30/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

20 Terms

1
New cards

How is Software Connected to Hardware?

  • Interacts via control registers

  • Hardware modules (GPIO, ADC, Timers)

  • Configurations through registers

  • Registers made of flip-flops

  • Readable/writable by CPU

2
New cards

Control Register Definition

  • Set of flip-flops in hardware module

  • Inputs/outputs wired to other circuits

  • Writing configures behavior

  • Reading retrieves status or data

3
New cards

CPU Interaction with Control Registers - Two Methods

  1. Special I/O Instructions
    • Separate address space
  2. Memory Mapped I/O (MMIO)
    • I/O registers in memory space
    • Mixed usage by some CPUs
4
New cards

I/O Instructions Method

  • Dedicated instruction set for I/O
  • Examples: IN, OUT
  • Direct communication with I/O port registers
  • Separate address space from main memory
5
New cards

Memory Mapped I/O (MMIO) Method

  • I/O registers have unique memory addresses
  • Standard memory access instructions
  • Load/store operations for reading/writing
6
New cards

I/O Instructions vs. MMIO - Address Space

  • Special I/O instructions consume opcode bits
  • MMIO avoids this by reusing memory access instructions
  • Keeps instruction set smaller
7
New cards

I/O Instructions vs. MMIO - Access Convenience

  • MMIO uses all CPU memory addressing modes
  • I/O instructions offer fewer addressing modes
  • More flexibility with MMIO
8
New cards

I/O Instructions vs. MMIO - Cache Complications

  • MMIO can be complicated by CPU caching
  • Memory-mapped input registers may change state
  • Cached reads may return stale data
9
New cards

AT90USB1286 Address Spaces

  • Separate address spaces in AT90USB1286
  • Program Memory (0x00000-0x1FFFF) for flash
  • EEPROM (0x0000-0x0FFF) for non-volatile data
  • Data Memory for RAM and I/O registers
10
New cards

C Language von Neumann Assumption

  • Assumes single, flat address space
  • Workarounds for Harvard architectures
  • Specific offsets to indicate intended address space
11
New cards

AT90USB1286 Data Memory Map Structure

  • Data memory map organized as follows:
    • 0x0000-0x001F (32 General Registers)
    • 0x0020-0x005F (64 I/O Registers)
    • 0x0060-0x00FF (160 Extended I/O Registers)
    • 0x0100-0x10FF (Internal RAM)
    • 0x2100+ (External RAM)
12
New cards

Hardware Module Configuration via I/O Registers

  • Configured and controlled by I/O registers
  • Registers are memory-mapped into data address space
13
New cards

General Purpose Registers in Memory Map

  • 32 general purpose registers (R0-R31)
  • Mapped into memory address space
  • Accessible via memory operations and register instructions
14
New cards

PORTF, DDRF, PINF Registers

  • Specific I/O registers for Port F:
    • PORTF (output data)
    • DDRF (data direction register)
    • PINF (input data)
    • Unique memory addresses defined in avr/io.h
15
New cards

avr/io.h and Register Address Mapping

  • Provides C preprocessor #define statements
  • Assigns constant labels (e.g., DDRF, PORTB)
  • Maps to the correct memory addresses for I/O registers
16
New cards

uint8_t Type for Register Access

  • Standard for 8-bit register manipulation
  • Ensures exact 8-bit, unsigned behavior
  • Matches physical size of AVR I/O registers
17
New cards

Setting a Bit in C (Bitwise OR)

  • To set a specific bit in a register:
    • REGISTER |= _BV(BIT_NUMBER);
    • Example: DDRB |= _BV(PB7);
    • Sets PB7 as output
18
New cards

Clearing a Bit in C (Bitwise AND with NOT)

  • To clear a specific bit:
    • REGISTER &= ~_BV(BIT_NUMBER);
    • Example: DDRB &= ~_BV(PB7);
    • Sets PB7 as input
19
New cards

_BV() Macro

  • Common AVR macro
  • Defined as _BV(bit) = (1 << bit)
  • Converts bit position (0-7) into a byte with that bit set
20
New cards

Purpose of Bit Manipulation in Embedded C

  • Allows individual configuration of 8-bit I/O registers
  • Essential for controlling different pins/features
  • Prevents modifying other bits in the register

Explore top notes

note
APUSH Unit 6
Updated 836d ago
0.0(0)
note
Bigger than Big Revision
Updated 1041d ago
0.0(0)
note
Weltwirtschaftskrise
Updated 1231d ago
0.0(0)
note
Biology: Unit 1 Review
Updated 1137d ago
0.0(0)
note
AP government and politics unit 1
Updated 1075d ago
0.0(0)
note
Continuity and Change in Russia
Updated 1169d ago
0.0(0)
note
APUSH Unit 6
Updated 836d ago
0.0(0)
note
Bigger than Big Revision
Updated 1041d ago
0.0(0)
note
Weltwirtschaftskrise
Updated 1231d ago
0.0(0)
note
Biology: Unit 1 Review
Updated 1137d ago
0.0(0)
note
AP government and politics unit 1
Updated 1075d ago
0.0(0)
note
Continuity and Change in Russia
Updated 1169d ago
0.0(0)

Explore top flashcards

flashcards
Greek & Latin Stems 1
24
Updated 531d ago
0.0(0)
flashcards
Language Literature Final
67
Updated 1068d ago
0.0(0)
flashcards
Section 3 - Caesar Vocab
31
Updated 936d ago
0.0(0)
flashcards
English Unit 3 & 5 Vocab
40
Updated 1216d ago
0.0(0)
flashcards
AP Lang Summer Vocab
86
Updated 987d ago
0.0(0)
flashcards
Nl woorden 23-44
22
Updated 161d ago
0.0(0)
flashcards
Greek & Latin Stems 1
24
Updated 531d ago
0.0(0)
flashcards
Language Literature Final
67
Updated 1068d ago
0.0(0)
flashcards
Section 3 - Caesar Vocab
31
Updated 936d ago
0.0(0)
flashcards
English Unit 3 & 5 Vocab
40
Updated 1216d ago
0.0(0)
flashcards
AP Lang Summer Vocab
86
Updated 987d ago
0.0(0)
flashcards
Nl woorden 23-44
22
Updated 161d ago
0.0(0)