cancel
Showing results for 
Search instead for 
Did you mean: 

ADC in trigger+continuous configuration failing to perform conversions

KHarb.1
Senior II
I’m using CubeIDE and I need to load a single memory location of the FMAC input buffer via DMA with readings from a single ADC channel that is triggered by a timer output compare.  DR register on the ADC shows a stuck value indicating conversions aren’t taking place. I’m using the same trigger for other things successfully, but I don’t see any conversions happening. I'm using HAL_ADC_START_DMA + Cube...are there more config steps for trigger mode?
 
As a possible substitute, I disabled the trigger option and kept continuous mode enabled. I can see a single conversion and DMA transfer take place at startup, but not continuous.  I read this can be due to overloading DMA with constant requests, so I set the sample time to 640 clock cycles, but it didn’t change anything. In this state, I can see ADSTART is 0. If I set it to 1, I get another single conversion and a DMA transfer and ADSTART goes back to zero. It looks like this is nearly working...but I'm likely just missing a setting.  I was also unsuccessful in getting continuous mode to work even without DMA, so I don’t think that’s the problem. What could I have missed?
 
 
1 ACCEPTED SOLUTION

Accepted Solutions
KHarb.1
Senior II

TIM20 is configured to have its trigger as OC1. If ADC has its trigger set to TIM 20 OC1, it will not sample. If ADC has its trigger set to TIM20 trigger, then things work as normal. TIM20 OC1 and trigger should be the same...but I guess not.

View solution in original post

1 REPLY 1
KHarb.1
Senior II

TIM20 is configured to have its trigger as OC1. If ADC has its trigger set to TIM 20 OC1, it will not sample. If ADC has its trigger set to TIM20 trigger, then things work as normal. TIM20 OC1 and trigger should be the same...but I guess not.