cancel
Showing results for 
Search instead for 
Did you mean: 

Can I use a pin as both ETR for a counter/timer and EXTI for same signal?

PSolw.1
Associate II

I'm working with CubeIDE and Blue Pill boards.

I need to frequency count an external intermittant signal at about 4MHz. To do this I need to catch the start of the signal and do my 1ms count period as quickly as possible.

I can't see a way to do this in MX but I'm a newbie and probably missing something.

Any help appreciated.

1 REPLY 1

> Can I use a pin as both ETR for a counter/timer and EXTI for same signal?

Yes. EXTI works directly out of the digital input buffer, regardless of whether the pin is set as digital input or input to the timer.

> I can't see a way to do this in MX

Then don't do it in CubeMX. CubeMX inevitably supports only a selected fraction of possible functionality of the mcu, the "most usual" functions.

Read the Reference Manual and do it in registers. There's plenty of threads here dealing with using EXTI alongside other functionality, search.

Also note, that bluepills lately come with counterfeighted parts (i.e. non-ST parts, even if there is a fake ST marking on them), so they might not work as the ST manuals say. Get a genuine ST board or a genuine ST part from renown distributors if you want functionality described in ST manuals.

JW