AnsweredAssumed Answered

Not working: \STM32Cube_FW_F4_V1.1.0\Projects\STM32F429I-Discovery\Examples\ADC\ADC_RegularConversion_DMA

Question asked by li.linda.001 on Jun 13, 2014
Latest reply on Jun 20, 2014 by Clive One
Hi,
I copy \STM32Cube_FW_F4_V1.1.0\Projects\STM32F429I-Discovery\Examples\ADC\ADC_RegularConversion_DMA to following location:
\STM32Cube_FW_F4_V1.1.0\Projects\STM32F429I-Discovery\Demonstrations\Modules
The ADC is not working.
Then I change ADC3 channel 8 to ADC2 channel 13, PF10 to PC3,   by change the main.h:
~~~~~~~~~~~~~~~~~~~~~~~
/* Definition for ADCx clock resources */
#define ADCx                            ADC3
#define ADCx_CLK_ENABLE()               __ADC3_CLK_ENABLE()
#define DMAx_CLK_ENABLE()               __DMA2_CLK_ENABLE()     
#define ADCx_CHANNEL_GPIO_CLK_ENABLE()  __GPIOF_CLK_ENABLE()
     
#define ADCx_FORCE_RESET()              __ADC_FORCE_RESET()
#define ADCx_RELEASE_RESET()            __ADC_RELEASE_RESET()

/* Definition for ADCx Channel Pin */
#define ADCx_CHANNEL_PIN                GPIO_PIN_10
#define ADCx_CHANNEL_GPIO_PORT          GPIOF

/* Definition for ADCx's Channel */
#define ADCx_CHANNEL                    ADC_CHANNEL_8

/* Definition for ADCx's DMA */
#define ADCx_DMA_CHANNEL                DMA_CHANNEL_2
#define ADCx_DMA_STREAM                 DMA2_Stream0         

/* Definition for ADCx's NVIC */
#define ADCx_DMA_IRQn                   DMA2_Stream0_IRQn
#define ADCx_DMA_IRQHandler             DMA2_Stream0_IRQHandler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Change to:
~~~~~~~~~~~~~~~~~~~

/* Definition for ADCx clock resources */
#define ADCx                            ADC2
#define ADCx_CLK_ENABLE()               __ADC2_CLK_ENABLE()
#define DMAx_CLK_ENABLE()               __DMA2_CLK_ENABLE()     
#define ADCx_CHANNEL_GPIO_CLK_ENABLE()  __GPIOC_CLK_ENABLE()
     
#define ADCx_FORCE_RESET()              __ADC_FORCE_RESET()
#define ADCx_RELEASE_RESET()            __ADC_RELEASE_RESET()

/* Definition for ADCx Channel Pin */
#define ADCx_CHANNEL_PIN                GPIO_PIN_3
#define ADCx_CHANNEL_GPIO_PORT          GPIOC

/* Definition for ADCx's Channel */
#define ADCx_CHANNEL                    ADC_CHANNEL_13

/* Definition for ADCx's DMA */
#define ADCx_DMA_CHANNEL                DMA_CHANNEL_2
#define ADCx_DMA_STREAM                 DMA2_Stream0         

/* Definition for ADCx's NVIC */
#define ADCx_DMA_IRQn                   DMA2_Stream0_IRQn
#define ADCx_DMA_IRQHandler             DMA2_Stream0_IRQHandler
~~~~~~~~~~~~~~~~~~~~~~~~

It is still not working,
Please help.
Thanks a lot


Outcomes