你的浏览器版本过低,可能导致网站不能正常访问!
为了你能正常使用网站功能,请使用这些浏览器。

查看: 11493|回复: 49

[STM32F429] 【STM32F429开发日志】4.ADC+DMA高速采样(2.4Msps)

[复制链接]

43

主题

292

回帖

0

蝴蝶豆

金牌会员

最后登录
2020-11-28
发表于 2014-6-1 11:58:29 | 显示全部楼层 |阅读模式
 


硬件平台:STM32F429I-DISCORVERY
软件平台:KEIL MDK5.10
DMA知识点:直接内存访问(DMA)是用来以提供外设和内存、内存和内存之间的高速数据传输的。数据可以在没有任何CPU干预下通过的DMA进行传输。这使得CPU资源更倾重与其他操作。
       DMA控制器是一个复杂的总线矩阵架构,结合了功能强大的双AHB主总线架构与独立的FIFO,以优化系统带宽。两个DMA控制器共有16个数据流(stream),每个数据流可以编程与规定的通道中的一个搭配。
      在STM32F429I-DISCO board中,由于串口2被L3GD20和液晶数据线占用,所以串口1很方便,而且还留了2个孔外接。

    This example describes how to use the ADC3 and DMA to transfer continuously 
converted data from ADC3 to memory.
    The ADC3 is configured to convert continuously channel13.
    Each time an end of conversion occurs the DMA transfers, in circular mode, the
converted data from ADC3 DR register to the ADC3ConvertedValue variable.
    To get the maximum ADC performance (2.4 MSPS, at 2.4V to 3.6V supply range),  
the ADC clock must be set to 36MHz. As ADC clock is equal to APB2/2, then APB2 
value will be 72MHz which lead to maximum AHB (System clock) at 144MHz. 
Since the sampling time is set to 3 cycles and the conversion time to 12bit data
is 12 cycles, so the total conversion time is (12+3)/36= 0.41us(2.4Msps).


    The converted voltage is displayed on the STM32F429I-DISCO board LCD (when the define USE_LCD
is enabled in main.h). It can also be monitored by adding the variable "ADC3ConvertedValue" 
to the debugger watch window. 


*        说    明 : 实现printf和scanf函数重定向到串口1,即支持printf信息到USART1
*                                实现重定向,只需要添加2个函数:
*                                int fputc(int ch, FILE *f);
*                                int fgetc(FILE *f);
*                                对于KEIL MDK编译器,编译选项中需要在MicorLib前面打钩,否则不会有数据打印到USART1。
*/
 
Description:
This example is used as a template project that can be used as reference to build
any new firmware application for STM32F429xx devices using the STM32F4xx Standard
Peripherals Library. it can be easily tailored to any other supported device and development board.
 
