Hi eveybody!
I want to measure frequency up to 200KHz by arduino due but I don't know what am I doing now! I wrote some programs but anything doesn't respond.Do you know how I can measure high frequencies?
please help me! ![]()
I'm just getting started with measuring & modulating frequencies as well, but not quite at that speed.
Do you have the requisite hardware setup for massaging the signal into a range that will be appropriate for the analog inputs? You need to make sure you aren't sending it more than 3.3V!
I've been checking out these libraries for doing fast fourier transform:
https://code.google.com/p/arduino-integer-fft/
http://wiki.openmusiclabs.com/wiki/ArduinoFFT
and a library for a similar, but simpler analysis called fast hartley transform:
Both transform the time domain input into the frequency domain.
If your input is regular and very sinusoidal you could do it do it a lot simpler.
Normally this would be a job for the FreqCount library. Unfortunately, nobody's ever ported it to Due (and contributed the code).
I can't understand, The sample rate of ardino due is 1MHz so it can measure frequency up to 400KHz (based on Nyquist rate). but we can't do it simply.The below link is can up to 50KHz
https://github.com/enternoescape/Arduino-FreqPeriod-Due
Does arduino due need a set for measuring?
please help me!
Thank you so much dgbillotte! but how do I use it for measuring frequency?
Hang on, are we talking analog or digital signals here? For digital signals there will be
some timer settings for doing this, for analog forget 1MHz unless you are going to
program a DMA channel to scoop up the output. FFT is good for spectral analysis, not
measuring a single frequency, and the Due doesn't have floating point hardware so don't
expect miracles!
A low cost binary counter IC could help. For example using Q14 on the SN74HC4020 could slow the interrupt rate down to just over 12 per second @ 200kHz and give good timing resolution. You could probably be able to measure frequency accurately up to 5MHz with this. Could connect another output, i.e. Q4 for low frequency measurements.
we are talking about analog signals.
We're apparently talking about mysterious, undefined analog signals.
Do you really expect useful help with so little info given about what you're trying to accomplish?
I take my signal from signal generator and this signal is given to analog pin, and I want to measure the frequency's signal by board. It's not strange Paul!
Well, your easiest path would be to run that signals into a voltage comparator or some other circuit to turn it into a digital signal. That works great if the "analog" signal doesn't have a lot of other non-harmonic content (eg, trying to detect a single tone embedded inside complex music or speech). If it's just a pure waveform at the frequency (plus harmonics if it's not a sine wave), you can pretty easily turn it into a digital signal at the same frequency, because there isn't other stuff present at other frequencies.
When it's a digital signal, you can count the pulses. On other boards, you could use the FreqCount library. On Due, maybe you could do something similar with the timers, or just use attachInterrupt and increment a variable, and of course check how much it's incremented after 1 second.
Thank you so much
dgbillotte, Paul stoffregen, Market, dlloyd! ![]()
your help is so useful for me! ![]()
I have a another question? Can I write a simple program in Keil then I donwload the code on the arduino board?
Hi everybody!
I can measuring frequency up to 200KHz by timer in arduino due. I also write a program that measure
amplitude up to 3.3V then I mixed these two program and show the amplitude & frequency on LCD.
now I have a problem. when I reduce the amplitude (under 1V) the LCD show high frequencies (100-200KHz)
incorrect. what am I doing now (without using comparator)
please help me:)
Thanks.
If we could see your code, there might be some chance of figuring out what's wrong.
But then we would have to know a lot more about your input signal and the analog front end you have. If you are not willing to share this information then the forum can't help.
This is my code:
FreqPeriodDue.cpp (1.59 KB)
FreqPeriodDue.h (886 Bytes)
Frequency_with_amplitude_by_LCD.ino (1.23 KB)
Briefly looking through your code, your approach is better for measuring a period. No wander you have an error, that 'd only rise up at higher range. Check this blog: http://coolarduino.blogspot.ca/2015/06/frequency-counter-for-arduino-due.html
Thank you Magician
but when i was compile this code show this error:
New_arduino_due_frequency_measurement.ino: In function 'void Atmr_setup()':
New_arduino_due_frequency_measurement.ino:60:14: error: 'TMR_CNTR' was not declared in this scope
why?
You should download an arduino sketch via link at the end, code posted on a web is reduced / simplified for presentation
Thank you! ![]()
Is this program measuring amplitude?
I see to connect digital 2 pin to analog 7 pin?