cancel
Showing results for 
Search instead for 
Did you mean: 

[STM32F303CCx][Bare Metal] Connecting the MCU's comparators to capture-channels of timers. Do I need to configure the timers as well?

Stefan Waldmann
Associate

Hello!

I try to follow the reference manual to connect the internal comparators to the timer. Is setting the output-selection register of the comparators all there is to do (read at chapter interconnection-matrix and chapter comparators)? I feel like I have to tell the timers that their input will come from the comparators (e.g. input capture or break-input), but I cannot find any reference to it.

I haven't finalised the PCB yet, as I'ld like to determine what is possible with the MCU first, so I cannot just try it and see what happens.

Thank you for your time :)

1 REPLY 1

For such experiments it's always handy to have a "known good" board at hand, a cheap DISCO or Nucleo.

I don't use the 'F3 but it may well be that the signals from comparators are simply ORed with the signals coming from the GPIO/AF fabric (which is 0 if no pin is chosen for the given timer channel), before they enter the timer. This is confirmed (sort of randomly) by a remark in Using the break function subchapter of the advanced TIM chapter in RM0316:

The resulting signal on BRK2 is an OR between the external signal on the BKIN2 pin and

the comparator output (if selected as BRK2 event source).

Yes this is an information which could be written clearly and the Interconnections chapter is the right place for it.

JW