"Interface" "SPI" Polling Interrupt DMA

Source: Internet
Author: User

There are three ways to send information in I/O

1. Polling
2. Interrupt-driven I/O
3. DMA (Direct Memory Access)

Polling: The simplest way to let I/O device communicate with the CPU. As long as I/O device puts information status Register,cpu periodically checks and gets information to know the device that needs to be serviced.

interrupt-driven I/O: With Interrupt, when an I/O device needs to be serviced, it will be Interrupt to notify the CPU. An I/O interrupt for the instruction is the Asynchronous,control unit needs to check for pending I/O interrupt when a new command is executed. I/O interrupt also conveys more information, such as which device has the interrupt and its priority.

DMA (Direct Memory Access): Provides a device controller that allows I/O device to transmit information directly to the memory without the need for CPU participation.

Three steps for DMA transfer
1. The CPU initializes the DMA controller, which includes providing the name of the I/O device, the running calculation, the memory location, and the number of bytes to be sent.
2. DMA starts. If the request requires more than one transfer on the bus, the DMA unit generates the next memory address and the initial transfer.
3. Once the DMA transfer is complete, the DMA controller has a interrupt to the CPU.

Compare
Polling Interrupt-driven I/O Dma
Advantages Easy to perform, can use software to change the CPU polling sequence Without a lot of time on polling.

Suitable for high speed devices

Without a lot of time on polling.

Lack of a bit

Because CPU speed is much faster than I/O device, it will be wasted time on polling

Not suitable for high-bandwidth devices

Need to have interrupt signals and interrupt service routine exist

Not suitable for high-bandwidth devices

Need to have DMA contro

"Interface" "SPI" Polling Interrupt DMA

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.