I want to use the DAC peripheral on my stm32L073RZT to play a waveform at a given sampling frequency, 8KHz in my case.
I'm trying to set a timer to set a value on the dac peripheral but im struggling with the configuration.
uwPrescalerValue = (uint32_t)(SystemCoreClock / 8000) - 1;
SystemCoreClock is at 32MHz
TimHandle.Init.Period = 0;
TimHandle.Init.Prescaler = uwPrescalerValue;
TimHandle.Init.ClockDivision = 0;
TimHandle.Init.CounterMode = TIM_COUNTERMODE_UP;
Am i doing something wrong? I used Period = 0 to enter the callback at a frequency of 8KHz, is this design correct?
Thank you for your help!