ADC_DMA

所属分类:处理器开发
开发工具:C/C++
文件大小:1014KB
下载次数:131
上传日期:2010-09-24 13:16:47
上 传 者sddp001
说明:  STM32F10X ADC DMA操作实例,STM32例程包之一
(STM32F10X ADC DMA operation instance, STM32 routine one package)

文件列表:
ADC_DMA\MDK_prj\Src\cortexm3_macro.s (10308, 2008-09-21)
ADC_DMA\MDK_prj\Src\stm32f10x_vector.s (12871, 2008-09-21)
ADC_DMA\MDK_prj\Src\lcd.c (6763, 2007-09-27)
ADC_DMA\MDK_prj\Src\lcd.h (1849, 2007-09-25)
ADC_DMA\MDK_prj\Src\stm32f10x_conf.h (6482, 2009-12-12)
ADC_DMA\MDK_prj\Src\stm32f10x_it.c (31854, 2009-12-11)
ADC_DMA\MDK_prj\Src\stm32f10x_it.h (3842, 2008-09-21)
ADC_DMA\MDK_prj\Src\platform_config.h (1912, 2009-12-07)
ADC_DMA\MDK_prj\Src\main.c (13265, 2009-12-13)
ADC_DMA\MDK_prj\Output\ADC_DMA.axf (342716, 2009-12-11)
ADC_DMA\MDK_prj\Output\ADC_DMA.plg (166, 2009-12-11)
ADC_DMA\MDK_prj\Output\cortexm3_macro.o (2392, 2009-12-11)
ADC_DMA\MDK_prj\Output\stm32f10x_vector.o (5672, 2009-12-11)
ADC_DMA\MDK_prj\Output\main.d (716, 2009-12-11)
ADC_DMA\MDK_prj\Output\main.crf (252837, 2009-12-11)
ADC_DMA\MDK_prj\Output\main.o (263612, 2009-12-11)
ADC_DMA\MDK_prj\Output\lcd.d (661, 2009-12-11)
ADC_DMA\MDK_prj\Output\lcd.crf (250653, 2009-12-11)
ADC_DMA\MDK_prj\Output\lcd.o (259436, 2009-12-11)
ADC_DMA\MDK_prj\Output\stm32f10x_it.d (889, 2009-12-11)
ADC_DMA\MDK_prj\Output\stm32f10x_it.crf (254245, 2009-12-11)
ADC_DMA\MDK_prj\Output\stm32f10x_it.o (272524, 2009-12-11)
ADC_DMA\MDK_prj\Output\stm32f10x_lib.d (788, 2009-12-11)
ADC_DMA\MDK_prj\Output\stm32f10x_lib.crf (249343, 2009-12-11)
ADC_DMA\MDK_prj\Output\stm32f10x_lib.o (254528, 2009-12-11)
ADC_DMA\MDK_prj\Output\stm32f10x_adc.d (418, 2009-12-11)
ADC_DMA\MDK_prj\Output\stm32f10x_adc.crf (216702, 2009-12-11)
ADC_DMA\MDK_prj\Output\stm32f10x_adc.o (220324, 2009-12-11)
ADC_DMA\MDK_prj\Output\stm32f10x_dma.d (418, 2009-12-11)
ADC_DMA\MDK_prj\Output\stm32f10x_dma.crf (209245, 2009-12-11)
ADC_DMA\MDK_prj\Output\stm32f10x_dma.o (210140, 2009-12-11)
ADC_DMA\MDK_prj\Output\stm32f10x_gpio.d (427, 2009-12-11)
ADC_DMA\MDK_prj\Output\stm32f10x_gpio.crf (209042, 2009-12-11)
ADC_DMA\MDK_prj\Output\stm32f10x_gpio.o (210080, 2009-12-11)
ADC_DMA\MDK_prj\Output\stm32f10x_rcc.d (357, 2009-12-11)
ADC_DMA\MDK_prj\Output\stm32f10x_rcc.crf (207566, 2009-12-11)
ADC_DMA\MDK_prj\Output\stm32f10x_rcc.o (208068, 2009-12-11)
ADC_DMA\MDK_prj\Output\stm32f10x_nvic.d (365, 2009-12-11)
ADC_DMA\MDK_prj\Output\stm32f10x_nvic.crf (202966, 2009-12-11)
... ...

/******************** (C) COPYRIGHT 2008 STMicroelectronics ******************** * File Name : readme.txt * Author : MCD Application Team * Version : V2.0.3 * Date : 09/22/2008 * Description : Description of the ADC1 DMA example. ******************************************************************************** * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. *******************************************************************************/ Example description =================== This example describes how to use the ADC1 and DMA to transfer continuously converted data from ADC1 to memory. The ADC1 is configured to converts continuously ADC channel14. Each time an end of conversion occurs the DMA transfers, in circular mode, the converted data from ADC1 DR register to the ADC_ConvertedValue variable. The ADC1 clock is set to 14 MHz. 本例展示了如何采集单个通道的模拟输入,通过模数转换器(ADC)将模拟量转化为数据,并通过DMA把数据转移到内存中。 ADC工作在连续转换模式,采集通道10(ADC Channel10)的输入,在每次转换结束后, 由DMA把ADC_DR1寄存器内的转换结果传入ADC_ConvertedValue。 同时为了使本示例具有更加直观的演示效果,把采集得到的数据,显示在液晶屏幕上。 需要注意的是,LCD显示使用了TIM2的中断,因此调用函数LcdShow_Init()来做相应的初始化, 在中断配置函数(NVIC_Configuration())中,授权来自TIM2的中断, 在中断函数文件stm32f10x_it.c中,也要修改相应的TIM2_IRQHandler(void)。 另外,在USE_STM3210B_LK1上,LCD使用了I/O端口E的全部16个管脚,和I/O端口C的4个管脚(PC.08 C PC.11), 在I/O端口配置程序(GPIO_Configuration())和时钟配置程序(RCC_Configuration())中,也要作相应的配置。 PC.00管脚上的电压值,就直接显示在屏幕上了,0000对应0V,0FFF对应3.3V, 调节分压器VR1,可以看到屏幕上的数值有相应的改变。 Directory contents ================== stm32f10x_conf.h Library Configuration file stm32f10x_it.c Interrupt handlers stm32f10x_it.h Interrupt handlers header file main.c Main program lcd.h 液晶显示屏驱动头文件 lcd.c 液晶显示屏驱动文件 Hardware environment ==================== This example runs on STMicroelectronics STM3210B-EVAL and STM3210E-EVAL evaluation boards and can be easily tailored to any other hardware. - Connect a variable power supply 0-3.3V to ADC Channel14 mapped on pin PC.04 (potentiometer RV1 on STM3210B-EVAL and STM3210E-EVAL boards) 这个例程可以运行在南京万利公司的STM3210B-LK1开发板上,并可以很容易的移植到其他开发板。 连接方式: PE.00 - PE.15 连接液晶显示屏的16个段选通管脚 PC.08 C PC.11 连接液晶显示屏的4个公共管脚 PC.00 连接一个由0-3.3V供电的电位器 How to use it ============= In order to make the program work, you must do the following : - Create a project and setup all your toolchain's start-up files - Compile the directory content files and required Library files : + stm32f10x_lib.c + stm32f10x_adc.c + stm32f10x_dma.c + stm32f10x_gpio.c + stm32f10x_rcc.c + stm32f10x_nvic.c + stm32f10x_flash.c + stm32f10x_tim.c - Link all compiled files and load your image into target memory - Run the example ******************* (C) COPYRIGHT 2008 STMicroelectronics *****END OF FILE******

近期下载者

相关文件


收藏者