Skip to main content
Nick-
Associate II
March 15, 2022
Question

DAC TEN and SWTRIG

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

This topic has been closed for replies.

1 reply

TDK
March 15, 2022

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.

"If you feel a post has answered your question, please click ""Accept as Solution""."