ARM

所属分类:处理器开发
开发工具:Windows_Unix
文件大小:18973KB
下载次数:4
上传日期:2011-04-06 16:42:03
上 传 者liuyanan1987
说明:  本例展示了如何采集单个通道的模拟输入,通过模数转换器(ADC)将模拟量转化为数据,并通过DMA把数据转移到内存中。
(This example shows how to capture a single channel analog inputs, analog (ADC) will be converted to analog data and the data transferred by DMA to memory.)

文件列表:
ARM资料\adc采数.txt (7051, 2010-05-20)
ARM资料\新建 文本文档.txt (8253, 2010-05-20)
ARM资料\Project\Template\main.c (2502, 2009-04-06)
ARM资料\Project\Template\stm32f10x_conf.h (3222, 2009-04-06)
ARM资料\Project\Template\stm32f10x_it.c (4304, 2009-04-06)
ARM资料\Project\Template\stm32f10x_it.h (1898, 2009-04-06)
ARM资料\Project\Template\RVMDK\note.txt (1792, 2009-04-06)
ARM资料\Project\Template\RVMDK\Project.Opt (2928, 2009-04-06)
ARM资料\Project\Template\RVMDK\Project.Uv2 (7360, 2009-04-06)
ARM资料\Project\Template\RIDE\Project.rapp (41724, 2009-04-06)
ARM资料\Project\Template\RIDE\Project.rprj (291, 2009-04-06)
ARM资料\Project\Template\RIDE\stm32f10x_flash_extsram.ld (6997, 2009-04-06)
ARM资料\Project\Template\EWARMv5\Backup of Project.ewd (35670, 2009-04-06)
ARM资料\Project\Template\EWARMv5\Backup of Project.ewp (45273, 2009-04-06)
ARM资料\Project\Template\EWARMv5\Project.ewd (35670, 2009-04-06)
ARM资料\Project\Template\EWARMv5\Project.ewp (45273, 2009-04-06)
ARM资料\Project\Template\EWARMv5\Project.eww (161, 2009-04-06)
ARM资料\Project\Template\EWARMv5\stm32f10x_flash.icf (1355, 2009-04-06)
ARM资料\Project\Template\EWARMv5\stm32f10x_flash_extsram.icf (1422, 2009-04-06)
ARM资料\Project\Template\EWARMv5\stm32f10x_nor.icf (1355, 2009-04-06)
ARM资料\Project\Template\EWARMv5\stm32f10x_ram.icf (1355, 2009-04-06)
ARM资料\Project\Template\EWARMv5\STM3210E-EVAL\Obj\Project.pbd (745, 2009-08-12)
ARM资料\Project\Template\EWARMv5\settings\Project.cspy.bat (2425, 2009-08-12)
ARM资料\Project\Template\EWARMv5\settings\Project.dbgdt (63, 2009-08-12)
ARM资料\Project\Template\EWARMv5\settings\Project.dni (198, 2009-08-12)
ARM资料\Project\Template\EWARMv5\settings\Project.wsdt (4085, 2009-08-12)
ARM资料\Project\Examples\WWDG\main.c (6984, 2009-04-06)
ARM资料\Project\Examples\WWDG\platform_config.h (2952, 2009-04-06)
ARM资料\Project\Examples\WWDG\stm32f10x_conf.h (3181, 2009-04-06)
ARM资料\Project\Examples\WWDG\stm32f10x_it.c (5497, 2009-04-06)
ARM资料\Project\Examples\WWDG\stm32f10x_it.h (1941, 2009-04-06)
ARM资料\Project\Examples\USART\Synchronous\main.c (9606, 2009-04-06)
ARM资料\Project\Examples\USART\Synchronous\stm32f10x_conf.h (3206, 2009-04-06)
ARM资料\Project\Examples\USART\Synchronous\stm32f10x_it.c (4379, 2009-04-06)
ARM资料\Project\Examples\USART\Synchronous\stm32f10x_it.h (1893, 2009-04-06)
... ...

/******************** (C) COPYRIGHT 2007 STMicroelectronics ******************** * File Name : readme.txt * Author : MCD Application Team * Version : V1.0 * Date : 10/08/2007 * Description : Description of the ADC Example1. ******************************************************************************** * THE PRESENT SOFTWARE 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 SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. *******************************************************************************/ 本例展示了如何采集单个通道的模拟输入,通过模数转换器(ADC)将模拟量转化为数据,并通过DMA把数据转移到内存中。 ADC工作在连续转换模式,采集通道14(ADC Channel14)的输入,在每次转换结束后,由DMA把ADC_DR1寄存器内的转换结果传入ADC_ConvertedValue。 在STM32评估板(STM3210B-EVAL)上,模拟信号是通过通道14(ADC Channel14)采集的,但在STM32学习版(EKSTM32F)上,由于分压器连接在通道10(ADC Channel10)上,因此,也要对程序作相应的修改。 同时为了使本示例具有更加直观的演示效果,把采集得到的数据,显示在液晶屏幕上。为此,在project中加入lcd.c和lcd.h两个文件(可以直接使用学习板自带的LCDDemo中的2个同名文件),并调用其中的函数用以显示。需要注意的是,LCD显示使用了TIM2的中断,因此调用函数LcdShow_Init()来做相应的初始化,在中断配置函数(NVIC_Configuration())中,授权来自TIM2的中断,在中断函数文件stm32f10x_it.c中,也要修改相应的TIM2_IRQHandler(void)。另外,在EKSTM32F上,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,可以看到屏幕上的数值有相应的改变。 Example description =================== This example describes how to use the ADC and DMA to transfer continuously converted data from ADC to a data buffer. The ADC 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. Directory contents ================== stm32f10x_conf.h Library Configuration file stm32f10x_it.c Interrupt handlers stm32f10x_it.h Interrupt handlers header file main.c Main program Hardware environment ==================== - Connect a variable power supply 0-3.3V to ADC Channel14 mapped on pin PC.04 (potentiometer RV1 on STM3210B-EVAL board) 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 - Link all compiled files and load your image into either RAM or FLASH - Run the example ******************* (C) COPYRIGHT 2007 STMicroelectronics *****END OF FILE******

近期下载者

相关文件


收藏者