2017-08-23 07:03 AM
Hey,
i have a strange behavior of STM32F071RB6T.
I initialize the RCC, TIM3 for PWM 1Ch. works!
I initialize the RCC, TIM3 for PWM 1Ch, ADC with DMA. works!
I deaktivate PWM init and just whant to test the ADC with DMA and...suprise suprise.
micro does not finished the hardware init and stucks in the while for waiting ADRDY.
I atached main.c initialisierung.c
Did i forget something?
Thanks in advanced.
#stm32f071rb6t-adc_dma-fail2017-08-23 07:36 AM
The USART TX pins should be PP not OD mode
TIM16 interrupts enable, no NVIC enable
Does the ADC require HSI enabled on F0 parts?
Review Peripheral register states in debuggers 'Peripheral View'
2017-08-23 10:37 AM
You are right with USART , my mistake.
But.. USART and TIMER are not initialized in the code. They are commented out.
Please look at the bottom of the init file at void Init_Hardware(void)
Just RCC, PWM and ADC_DMA are active.
I don't think that enabeling the RCC for the rest of the periph is responsible for the problem.
Any other ideas?
I read in the ERRATA of the cpu that there are problems with the ADC and ADRDY, ADCAL.
But i don't understand the solution.
May be you do?
Thanks in advanced.
Sebastian
EDIT: Tomorrow i can provide screenshot's. But what i can say is that the ADRDY flag will not be set und that in debug he stucks at the while in the init of ADC.
2017-08-23 11:09 AM
Move the DMA Init ahead of the ADC Init code.
I'm not using F0 parts, and not going to reconstruct this into a compilable project.
Check the peripheral registers in working vs not working situation.
See if this ordering hangs
...
/* ADC Calibration */
ADC_GetCalibrationFactor(ADC1); ADC_Cmd(ADC1,ENABLE); /* Wait until ADC is not Ready*/ while(!ADC_GetFlagStatus(ADC1, ADC_FLAG_ADRDY))/* DMA Circular Mode*/
ADC_DMARequestModeConfig(ADC1, ADC_DMAMode_Circular);/* Enable DMA, ADC1 */
ADC_DMACmd(ADC1, ENABLE);/* Fire Up Conversion */
ADC_StartOfConversion(ADC1);...
2017-08-23 11:30 AM
Thank you for the fast answer, i will try it tomorrow and will report soon.
Thanks in advanced.
Sebastian