cancel
Showing results for 
Search instead for 
Did you mean: 

inconsistent Calibrations values.

spa23
Associate III

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.

DAC_ADC.jpg

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.

4 REPLIES 4
spa23
Associate III

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(); 

Amel NASRI
ST Employee

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.

Part number : STM32H573IIKXQ

Amel NASRI
ST Employee

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:

  • make same check using another device?
  • share your IOC file to compare the configuration I used with yours?

- 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.