Go Down

Topic: Arduino DUE 84Mhz counter (Read 3637 times) previous topic - next topic

jasperachtbaan

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?

Thanks in advance,

Jasper

PaulS

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.
The art of getting good answers lies in asking good questions.

jasperachtbaan

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

PaulS

Quote
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 art of getting good answers lies in asking good questions.

jasperachtbaan

The size of the counters is 32 bits.

Jasper

jasperachtbaan

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

pietkuip


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

MarkT

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.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Magician

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

MarkT

Its a property of sampled signals of any sort - video of quadcopter propellers shows this
for instance!
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Go Up