2021-12-21 05:40 PM
Hi, I used STM32F429ZI
I want to check the output of DAC channel 1 and DAC channel 2.
But, the output of DAC channel 1 and DAC channel 2 were different.
HAL_DAC_SetValue( &hdac, DAC_CHANNEL_1, DAC_ALIGN_12B_R, 0 )
HAL_DAC_SetValue( &hdac, DAC_CHANNEL_2, DAC_ALIGN_12B_R, 0 )
I measured the voltage DAC channel 1 and DAC channel 2, the values were different.
DAC channel 1 => 2.1V
DAC channel 2 => 0V
Could you tell me what the problem is?
2021-12-21 05:58 PM
Custom board or known hardware? How is the pin connected? You haven't shown any initialization, so problem could be there as well.
2021-12-21 06:16 PM
Hi, I used 23F429IDISCOVERY kit.
I connected PA4 pin and GND and measured the DAC channel 1 voltage.
PA5 pin and GNC and measured the DAC channel 2 voltage.
Here is my main code.
/* USER CODE BEGIN 2 */
HAL_DAC_Start( &hdac, DAC_CHANNEL_1);
HAL_DAC_Start( &hdac, DAC_CHANNEL_2);
/* USER CODE END 2 */
/* Infinite loop */
/* USER CODE BEGIN WHITE */
while( 1 )
{
/* USER CODE END WHILE */
/* USER CODE BEGINE 3 */
HAL_DAC_SetValue( &hdac, DAC_CHANNEL_1, DAC_ALIGN_12B_R, 0 )
HAL_DAC_SetValue( &hdac, DAC_CHANNEL_2, DAC_ALIGN_12B_R, 0 )
}
/* USER CODE END 3 */
2021-12-21 06:40 PM
Discovery kit with STM32F429ZI MCU - User manual
As TDK pointed out, probably PA4 is connected to LCD screen VSYNC:
2021-12-21 07:04 PM
Hi, the datasheet PA4 pin is DAC_OUT1.
2021-12-21 07:14 PM
It is DAC_OUT1. However, it's already connected to something on that board (VSYNC) which is driving that pin. When two things drive a pin, only one of them can win. In this case, looks like VSYNC is winning.
2021-12-21 07:46 PM
You have several options:
2021-12-21 08:25 PM
Thank you.
2021-12-21 08:25 PM
Thank you