Skip to main content
JuM
Senior
Sep 18, 2019 5:29 AM UTC
Solved

STM32G0 DAC ADC TIM2

Using TIM2_TRGO to trigger DAC. That works.

​Now want same TIM2_TRGO also to trigger ADC.

Is that possible ?

Regards Juergen

This topic has been closed for replies.
JuM
JuMBest answer
Senior
Sep 18, 2019 11:31 AM UTC

​One has to set ADSTART bit, no matter if software triggered or hardware triggered...

Depending on the EXTEN [1:0] configuration bits, a conversion either starts immediately (software trigger configuration) or once a hardware trigger event occurs (hardware trigger configuration).

Sorry for bothering...

Regards Juergen

3 replies

JuM
JuMAuthor
Senior
Sep 18, 2019 9:50 AM UTC

​Still no TIM2 trigger of ADC.

DAC is running ok: TIM2 is running and triggers the DAC. DAC requests DMA and finally generates a sine wave of 200 Hz.

ADC in standstill with calibration value in DR. No trigger0690X00000ARKQeQAP.jpg

Any idea regarding ADC triggering ?

Regards Juergen

Ozone
Principal
Sep 18, 2019 9:57 AM UTC

Not sure about the G0 variant.

But be careful with the debugger. Live-watching certain peripherals registers will clear associated interrupt flags, and alter the program flow.

JuM
JuMAuthorBest answer
Senior
Sep 18, 2019 11:31 AM UTC

​One has to set ADSTART bit, no matter if software triggered or hardware triggered...

Depending on the EXTEN [1:0] configuration bits, a conversion either starts immediately (software trigger configuration) or once a hardware trigger event occurs (hardware trigger configuration).

Sorry for bothering...

Regards Juergen