Professional Documents
Culture Documents
Elec3300 09-Dma
Elec3300 09-Dma
Topic 9
Buffering and Direct Memory Access (DMA)
Prof. Tim Woo
Microcontroller Structure
A/D Port
Buffering and
Serial Port Direct Memory Access
CPU (DMA)
External Memory Port
Memory,
Interfacing to Memory,
External Interrupt Port
Memory Timing
Interrupt and applications
External Timer Port Interfacing LCD
Organization Timer and
Counter Simple I/O Port
Motor Interfacing
In this course, STM32 is used as a driving vehicle for delivering the concepts.
To be covered In progress Done
Physical View
e.g. Cache, RAM e.g. Keyboard,
mouse, Printer,
Executing modem, ...
Embedded Buffer
Software
Programs I/O
Programs
Devices
μC or μP Memory
No Applications:
Done?
• Keyboards interfacing
Yes • Occasional application to other simple character-based data transfer
Next Instruction
ELEC 3300 : Spring 17/18 Tim Woo 6
I/O Module: Interrupt I/O
Suppose this is done one-byte at a time under the software control.
Issue Read CPU I/O
Command to CPU Do
I/O device Something Else Physical View
e.g. Cache, RAM e.g. Keyboard,
Read Status CPU Interrupt mouse, Printer,
of I/O device I/O CPU Executing modem, ...
Embedded Buffer
Error
Check Status Software
Condition Programs I/O
Ready Programs
Devices
Read Word μC or μP Memory
I/O CPU
from I/O device
Increment
of I/O and
memory
addresses Write Word
CPU Memory
Into Memory
No Applications:
Done? • A program to execute an illegal instruction
• The completion of an I/O task initiated previously a program
Yes
• An unexpected user command from keyboard such as resetting the computer.
Next Instruction
ELEC 3300 : Spring 17/18 Tim Woo 7
Increasing Concurrency Between I/O and Programs
Either polling or
interrupt is used to
check whether the
devices are ready.
• Generally, a block move is set up, say 512 bytes per block
– The processor initiates the block data transfer by memory-mapped I/O
– A whole block of data is then transferred without further processor intervention
– To do this, the DMA controller takes control of the bus (instead of the
processor) to sequentially copy all the bytes in the block
– On completion, the DMA controller restores control of the bus to the CPU
transferred. 12
7
12. DMA Controller de-asserts BR and the
processor regains control of bus
13. DMA Controller sends an interrupt to 7 10
Processor 8
Microcontroller Structure
A/D Port
Buffering and
Serial Port Direct Memory Access
CPU
(DMA)
External Memory Port
Memory,
Interfacing to Memory,
External Interrupt Port
Memory Timing
Interrupt and applications
External Timer Port Interfacing LCD
Organization Timer and
Counter Simple I/O Port
Motor Interfacing
In this course, STM32 is used as a driving vehicle for delivering the concepts.
To be covered In progress Done