Arduino-FreqPeriod-Due

hi friends

Are there any friend before used that library. its perfect one frequency counter but i need 2 counter anyone knows how can i count second frequency on other pin same time on Due? i search forum no topic about that. Thanks :roll_eyes:

To measure frequency and duty cycle of input signals, Timer Counters in Capture Mode is the way to go (see TC_CMR register page 881 Sam3x datasheet).

AFAIK, tc_lib library from antodom does just that, although I don't know if you can select 2 input capture pins at the same time with that library. Give it a try .....

i will check it thank you

Hi there @umutgemisi,

As ard_newbie has commented you can use library tc_lib just for measuring digital signals.

You can find tc_lib at: GitHub - antodom/tc_lib: This is a library to take advantage of different functionalities available on Timer Counter (TC) modules in Arduino Due's Atmel ATSAM3X8E microcontrollers

@HermannSW (thansk HermannSW) has already done some testing to know the limits of tc_lib. In this post you have a summary:

https://forum.arduino.cc/index.php?topic=393842.msg3086694#msg3086694

I think they can help you to have a better idea about tc_lib, they report measurements of signals with frequencies greater than 20Mhz.

As to if tc_lib can capture different signals in different pins simultaneously, it can, just have a look to the library's documentation.

I hope it helps.