Page 1 of 1

Stm32f103c8t6 pulses

Posted: Tue Feb 25, 2020 9:21 am
by nikjayswal
Need some idea or suggestion i want to read pulses fast as possible want to measure pulses upto 2MHz. The pulseIn/pulseInLong has limitions so it can not work greater than 100KHz.

Re: Stm32f103c8t6 pulses

Posted: Tue Feb 25, 2020 6:54 pm
by stas2z
im not sure it's possible with any core, but using HAL/CMSIS or in general as a concept it can be implemented using two timers
one timer in input capture mode capturing raising (or falling) edge, and second timer triggered by first timer overflow
target frequency will be timer2 count * timer 1 overflow value / time

Re: Stm32f103c8t6 pulses

Posted: Wed Feb 26, 2020 12:41 am
by ag123
if what you need is square waves, this logic analyzer on stm32f401 black pill goes up to 5mhz
viewtopic.php?f=10&t=116
and this logic analyzer that runs on stm32f103 (blue pill)
https://github.com/ddrown/stm32-sump
does 7 mhz
dma can normally handle square wave trains in the low mhz regions. apparently it is a challenge (possibly not achievable) to attempt high mhz transfers with simply gpio and dma. for even higher mhz than 5mhz, only specialised interfaces such as high speed ulpi 60mhz, ethernet 50mhz can do those

Re: Stm32f103c8t6 pulses

Posted: Wed Feb 26, 2020 6:15 pm
by nikjayswal
So had any ideas for frequency upto 200Khz or 300khz ? Without using or alternatively pulseIn/pulseInLong ?

Re: Stm32f103c8t6 pulses

Posted: Thu Feb 27, 2020 9:05 am
by stevestrong
You got 2 possible solutions.
Why don't you like them?