cancel
Showing results for 
Search instead for 
Did you mean: 

CubeMX4.18 STM32L011D4 Input Capture triggered from Comparator event

George.P
Associate III
Posted on December 13, 2016 at 09:44

Hello,

How can I set up the Input Capture peripheral to be triggered by the Comparator event?

I've set COMP1[+] on PA1 and [-] from Vref. Without being sure I've configured the COMP1 trigger mode to event mode on both edges. 

In the comparator's HAL file the comments mention that 'Comparators output to timers is set in timers instances', but I haven't been able to find a relevant option.

My goal is to measure the time between each voltage threshold edge on PA1 vs Vref.

Thanks in advance for any advice!

#stm32l011 #comparator #input-capture #cubemx
4 REPLIES 4
Oliver Beirne
Senior
Posted on December 13, 2016 at 16:21

Hi

Pikoulis.George

I have moved this post to the

https://community.st.com/community/stm32-community/stm32-forum?sr=search&ampsearchId=1f075d14-1117-4f25-85a1-96ea3fb8cda9&ampsearchIndex=0

where product related questions are posted.

Thanks

Oli

Posted on December 13, 2016 at 19:14

Look into RM0377, the timers' chapters' registers subchapter contains (at its end) Option Registers (TIMx_OR) for individual timers. That's where the comparators' outputs can be redirected to timers' inputs.

I don't CubeMX, sorry.

JW

Posted on December 14, 2016 at 07:17

Thank you Oli!

I thought I had posted in the MCU forum but I was wrong.

Posted on December 14, 2016 at 07:26

Thank you Jan, 

I'll test the remap bits and see what's happening!