Reading Audio Frequency
Keith Hilton
Posts: 150
·I hooked up the diagram on page 91 of Matt Gilliland's "The Microcontroller Application Cookbook #2" The diagram shows a
dynamic microphone feeding an audio signal to a LM324, with the
LM324 feeding a 74HC14 schmitt-trigger.· The output of the 74HC14 is then fed to a BS-2.· Instead of using a dynamic microphone feeding
an audio signal to the LM324,·I used a sign wave audio generator.
I got some really interesting results.· The frequency on the DEBUG screen was not the frequency value I was feeding in, it was way off.· As I
increased frequency from the audio generator, the DEBUG screen frequency decreased.· As I decreased frequency from the audio generator,the DEBUG screen frequency increased. Is this problem related to the 74HC14, because it inverts the signal?· When I got rid of the x=x*2 in the program, the frequency on the DEBUG screen was more like the frequency being put in by the audio generator.· I still had the increase and decrease reverse·problem. I hooked up a LCD display and it read the same as the DEBUG screen.· Here is the program:
'{$STAMP BS2}
x VAR word
here:
PULSIN 0,1,x
x=x*2
DEBUG ? x
Pause 1000
SEROUT 8, 16468, [noparse][[/noparse]254,1]
SEROUT 8, 16468, [noparse][[/noparse]DEC x, "HZ"
GOTO here
Wonder if a simple inverter would solve the increase decrease problem?
Wonder why the book had the x=x*2 when this simply doubled what the audio frequency generator said it was putting out?· The SEROUT's where not in the book, I just included them to check the DEBUG screen.· THE LCD read the same as the DEBUG screen. I am trying to make me a guitar tuner that displays frequency on the LCD screen.
Post Edited By Moderator (Jon Williams) : 12/9/2004 2:48:44 AM GMT
dynamic microphone feeding an audio signal to a LM324, with the
LM324 feeding a 74HC14 schmitt-trigger.· The output of the 74HC14 is then fed to a BS-2.· Instead of using a dynamic microphone feeding
an audio signal to the LM324,·I used a sign wave audio generator.
I got some really interesting results.· The frequency on the DEBUG screen was not the frequency value I was feeding in, it was way off.· As I
increased frequency from the audio generator, the DEBUG screen frequency decreased.· As I decreased frequency from the audio generator,the DEBUG screen frequency increased. Is this problem related to the 74HC14, because it inverts the signal?· When I got rid of the x=x*2 in the program, the frequency on the DEBUG screen was more like the frequency being put in by the audio generator.· I still had the increase and decrease reverse·problem. I hooked up a LCD display and it read the same as the DEBUG screen.· Here is the program:
'{$STAMP BS2}
x VAR word
here:
PULSIN 0,1,x
x=x*2
DEBUG ? x
Pause 1000
SEROUT 8, 16468, [noparse][[/noparse]254,1]
SEROUT 8, 16468, [noparse][[/noparse]DEC x, "HZ"
GOTO here
Wonder if a simple inverter would solve the increase decrease problem?
Wonder why the book had the x=x*2 when this simply doubled what the audio frequency generator said it was putting out?· The SEROUT's where not in the book, I just included them to check the DEBUG screen.· THE LCD read the same as the DEBUG screen. I am trying to make me a guitar tuner that displays frequency on the LCD screen.
Post Edited By Moderator (Jon Williams) : 12/9/2004 2:48:44 AM GMT
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
in frequency and time in the input signal. I will check out COUNT, and check back with you. Thanks!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office