# Arduino DUE 84Mhz counter

Hello,

I am looking for a way to increment the arduino DUE's counter with 84 Mhz. In the datasheet, the highest speed you can select is 42 Mhz (MCK/2). Could anyone help me with this?

Jasper

How are you going to do anything more than increment a counter at more than 1/2 the clock speed? How many instructions does it actually take to increment the counter? If it takes more than one, the only way to increment faster is to increment by more than one each time.

Hello,

It takes one pulse to incrment a counter. With the atmega328p you can increment the counter at the same rate as the clock. It wouldn't make sense to increment the counter more than one per cycle, because then you don't add any precision to the timer. I am using this for high-precision time measurement.

Jasper

With the atmega328p you can increment the counter at the same rate as the clock.

What size is the counter? What size is it on the Due?

The size of the counters is 32 bits.

Jasper

The size of the counters on the 328p is by the way 16- or 8 bits

One can use SysTick: http://www.zembedded.com/cortex-m3-systick-explained-part-ii/

Interesting thing, arduino Due could count pulses with freq. 44-82 MHz, but result is "mirrored" or inverted. Results = 84 - Fr.input
http://coolarduino.blogspot.ca/2015/06/frequency-counter-for-arduino-due.html

Magician:
Interesting thing, arduino Due could count pulses with freq. 44-82 MHz, but result is "mirrored" or inverted. Results = 84 - Fr.input
http://coolarduino.blogspot.ca/2015/06/frequency-counter-for-arduino-due.html

Yes, its called aliasing. If you sample a logic signal at 42MHz then 43MHz will look the same as 41MHz, etc.

Right, before I thought only ADC has an aliasing. It makes freq. counter 1-bit ADC. Works also higher than 86, I was able to test up to 116 MHz, results Fr. = Input - 84.0
I will check if it could read < 160, if I configure my Si5351 properly

Its a property of sampled signals of any sort - video of quadcopter propellers shows this
for instance!