ADC1_DMA_UART
所属分类:处理器开发
开发工具:C/C++
文件大小:2432KB
下载次数:3
上传日期:2019-02-12 10:30:02
上 传 者:
xuf
说明: STM32F103RCT6 高速4通道ADC,通过串口发送到PC机屏幕显示。
(STM32F103RCT6 High-speed 4-channel ADC, through the serial port sent to the PC screen display.)
文件列表:
ADC1_DMA_UART\main.c (7015, 2019-02-08)
ADC1_DMA_UART\MDK-ARM\DebugConfig\ADC1_DMA_UART_STM32F103RC_1.0.0.dbgconf (2403, 2017-11-23)
ADC1_DMA_UART\MDK-ARM\dtostr.C (555, 2019-01-16)
ADC1_DMA_UART\MDK-ARM\dtostr.C.bak (1888, 2019-01-16)
ADC1_DMA_UART\MDK-ARM\dtostre.C (1888, 2019-01-16)
ADC1_DMA_UART\MDK-ARM\EventRecorderStub.scvd (339, 2019-02-08)
ADC1_DMA_UART\MDK-ARM\note.txt (2771, 2011-04-04)
ADC1_DMA_UART\MDK-ARM\Project.uvgui.Administrator (72915, 2013-06-23)
ADC1_DMA_UART\MDK-ARM\Project.uvgui.XU (137561, 2019-01-20)
ADC1_DMA_UART\MDK-ARM\Project.uvguix.XU (177472, 2019-02-08)
ADC1_DMA_UART\MDK-ARM\Project.uvguix.XU.bak (178849, 2019-01-29)
ADC1_DMA_UART\MDK-ARM\Project.uvgui_Administrator.bak (69826, 2013-06-23)
ADC1_DMA_UART\MDK-ARM\Project.uvgui_XU.bak (137559, 2019-01-20)
ADC1_DMA_UART\MDK-ARM\Project.uvopt (161794, 2019-01-20)
ADC1_DMA_UART\MDK-ARM\Project.uvoptx (248230, 2019-02-08)
ADC1_DMA_UART\MDK-ARM\Project.uvproj.saved_uv4 (217344, 2019-01-20)
ADC1_DMA_UART\MDK-ARM\Project.uvprojx (213699, 2019-02-07)
ADC1_DMA_UART\MDK-ARM\Project_ADC1_DMA_UART.dep (85710, 2019-01-20)
ADC1_DMA_UART\MDK-ARM\Project_DAC.dep (81014, 2013-06-23)
ADC1_DMA_UART\MDK-ARM\Project_DAC_CH1_Single.dep (81206, 2013-06-23)
ADC1_DMA_UART\MDK-ARM\Project_GPIO.dep (81014, 2013-04-17)
ADC1_DMA_UART\MDK-ARM\Project_KEY4.dep (81015, 2013-06-23)
ADC1_DMA_UART\MDK-ARM\Project_STM32100E-EVAL.dep (110976, 2013-04-17)
ADC1_DMA_UART\MDK-ARM\Project_uvopt.bak (161794, 2019-01-20)
ADC1_DMA_UART\MDK-ARM\Project_uvproj.bak (217344, 2019-01-14)
ADC1_DMA_UART\MDK-ARM\RTE\_ADC1_DMA_UART\RTE_Components.h (352, 2019-01-20)
ADC1_DMA_UART\MDK-ARM\STM32F103\core_cm3.crf (3975, 2019-01-21)
ADC1_DMA_UART\MDK-ARM\STM32F103\core_cm3.d (147, 2019-01-21)
ADC1_DMA_UART\MDK-ARM\STM32F103\core_cm3.o (11876, 2019-01-21)
ADC1_DMA_UART\MDK-ARM\STM32F103\ExtDll.iex (19, 2019-02-08)
ADC1_DMA_UART\MDK-ARM\STM32F103\main.crf (378915, 2019-01-21)
ADC1_DMA_UART\MDK-ARM\STM32F103\main.d (2295, 2019-02-08)
ADC1_DMA_UART\MDK-ARM\STM32F103\main.o (12516, 2019-02-08)
ADC1_DMA_UART\MDK-ARM\STM32F103\misc.crf (349747, 2019-01-21)
ADC1_DMA_UART\MDK-ARM\STM32F103\misc.d (2280, 2019-02-08)
ADC1_DMA_UART\MDK-ARM\STM32F103\misc.o (8364, 2019-02-08)
ADC1_DMA_UART\MDK-ARM\STM32F103\Project_ADC1_DMA_UART.dep (104681, 2019-02-08)
ADC1_DMA_UART\MDK-ARM\STM32F103\startup_stm32f10x_hd_vl.d (134, 2019-02-08)
... ...
/**
ADC测试
1 显示:当前AD转换结果为:0xBCE, 百分比为:73%,电压值:2.40V.
2 16位读数按原 55 约有 7位变动,随机。实测电压值与电压表一致,不变。
3 改变 参数 55 1,7,13 似乎取1 变动位少1-2。 参数值高时,值略高,1 0XBD0 55 0XBD3
4 增加平均运算,1-20 可能提高2位。再长,不明显。
5 目前程序对电压只提高小数点后2位精度。约0.3%
6 UV4 中,user_cofig.h 没有 #include "stm32f10x.h".因此相当多变量没有定义(30~43).需要重新在其中增加.
7 本程序原是但单道.改多通道.关键是
(1) 设接收ADC通道数组.ADCConvertedValue[n] n1-16 (user_Config.h 33行)
(2) 通道设定(106行). 通道取得值在通道顺序中规定.
(3) 设定DMA缓存尺寸.(81行)
(4) ADC_SoftwareStartConvCmd(ADC1, ENABLE);软触发命令要放循环中.
8 在ARM\ARMCC\INCLUDE\sdlib.h 中 (144#)开始 定义了 atof atoi atol atoll strtod strtof strtol strtoul strtoll(***)strtoull
9 原程序是用字符方式发出。如果需要运算,还要来回变换。重新定义相关变量,直接用浮点数传输。
10 改MDK5. 汉字输入需要在edit/config...中选GB....。
11 原MDK4在用6版本编译时,提示core_cm3.h 共6处错。对比两个版本文件确实不同。用新文件复制到原文件位置。编译通过。
12 链接时出现两个警告,均为串口输出汉字位置。已经封。没有封不知如何。
13 GPIO_CON..在main.c中,ADC多通道设置必须更改相关IO. 已经实现4通道ADC,并且通过串口输出到电脑。2019、1、26.
14 备份main.c 到 f:/stm/back 4adc-main.c
15 在F:\STM\ST32DEMO\例程序103 中,ADDA.C 两个SPI总线应用例。
16 PCB :A1-A4 ADC A5-A8 LED PB12-15 SPI
17 comx 参考 stm32100e_eval.c。 usart.c 因为原A2/A3 是com2,现被ADC占用,所以为实验,改 com1 A9/A10 36#
18 com1 (usart1)有些特别,在...rcc.h 540#中 没有rcc_apb1 ...规定,因此不能通过编译。
19 stm 用 printf 函数 ,必须建立usartx 与 printf 的联系 66-74#说明,162-173#程序。增加这些之后,编译通过,执行正常。备份main.c 到 f:/stm/back 4adc-main.c
20 经过对usart3 的有关变动,#include "stm32_eval.h" 不必要。
21 经过实验,在无外界干扰时,发现多次测量平均也不能提高精度。所以取循环2次平均(备用)。
22 延迟时间从7000改为70没有区别。波特率从9600改为115200 没有问题。
23 ADCConvertedValue[n]是在main.c 192# 定义基地址。
24 我解决在USART函数界面改参数,主程序对应参数设为外部函数。
25 不能这样 //***** 只能// *****
TS(周期) tS(μs) 最大RAIN(kΩ)
1.5 0.11 1.2
7.5 0.54 10
13.5 0.96 19
28.5 2.04 41
符号 参数 典型值 最大值(3) 单位
ET 综合误差 ±2 ±5 LSB
EO 偏移误差 ±1.5 ±2.5
转换时间:1-18 uS
@page mdkarm MDK-ARM Project Template
@verbatim
******************** (C) COPYRIGHT 2011 STMicroelectronics *******************
* @file readme.txt
* @author MCD Application Team
* @version V3.5.0
* @date 08-April-2011
* @brief This sub directory contains all the user modifiable files needed
* to create a new project linked with the STM32F10x Standard Peripheral
* Library and working with RealView MDK-ARM toolchain (Version 4.12 and later).
******************************************************************************
* 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.
******************************************************************************
@endverbatim
@par Directory contents
- Project.Uv2/.Opt: A pre-configured project file with the provided library structure
that produces an executable image with MDK-ARM
Enabling "Options for Target 'Output' Browser Information" is useful for quick
source files navigation but may slow the compilation time.
@note the @subpage note file contains the needed steps to follow when using the
default startup file provided by MDK-ARM when creating new projects.
@par How to use it ?
- Open the Project.uvproj project
- In the build toolbar select the project config:
- STM32100B-EVAL: to configure the project for STM32 Medium-density Value
line devices
@note The needed define symbols for this config are already declared in the
preprocessor section: USE_STDPERIPH_DRIVER, STM32F10X_MD_VL, USE_STM32100B_EVAL
- STM3210C-EVAL: to configure the project for STM32 Connectivity line devices
@note The needed define symbols for this config are already declared in the
preprocessor section: USE_STDPERIPH_DRIVER, STM32F10X_CL, USE_STM3210C_EVAL
- STM3210B-EVAL: to configure the project for STM32 Medium-density devices
@note The needed define symbols for this config are already declared in the
preprocessor section: USE_STDPERIPH_DRIVER, STM32F10X_MD, USE_STM3210B_EVAL
- STM3210E-EVAL: to configure the project for STM32 High-density devices
@note The needed define symbols for this config are already declared in the
preprocessor section: USE_STDPERIPH_DRIVER, STM32F10X_HD, USE_STM3210E_EVAL
- STM3210E-EVAL_XL: to configure the project for STM32 XL-density devices
@note The needed define symbols for this config are already declared in the
preprocessor section: USE_STDPERIPH_DRIVER, STM32F10X_XL, USE_STM3210E_EVAL
- STM32100E-EVAL: to configure the project for STM32 High-density Value line devices
@note The needed define symbols for this config are already declared in the
preprocessor section: USE_STDPERIPH_DRIVER, STM32F10X_HD_VL, USE_STM32100E_EVAL
- Rebuild all files: Project->Rebuild all target files
- Load project image: Debug->Start/Stop Debug Session
- Run program: Debug->Run (F5)
@note
- Low-density Value line devices are STM32F100xx microcontrollers where the
Flash memory density ranges between 16 and 32 Kbytes.
- Low-density devices are STM32F101xx, STM32F102xx and STM32F103xx
microcontrollers where the Flash memory density ranges between 16 and 32 Kbytes.
- Medium-density Value line devices are STM32F100xx microcontrollers where
the Flash memory density ranges between *** and 128 Kbytes.
- Medium-density devices are STM32F101xx, STM32F102xx and STM32F103xx
microcontrollers where the Flash memory density ranges between *** and 128 Kbytes.
- High-density Value line devices are STM32F100xx microcontrollers where
the Flash memory density ranges between 256 and 512 Kbytes.
- High-density devices are STM32F101xx and STM32F103xx microcontrollers where
the Flash memory density ranges between 256 and 512 Kbytes.
- XL-density devices are STM32F101xx and STM32F103xx microcontrollers where
the Flash memory density ranges between 512 and 1024 Kbytes.
- Connectivity line devices are STM32F105xx and STM32F107xx microcontrollers.
*
© COPYRIGHT 2011 STMicroelectronics
*/
近期下载者:
相关文件:
收藏者: