Arduino "Tone" command and the ATmega8 - it just won't work
July 13, 2010
Recently Frits pointed out that sound was used much with robots on this site. I agree and am trying to add sound to a miniature bi-ped robot I am designing. I am now using an ATmega8A processor set up as an Arduino and recently tried using the tone command with strange results. I only get a few frequencies. The digital oscilloscope shows that I am only getting 5 frequencies which I guess change when the timers prescaler is changed. These frequencies are:
61Hz, 244Hz, 976Hz, 3.9KHz and 31.2KHz
The code was just a blank sketch with the tone command in the setup function. This works fine with when I use an ATmega168. I have searched the internet and tried using one of the older versions of the Tone library as well as the version built into Arduino 0018. Still no luck.
Has anyone had this problem before? If someone has an old Arduino with an ATmega8 could they test the tone command? According to all the information I found the tone library version 4 and later should work with the ATmega8.