文件名称:stm32_adc
- 所属分类:
- 单片机(51,AVR,MSP430等)
- 资源属性:
- [C/C++] [源码]
- 上传时间:
- 2012-11-26
- 文件大小:
- 4kb
- 下载次数:
- 0次
- 提 供 者:
- 韩**
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
此程序是基于STM32的AD应用程序,我们在这里设置ADC为连续转换模式,常规转换序列中有两路转换通道,分别是ADC_CH10(PC0)和ADC_CH16(片内温度传感器)。因为使用了自动多通道转换,数据的取出工作最适合使用DMA方式取出,so,我们在内存里开辟了一个u16 AD_Value[2]数组,并设置了相应的DMA模块,使ADC在每个通道转换结束后启动DMA传输,其缓冲区数据量为2个HalfWord,使两路通道的转换结果自动的分别落到AD_Value[0]和AD_Value[1]中。
然后,在主函数里,就无需手动启动AD转换,等待转换结束,再取结果了。我们可以在主函数里随时取AD_Value中的数值,那里永远都是最新的AD转换结果。
如果我们定义一个更大的AD_Value数组,并调整DMA的传输数据量(BufferSize)可以实现AD结果的循环队列存储,从而可以进行各种数字滤波算法。-This program is based on the STM32 processor AD debugging applications, we are here to set the ADC for continuous conversion mode, conventional two-way conversion sequence are converted channels, respectively ADC_CH10 (PC0) and ADC_CH16 (on-chip temperature sensors). Since the use of an automatic multi-channel conversion, data, work out the most appropriate way to use DMA out, so, we have opened up in memory of a u16 AD_Value [2] array, and set the corresponding DMA module, so that each channel ADC conversion After the start the DMA transfer, the buffer data for the two HalfWord, so that the conversion results of two-way channels were automatically fall AD_Value [0], and AD_Value [1] in the.
Then, in the main function, where is no need to manually start the AD conversion, to wait for the end of conversion, and then take the result. We can readily accessible in the main function where the value of AD_Value, there is always the latest AD conversion results.
If we define a larger arra
然后,在主函数里,就无需手动启动AD转换,等待转换结束,再取结果了。我们可以在主函数里随时取AD_Value中的数值,那里永远都是最新的AD转换结果。
如果我们定义一个更大的AD_Value数组,并调整DMA的传输数据量(BufferSize)可以实现AD结果的循环队列存储,从而可以进行各种数字滤波算法。-This program is based on the STM32 processor AD debugging applications, we are here to set the ADC for continuous conversion mode, conventional two-way conversion sequence are converted channels, respectively ADC_CH10 (PC0) and ADC_CH16 (on-chip temperature sensors). Since the use of an automatic multi-channel conversion, data, work out the most appropriate way to use DMA out, so, we have opened up in memory of a u16 AD_Value [2] array, and set the corresponding DMA module, so that each channel ADC conversion After the start the DMA transfer, the buffer data for the two HalfWord, so that the conversion results of two-way channels were automatically fall AD_Value [0], and AD_Value [1] in the.
Then, in the main function, where is no need to manually start the AD conversion, to wait for the end of conversion, and then take the result. We can readily accessible in the main function where the value of AD_Value, there is always the latest AD conversion results.
If we define a larger arra
(系统自动生成,下载前可以参看下载内容)
下载文件列表
stm32_adc.c