2024-11-14 01:46 AM
Hi.. Can anyone tell me why the ADC Calibration value is not the same before and after I initialize the DAC
It seems that the value maxes out if I calibrate after I have initialized the DAC.
The calibration register is 7 bits.
The ADC also measures incorrectly if I calibrate the ADC after I have initialized the DAC.
Anyone have a good explanation?
thanks in advance.
2024-11-14 04:24 AM
The problem is that MX_DAC1_Init() sets up the Clock again even though PeriphCommonClock_Config() has set it up correctly.
When MX_DAC1_Init() it sets it up to use RCC_ADCDACCLKSOURCE_HCLK and that's wrong!!!!
so it seems as if there is an error in cubeMX when using both ADC and DAC at the same time.
Can be solved by removing : HAL_RCCEx_PeriphCLKConfig() in HAL_DAC_MspInit();
2024-11-14 05:13 AM
Hi @spa23 ,
Interesting case to check on our side.
Could you please precise the used part number?
-Amel
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-11-19 02:41 AM
Part number : STM32H573IIKXQ
2024-11-21 05:49 AM
Hi @spa23 ,
Back again to this topic.
I made some tests using STM32H563 and I'm getting the same calibration value before initializing DAC and after it.
I changed clock configurations without any impact.
I don't see clock set with RCC_ADCDACCLKSOURCE_HCLK on DAC initialization.
At this level, may you:
- Amel
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.