cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L4 - Comparator open drain and ADC TIM1_CC1 event triggering issues

masaulov
Associate
Posted on February 24, 2016 at 18:00

Hi,

I've tried to use comparator output in stm32l476 in open drain mode, but it doesn't work. According to reference manual (page 255) all alternative functions use same output driver and it should be possible to use comparator output in open drain mode. On the other hand, I've done some addition testing and it looks that comparator output is always push-pull. Could someone clarify this or provide link to documentation that clarifies it ?

One more issue that I had is ADC triggering by TIM1_CC1 - it doesn't work for me. I've changed it to TIM1_TRGO2 (that was configured as MMS2[3:0] - 0011: Compare pulse) and it worked right away. Any ideas why ADC triggering by TIM1_CC1 does not work ?

Thanks! 

Regards, 

Max.

#stm32l476
2 REPLIES 2
Posted on February 25, 2016 at 02:44

I'd expect the OC to work on COMPx_OUT too. Did you try on all COMPx_OUT pins? How exactly did you check whether it's OC or not?

I don't have first-hand experience with the 'L4 ADC, but from other families it appears that the description of ADC triggers is wrong and in fact it won't act upon a TIMx_CCy event as depicted on the timers' block diagram (i.e. which is generated from both capture and compare), rather, on the TIMx_OCy signal. It means, you need a changing output from the timer module, even if you don't assign it to a pin. In TIM1 (and TIM8 and other ''advanced'' timers) don't forget there's an additional twist with TIMx_BDTR.MOE.

JW

masaulov
Associate
Posted on February 25, 2016 at 13:02

Thanks for info.

I've used LED connected to comparator output and to gnd -  idea is that open drain output won't be able to turn it on without external pull up.

As for ADC triggering i thought about same thing right after I've wrote the post, but reference manual is pretty consistent about it.

Regards, 

Max.