一、AD Setting

1、Calibration (ADCAL)

2、设定ADC Chennel与SCANDIR等,在低功耗应用方案,选择PCLK/4,并设置SMP(tCONV = Sampling time + 12.5 x ADC clock cycles)

3、AD设置为Single conversion mode (CONT=0)

In Single conversion mode, the ADC performs a single sequence of conversions, converting
all the channels once. This mode is selected when CONT=0 in the ADC_CFGR1 register.
Conversion is started by either:
● Setting the ADSTART bit in the ADC_CR register
● Hardware trigger event
Inside the sequence, after each conversion is complete:
● The converted data are stored in the 16-bit ADC_DR register
● The EOC (end of conversion) flag is set
● An interrupt is generated if the EOCIE bit is set
After the sequence of conversions is complete:
● The EOSEQ (end of sequence) flag is set
● An interrupt is generated if the EOSEQIE bit is set
Then the ADC stops until a new external trigger event occurs or the ADSTART bit is set
again.

4、Starting conversions (ADSTART)

Software starts ADC conversions by setting ADSTART=1.
When ADSTART is set, the conversion:
● Starts immediately if EXTEN = 0x0 (software trigger)
● At the next active edge of the selected hardware trigger if EXTEN  0x0
The ADSTART bit is also used to indicate whether an ADC operation is currently ongoing. It
is possible to re-configure the ADC while ADSTART=0, indicating that the ADC is idle.
The ADSTART bit is cleared by hardware:
● In single mode with software trigger (CONT=0, EXTSEL=0x0)
– At any end of conversion sequence (EOSEQ=1)
● In all cases (CONT=x, EXTSEL=x)
– After execution of the ADSTP procedure invoked by software (see
Section 12.4.11: Stopping an ongoing conversion (ADSTP) on page 179.
Note: 1 In continuous mode (CONT=1), the ADSTART bit is not cleared by hardware when the
EOSEQ flag is set because the sequence is automatically relaunched.
2 When hardware trigger is selected in single mode (CONT=0 and EXTSEL  0x00),
ADSTART is not cleared by hardware when the EOSEQ flag is set. This avoids the need for
software having to set the ADSTART bit again and ensures the next trigger event is not
missed.

5、Conversion on external trigger and trigger polarity (EXTSEL,EXTEN)

EXTEN[1:0]=01  -> rising edge

EXTSEL[2:0]=100->TIM15_TRGO

6、RES设置解析度12bit与数据右对齐方式

7、Managing converted data using the DMA ==>DMAEN=1,DMA circular mode (DMACFG=1)

Since all converted channel values are stored in a single data register, it is efficient to use
DMA when converting more than one channel. This avoids losing the conversion data
results stored in the ADC_DR register.
When DMA mode is enabled (DMAEN bit set to 1 in the ADC_CFGR1 register), a DMA
request is generated after the conversion of each channel. This allows the transfer of the

converted data from the ADC_DR register to the destination location selected by the
software.

二、DMA Setting

The following sequence should be followed to configure a DMA channelx (where x is the
channel number).
1. Set the peripheral register address in the DMA_CPARx register. The data will be
moved from/ to this address to/ from the memory after the peripheral event.
2. Set the memory address in the DMA_CMARx register. The data will be written to or
read from this memory after the peripheral event.
3. Configure the total number of data to be transferred in the DMA_CNDTRx register.
After each peripheral event, this value will be decremented.
4. Configure the channel priority using the PL[1:0] bits in the DMA_CCRx register
5. Configure data transfer direction, circular mode, peripheral & memory incremented
mode, peripheral & memory data size, and interrupt after half and/or full transfer in the
DMA_CCRx register
6. Activate the channel by setting the ENABLE bit in the DMA_CCRx register.
As soon as the channel is enabled, it can serve any DMA request from the peripheral
connected on the channel.


三、TIM SETTING

1、设置TIM15为16Khz溢出,并设置URS=0,UDIS=0=>使能UEV event (不需配置更新中断);

2、设置MMS[2:0]=010

Update - The update event is selected as trigger output (TRGO).

3、使能TIM

OK!

注:

1、相应Clk需Enable;

2、DMA的buf满了之后会触发中断,从中获取数据;


16Khz音频定时触发采样DMA存储过程的更多相关文章

  1. mysql 触发器和存储过程组合使用,实现定时触发操作

    mysql可以实现定时触发功能,比如说定于某某时间mysql数据库做什么工作,或每隔多长时间做什么工作. 第二种情况应用还是比较广的,比如说我希望每天检查一下我的数据信息,超过一个月的无用信息清除以腾 ...

  2. 【STM32H7教程】第60章 STM32H7的DAC应用之定时器触发实现DMA方式双通道波形

    完整教程下载地址:http://www.armbbs.cn/forum.php?mod=viewthread&tid=86980 第60章       STM32H7的DAC应用之定时器触发实 ...

  3. 在Salesforce中创建Schedule的Job去定时触发对应的Class

    在Salesforce中也存在着Job的概念,当然了我们可以创建Schedule的Job去定时触发对应的Class,来完成我们所需要定时处理的功能,比如:定时同步数据. 具体处理步骤如下所示: 1): ...

  4. linux 下crontab相关定时触发的配置规则

    linux 下crontab相关定时触发的配置规则: 1.基本格式 :* * * * * command(分 时 日 月 周 命令)2.取值范围:分钟1-59 每分钟用*或者 */1表示小时1-23( ...

  5. SQL server 定时自动执行SQL存储过程

    当一个存储过程是为了生成报表,并且是周期性的,则不需要人工干预,由SQL作业定时自动执行些SQL存储过程即可. 本示例,假设已需要定时执行的存储过程为:Pr_test 工具/原料 SQL Server ...

  6. mysql视图、触发事务、存储过程

    视图 视图是一个虚拟表(非真实存在的),其本质就是根据SQL语言获取动态的数据集,并为其命名,用户使用时只需要使用名称即可获得结果集,可以将结果集当做表来使用. 视图是存在数据库中的,如果我们程序中使 ...

  7. 在pgsql库用触发器自动触发PostgreSQL的存储过程,实现插入。

    需求:在对表A 执行 insert操作时,筛选符合条件的数据 insert到表B中,编写为存储过程(postgreSQL数据库) [筛选条件]:1. dd !="A" 或是 dd为 ...

  8. 如何减轻ajax定时触发对服务器造成的压力和带宽的压力?ajax-长轮训

    AJAX长轮询的方法来解决频繁对后台的请求,进一步减小压力 在实现过程发现AJAX的多次请求会出现多线程并发的问题又使用线程同步来解决该问题 个人对ajax长轮询的一点愚见 ajax请示后台时,后台程 ...

  9. Django 框架中定时触发脚本

    方法一: Django搭建的服务器一般都用作WEB网站进行访问,通常的形式是用户访问网站或点击按钮发送请求,Django检测到请求后进行相应的试图函数处理后返回页面给用户. 但是,我们有时会需要有一些 ...

随机推荐

  1. Silverlight 雷达图和一种特殊泡泡画法

    原文:Silverlight 雷达图和一种特殊泡泡画法 自上次发了雷达图,也没怎么说一下. 这次又做了一种图,继续共享一下,就是以一个点为中心,周围绕着几个点,用一个箭头与中心相连并带有某些信息.圆 ...

  2. Appium0.18.x迁移到Appium1.x须知事项

    英文原版:https://github.com/appium/appium/blob/master/docs/en/advanced-concepts/migrating-to-1-0.md Migr ...

  3. AutoMapper 创建嵌套对象映射(原创)

    之前在做DTO转换时,用到AutoMapper.但DTO的层次太深了,无奈官方没针对嵌套类型提供好的解决方案,于是自己实现了一下: 思路:采用递归和反射很好的避免手工创建嵌套对象的映射. 第一个版本, ...

  4. sqlserver大容量日志文件处理

    原文:sqlserver大容量日志文件处理 针对SqlServer2000 .SqlServer2005.SqlServer2008.SqlServer2012.SqlServer2014库日志文件优 ...

  5. C# & WPF 随手小记之一 ——初探async await 实现多线程处理

    嗯...我也是在园子待了不短时间的人了,一直以来汲取着园友的知识,感觉需要回馈什么. 于是以后有空我都会把一些小技巧小知识写下来,有时候可能会很短甚至很简单,但希望能帮到大家咯. 第一篇文章来说说as ...

  6. 如何优雅的研究 RGSS3 (七) 加入LOGO屏幕

    对于游戏 LOGO 屏幕. 首先设计 LOGO Scene类.我们知道,现场类 Scene_Base 子类. 让我们回顾一下现场的作品. 首先运行开始处理.其次是开始治疗.然后停止更新屏幕,最后,治疗 ...

  7. 【转】Android 系统菜单与自定义菜单

    Android 系统菜单与自定义菜单实现方法如下:系统菜单显示DefaultMenu.java package com.wxz.menu; import com.wxz.menu.R; import  ...

  8. 【转】Android 网络通信框架Volley简介(Google IO 2013)

    Volley主页 https://android.googlesource.com/platform/frameworks/volley http://www.youtube.com/watch?v= ...

  9. HBase MVCC 代码阅读(一)

    MultiVersionConcurrencyControl.java,版本 0.94.1 MultiVersionConsistencyControl 管理 memstore 中的读写一致性.该类实 ...

  10. [置顶] c# 验证码生成

    今儿有一个任务是输出一串字符,要求用GDI画出于是: Bitmap bm = new Bitmap(200, 200);             Graphics g = Graphics.FromI ...