cancel
Showing results for 
Search instead for 
Did you mean: 

DAC TEN and SWTRIG

Nick-
Associate II

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

1 REPLY 1
TDK
Guru

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".