2025-02-22 03:43 PM
Hello
I am a little confused by the clock prescaler for the ADC.
I would like to run the 12 bit ADC at 75Mhz for the maximum sampling frequency. However, with a prescaler of 1 the value I get is stuck at 4095. Only if I were to put a prescaler of 2 for any ADC frequency would I get a proper output from the ADC but of course the sample rate is reduced.
It appears the maximum value I can have the ADC running at with the DAC is 125Mhz with a prescaler of 2, which is below 5msps.
What am I missing here?
2025-02-22 05:17 PM
What is the board or full chip number you are using? What pin are you using? Suspect it may not be a fast channel.
2025-02-22 06:17 PM
STM32H563ZIT6. This is the nucleo-144 evaluation board.
Im using both ADC1 IN0 and ADC2 IN3, both of which should be fast channels assuming I have read properly.
I wouldnt believe my issue would be affected by fast or slow channels. For example I set the ADC clock to 10Mhz or increased the sampling time with the same issue.
Attached is how I have configured the ADC + DMA:
My program essentially does this:
uint16_t adc_buff[ADC_BUFF];
int convcomplete=0;
int n=0;
...
HAL_ADC_Start_DMA(&hadc1, (uint32_t*)adc_buff, ADC_BUFF);
while(1){
if(convcomplete==1){
}
}
void HAL_ADC_ConvHalfCpltCallback(ADC_HandleTypeDef* hadc){
convcomplete=1;
}