This oscilloscope trace was obtained by first setting the STM32H743ZI (Nucleo) DAC to 0x00, then setting it to maximum value (4096) without any intermediate steps.
The output buffer was enabled.
As can be seen on the trace, the rise/fall time is approximately 1us
. No information about the clock speed etc is available for this example (Arduino on PlatformIO was used with standard settings). However, it does not appear that the rise/fall time is caused by the update rate. Setting the GPIO speed to maximum does not change the value.
This matches well with the datasheet-provided settling time of 1.7us(typ)
.
When disabling the output buffer, the result looks like this:
When, on the other hand, using the same pin as GPIO – using the exact same measurement setup (direct connection to BNC with 1M measurement impedance), the rise/fall time is almost zero.
Code example
// Function to initialize the DAC void MX_DAC_Init(void) { DAC_ChannelConfTypeDef sConfig = {0}; // Initialize DAC hdac.Instance = DAC1; if (HAL_DAC_Init(&hdac) != HAL_OK) { // Initialization Error __BKPT(); } // Configure DAC channel sConfig.DAC_Trigger = DAC_TRIGGER_NONE; // No trigger, free-running mode sConfig.DAC_OutputBuffer = DAC_OUTPUTBUFFER_ENABLE; if (HAL_DAC_ConfigChannel(&hdac, &sConfig, DAC_CHANNEL_1) != HAL_OK) { // Channel configuration Error __BKPT(); } // Enable DAC Channel and start the conversion if (HAL_DAC_Start(&hdac, DAC_CHANNEL_1) != HAL_OK) { // Starting Error __BKPT(); } }
The DAC value was set using
if (HAL_DAC_SetValue(&hdac, DAC_CHANNEL_1, DAC_ALIGN_12B_R, 4095) != HAL_OK) { // Setting DAC value Error __BKPT(); }