Skip to main content
spa23
Associate III
November 14, 2024
Question

inconsistent Calibrations values.

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.

This topic has been closed for replies.

4 replies

spa23
spa23Author
Associate III
November 14, 2024

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 Technical Moderator
November 14, 2024

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 "Best Answer" on the reply which solved your issue or answered your question.
spa23
spa23Author
Associate III
November 19, 2024

Part number : STM32H573IIKXQ

Amel NASRI
ST Technical Moderator
November 21, 2024

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 "Best Answer" on the reply which solved your issue or answered your question.