没有合适的资源?快使用搜索试试~ 我知道了~
首页STM32-DMA-详细讲解
STM32-DMA-详细讲解
需积分: 48 314 浏览量
更新于2023-05-27
评论
收藏 245KB PDF 举报
主要讲解STM32 DMA controller的特点,架构,性能 和用法,还有示例用法
资源详情
资源评论
资源推荐

June 2013 DocID13529 Rev 4 1/12
AN2548
Application note
Using the STM32F1x and STM32L1x DMA controller
Introduction
This application note describes how to use the STM32F1x and STM32L1x direct memory
access (DMA) controller. The STM32F1x and STM32L1x DMA controller, the Cortex™-M3
core, the advanced microcontroller bus architecture (AMBA) bus and the memory system
contribute to provide a high data bandwidth and to develop very-low latency response time
software.
This application note also describes how to take full advantage of these features and ensure
correct response times for different peripherals and subsystems.
The STM32F1x and STM32L1x will be referred to as STM32F1x/L1x, and the DMA
controller as DMA throughout the document.
Reference documents and firmware
• STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and STM32F107xx
advanced ARM-based 32-bit MCUs reference manual (RM0008)
• STM32F100xx advanced ARM-based 32-bit MCUs reference manual (RM0041)
• STM32L100xx, STM32L151xx, STM32L152xx and STM32L162xx advanced ARM-based
32-bit MCUs reference manual(RM0038)
• STM32F1x DMA firmware examples (STSW-STM32007)
• STM32F1x standard peripheral library (STSW-STM32054)
• STM32L1x standard peripheral library (STSW-STM32077)
Table 1. Application products and firmware
Type Part numbers and product categories
Microcontrollers
STM32F1 series
STM32L1 series
MCU software STSW-STM32007
www.st.com

Contents AN2548
2/12 DocID13529 Rev 4
Contents
1 DMA controller description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1 Main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 Performance considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.1 Round robin priority scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.2 Multi-layer structure and bus stealing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.3 DMA latency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.4 Databus bandwidth limitation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.5 Choosing channel priority . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.5.1 Application requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.5.2 Internal data bandwidth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3 DMA programming examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.1 Example of ADC continuous data acquisition with SPI transfer . . . . . . . . . 9
3.2 ADC continuous data acquisition with direct SPI transfer . . . . . . . . . . . . . 9
3.3 GPIO fast data transfer with DMA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4 Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

DocID13529 Rev 4 3/12
AN2548 DMA controller description
12
1 DMA controller description
The DMA is an AMBA advanced high-performance bus (AHB) module that features two
AHB ports: a slave port for DMA programming and a master port that allows the DMA to
initiate data transfers between different slave modules.
The DMA allows data transfers to take place in the background, without the intervention of
the Cortex-M3 processor. During this operation, the main processor can execute other tasks
and it is only interrupted when a whole data block is available for processing. Large amounts
of data can be transferred with no major impact on the system performance.
The DMA is mainly used to implement central data buffer storage (usually in system SRAM)
for different peripheral modules. This solution is less expensive in terms of silicon and power
consumption compared to a distributed solution where each peripheral needs to implement
it own local data storage.
The STM32F1x/L1x DMA controller takes full advantage of the Cortex-M3 Harvard
architecture and the multilayer bus system in order to ensure very low latency both for DMA
transfers and for CPU execution/interrupt event detection/service.
Depending on the sales type used, one or two DMA controllers are implemented
.
1.1 Main features
The DMA(s) offer(s):
• Twelve DMA channels (7 for DMA1 and 5 for DMA2) supporting unidirectional data
transfers from source to destination
• Hardware- and software-programmable channel priority for each DMA
• Memory-to-memory, memory-to-peripheral, peripheral-to-memory and peripheral-to-
peripheral transfers (memory can be SRAM or Flash)
• Control of hardware/software transfers
• Automatic increment of peripheral and memory pointers
• Programmable data size
• Automatic bus-error management
• Non-circular/circular mode
• Transfer of up to 65536 data tokens
The DMA aims to offer a relatively large data buffer to all peripherals. This buffer is usually
located in system SRAM.
Each channel is assigned to a unique peripheral (data channel) at a given time. Peripherals
connected to the same DMA channel cannot be used simultaneously with active DMA (DMA
function active in the peripheral register).
To identify the different peripherals supporting DMA transfers for the STM32F1x and
STM32L1x product series, refer to direct memory access controller (DMA) section of the
corresponding reference manuals (RM0008, RM0041, and RM0038). These documents
contain the DMA block diagrams and the DMA request mapping from all the peripherals
connected to the DMA channels.
剩余11页未读,继续阅读

















xyhxing
- 粉丝: 1
- 资源: 6
上传资源 快速赚钱
我的内容管理 收起
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助

会员权益专享
最新资源
- ARM Cortex-A(armV7)编程手册V4.0.pdf
- ABB机器人保养总结解析.ppt
- 【超详细图解】菜鸡如何理解双向链表的python代码实现
- 常用网络命令的使用 ipconfig ping ARP FTP Netstat Route Tftp Tracert Telnet nslookup
- 基于单片机控制的DC-DC变换电路
- RS-232接口电路的ESD保护.pdf
- linux下用time(NULL)函数和localtime()获取当前时间的方法
- Openstack用户使用手册.docx
- KUKA KR 30 hA,KR 60 hA机器人产品手册.pdf
- Java programming with JNI
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈



安全验证
文档复制为VIP权益,开通VIP直接复制

评论0