2023-05-06 06:33 AM - edited 2023-11-20 06:15 AM
Hi everyone!
I use 8 MHz external oscillator for my MCU. For TIM1 there is no prescaler in CUBE, so I expect this timer to tick with pure 8MHz frequency. And therefore I expect to see 0.125 us * 2 * 2 = 0.5 us period of signal. But actually I have 24 us period duration. What does slow down my DAC output? How can I achieve 0.5 us period for my pulse signal?
Thanks.
Solved! Go to Solution.
2023-05-06 09:23 AM
fast_delay() alone takes a couple of instrucions = couple of cycles to call, and then return from it.
But, more importantly Cube/HAL functions are bloated, so HAL_DAC_SetValue may easily execute hundreds of instructions until it gets to write the value to DAC register and return.
JW
2023-05-06 09:23 AM
fast_delay() alone takes a couple of instrucions = couple of cycles to call, and then return from it.
But, more importantly Cube/HAL functions are bloated, so HAL_DAC_SetValue may easily execute hundreds of instructions until it gets to write the value to DAC register and return.
JW
2023-05-07 06:45 AM
Thank you for the explanation
2023-05-07 06:59 AM
try simple test : comment / leave away the fast_delay(); lines.
then you see the speed/delay of the HAL_Dac-set.. timing .