int main(void)
{
   
   uint8_t aTextBuffer[15];
         uint32_t i,sum;
  SysTick_Init();
  STM_EVAL_LED_Config();
  STM_EVAL_PBInit(BUTTON_MODE_EXTI);
       
  /* Initialize the LCD */
  LCD_Init();
  LCD_LayerInit();
  LTDC_Cmd(ENABLE);
  LCD_SetLayer(LCD_FOREGROUND_LAYER);
  LCD_Clear(LCD_COLOR_BLUE);
        LCD_DisplayStringLine(LCD_LINE_4, "Hello,Casy!");
        LCD_DisplayStringLine(LCD_LINE_5, "(*^__^*)");
  USART1_GPIO_Config();
  printf("\n\rHello, Stm32f429-discovery Board ! \n\r");
                               
  ADC3_CH13_DMA_Config();
  
  ADC_SoftwareStartConv(ADC3); /* Start ADC3 Software Conversion */ 
       
  while (1)
  {
      /* convert the ADC value (from 0 to 0xFFF) to a voltage value (from 0V to 3.0V)*/
    uwADC3ConvertedVoltage = uhADC3ConvertedValue *3000/0xFFF;//(0xfff=4096=2^12)
                printf("\n\rThe adc sample voltage is : %d mV\n\r",uwADC3ConvertedVoltage); 
           for(i = 0;i
2014-05-31_19-17-23.jpg
QQ截图20140601114835.jpg

5.ADC3+DMA高速采样(2.4Msps).zip

下载

2.16 MB, 下载次数: 1257, 下载积分: ST金币 -1

回复

使用道具 举报

43

主题

292

回帖

0

蝴蝶豆

金牌会员

最后登录
2020-11-28
 楼主| 发表于 2014-6-1 11:59:48 | 显示全部楼层

RE:【STM32F429开发日志】4.ADC+DMA高速采样(2.4Msps)

关于滤波还没有深入研究,只是做了一个简单的均值滤波。。。呵呵,以后有时间了再整
回复 支持 反对

使用道具 举报

3

主题

25

回帖

0

蝴蝶豆

初级会员

最后登录
2019-8-9
发表于 2014-6-5 11:54:04 | 显示全部楼层

回复:【STM32F429开发日志】4.ADC+DMA高速采样(2.4Msps)

学习下,我用串口DMA发送没问题,接收还没看懂,参考下你的程序
回复 支持 反对

使用道具 举报

1

主题

4

回帖

0

蝴蝶豆

新手上路

最后登录
1970-1-1
发表于 2014-6-11 16:26:26 | 显示全部楼层

回复:【STM32F429开发日志】4.ADC+DMA高速采样(2.4Msps)

学习学习
回复 支持 反对

使用道具 举报

0

主题

1

回帖

0

蝴蝶豆

初级会员

最后登录
2020-5-15
发表于 2014-6-14 15:57:47 | 显示全部楼层

回复:【STM32F429开发日志】4.ADC+DMA高速采样(2.4Msps)

串口DMA发送没问题,接收还没看懂,参考下你的程序
回复 支持 反对

使用道具 举报

50

主题

193

回帖

0

蝴蝶豆

金牌会员

最后登录
2020-7-23
发表于 2014-6-19 09:25:02 | 显示全部楼层

RE:【STM32F429开发日志】4.ADC+DMA高速采样(2.4Msps)

不错,来参考下。
回复 支持 反对

使用道具 举报

1

主题

4

回帖

0

蝴蝶豆

新手上路

最后登录
2020-5-28
发表于 2014-6-20 11:52:38 | 显示全部楼层

回复:【STM32F429开发日志】4.ADC+DMA高速采样(2.4Msps)

多谢,学习学习
回复 支持 反对

使用道具 举报

9

主题

178

回帖

0

蝴蝶豆

高级会员

最后登录
1970-1-1
发表于 2014-6-20 14:08:35 | 显示全部楼层

RE:【STM32F429开发日志】4.ADC+DMA高速采样(2.4Msps)

回复 支持 反对

使用道具 举报

1

主题

3

回帖

0

蝴蝶豆

新手上路

最后登录
1970-1-1
发表于 2014-6-20 23:38:14 | 显示全部楼层

回复:【STM32F429开发日志】4.ADC+DMA高速采样(2.4Msps)

 多谢分享
 
回复 支持 反对

使用道具 举报

4

主题

23

回帖

0

蝴蝶豆

新手上路

最后登录
1970-1-1
发表于 2014-6-24 18:03:01 | 显示全部楼层

回复:【STM32F429开发日志】4.ADC+DMA高速采样(2.4Msps)

 参考参考!!!
回复 支持 反对

使用道具 举报

关于意法半导体
我们是谁
投资者关系
意法半导体可持续发展举措
创新与技术
招聘信息
联系我们
联系ST分支机构
寻找销售人员和分销渠道
社区
媒体中心
活动与培训
隐私策略
隐私策略
Cookies管理
行使您的权利
关注我们
st-img 微信公众号
st-img 手机版