0
Offline
Newbie
Karma: 0
Posts: 16
Arduino rocks
|
 |
« on: June 07, 2010, 08:01:25 am » |
Hi. Simple Q  What is the highest Hz the Arduino can give with the tone() function? Thanks.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 16
Arduino rocks
|
 |
« Reply #1 on: June 07, 2010, 06:47:03 pm » |
No buddy knows?
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 2
Arduino rocks
|
 |
« Reply #2 on: June 07, 2010, 08:23:35 pm » |
why not google it ? 
|
|
|
|
|
Logged
|
|
|
|
|
Toronto, ON
Offline
Full Member
Karma: 9
Posts: 233
|
 |
« Reply #3 on: June 08, 2010, 01:00:20 am » |
Since tone() only accepts a frequency value as an unsigned int, the maximum frequency you can ask for is 65535 Hz (technically, you'll get 65573.77 Hz) - well beyond what the human ear can perceive.
b
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 16
Arduino rocks
|
 |
« Reply #4 on: June 08, 2010, 02:03:56 am » |
Are you sure about it?
the Arduino clock is much faster and it you can get higher frequency only buy writing HIGH, delaymicro, LOW, delay...
I tried it yesterday with X as frequency and a analogRead to control the X.
I gut up to over 100000Hz.
Then I tried 20Mhz, I wrote 20000000, witch is the Arduin Duemilanove clock.
It worked, but I am not sure at witch frequency...
The way I chekt it was plugging the output to antenna and trying to read volt that is crated on a diode witch is grounded from one side and connected to other antenna on the other side
Are you sure in what you are saying? , Or did I do some thing wrong?
|
|
|
|
|
Logged
|
|
|
|
|
Manchester (England England)
Offline
Brattain Member
Karma: 277
Posts: 25506
Solder is electric glue
|
 |
« Reply #5 on: June 08, 2010, 03:11:30 am » |
The way I chekt it was plugging the output to antenna and trying to read volt that is crated on a diode witch is grounded from one side and connected to other antenna on the other side That doesn't measure the output frequency only that something is being produced. With a 16MHz clock I would be surprised if you could get any signal greater than 1MHz out of it. However, tone is written for audio outputs so there is little point pushing it over the audio range.
|
|
|
|
|
Logged
|
|
|
|
|
UK
Offline
Faraday Member
Karma: 15
Posts: 2852
Gorm deficient
|
 |
« Reply #6 on: June 08, 2010, 03:33:32 am » |
Are you sure about it? How much more sure than: void tone(uint8_t _pin, unsigned int frequency, unsigned long duration) can you be?
|
|
|
|
|
Logged
|
Per Arduino ad Astra
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 16
Arduino rocks
|
 |
« Reply #7 on: June 08, 2010, 08:50:06 am » |
Maybe we can just start a witch hunt...
So it is coz of the int the is in the tone(), witch define the Hz, that can go over 60000...
Ok thanks.
|
|
|
|
|
Logged
|
|
|
|
|
Manchester (England England)
Offline
Brattain Member
Karma: 277
Posts: 25506
Solder is electric glue
|
 |
« Reply #8 on: June 08, 2010, 09:14:18 am » |
witch define the Hz, that can go over 60000. which [size=16]can't[/size] go over 60000
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 16
Arduino rocks
|
 |
« Reply #9 on: June 08, 2010, 09:44:08 am » |
Opss... that the "t" is MISSING!!!!
Sorry dude... having a bad day or some thing?
|
|
|
|
|
Logged
|
|
|
|
|
Toronto, ON
Offline
Full Member
Karma: 9
Posts: 233
|
 |
« Reply #10 on: June 08, 2010, 03:28:50 pm » |
That's Grumpy Mike... By definition, he's ALWAYS having a bad day! *SMOOCHES for Grumpy Mike*
So, yes, the limitation on the maximum frequency is because of the variable's value range.
If you modified tone() to accept frequency as unsigned long, it could produce signals as high as 8 MHz (on a 16 MHz part).
b
FYI, I'm sure, because I wrote the Tone library.
|
|
|
|
« Last Edit: June 08, 2010, 03:29:27 pm by bhagman »
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 16
Arduino rocks
|
 |
« Reply #11 on: June 09, 2010, 03:26:10 am » |
Thanks, and sorry Grumpy Mike...
Can one do what you just said, modified tone()?
|
|
|
|
|
Logged
|
|
|
|
|
Toronto, ON
Offline
Full Member
Karma: 9
Posts: 233
|
 |
« Reply #12 on: June 09, 2010, 06:29:00 am » |
What do you need to do exactly? There is probably a much easier solution.
b
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 16
Arduino rocks
|
 |
« Reply #13 on: June 09, 2010, 04:09:26 pm » |
I was thinking to use it to make some weak, easy to control, radio signal.
If I use the pin HIGH, delay, pin LOW, delay.
I get a problem, that what ever I write on the program will change the signal, that why I was thinking about using tone()
What do you think? :-?
|
|
|
|
|
Logged
|
|
|
|
|
Manchester (England England)
Offline
Brattain Member
Karma: 277
Posts: 25506
Solder is electric glue
|
 |
« Reply #14 on: June 10, 2010, 02:32:38 am » |
I think you better look up the law in your country about radio transmitters. I think you will find that what you want to do is illegal.
|
|
|
|
|
Logged
|
|
|
|
|
|