2022-03-15 08:33 AM
Hi everyone, I'm experimenting the DAC features with my STM32F303RE and I have a dubt. .
RM says: "If the software trigger is selected, the conversion starts once the SWTRIG bit is set".
Now, if I only set the DAC_DHRx and the EN bit, the DAC works properly.
But if i also set:
DAC1->CR |= DAC_CR_TEN1;
DAC1->CR |= (0b111<<3); //software trigger
without setting the SWTRIGR bit, the DAC still works..... Why? Once i set the "software trigger", shouldn't the output remain disable until I set the SWTRIGR?
Thanks in advice
2022-03-15 09:05 AM
If there is an instant where EN=1, TEN=0, the DAC will convert. You're doing modifications in steps rather than all at once, so this condition exists temporarily. That's my guess.
Would be good to see entire code rather than a snippet.