Newsgroups: comp.robotics
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!howland.reston.ans.net!cs.utexas.edu!news.ti.com!mksol.dseg.ti.com!sqanc.dseg.ti.com!cramer
From: cramer@dseg.ti.com (Norm Cramer)
Subject: Re: Interfacing a microphone to an 8051 INT1
Message-ID: <cramer.11.000CE0B5@dseg.ti.com>
Lines: 40
Sender: usenet@mksol.dseg.ti.com (Usenet News (MKSOL))
Nntp-Posting-Host: sqanc.dseg.ti.com
Organization: Texas Instruments 
X-Newsreader: Trumpet for Windows [Version 1.0 Rev A]
References:  <3flkup$2eu@zariz.orbotech.co.il>
Date: Thu, 19 Jan 1995 18:52:34 GMT

In article <3flkup$2eu@zariz.orbotech.co.il> gilad@Orbotech.Co.IL (Gilad) writes:
>Subject: Interfacing a microphone to an 8051 INT1
>From: gilad@Orbotech.Co.IL (Gilad)
>Date: 19 Jan 1995 12:12:09 GMT

>I am not sure this is the right group to post the following since it is not diretly
>related to robots. However it seems to me that there are many hardware oriented people
>here and as you will see what I am looking for may be used in robotic applications. I
> posted the following at comp.hardware.homebuilt several days ago but go no answer.
>I am building a device that will be used to time shots in practical shooting training.
>It is based on an 80c31. I want the shots to be picked up by a microphone that will
>be connected to the INT1 pin of the 8051 which will trigger an interrupt rooutine
>that will record the shot time of occurance.
>As usual, when analog meets digital there are some problems.
>First the microphone is amplified by an op-amp. It will use a positive supply only so
>the resulting signal will ride between 0-5vdc.
>Now comes the problem - if the signal is fed directly to the INT1 pin there will be
>multiple transitions causing pultiple INT requests for each shot (I want only one).
>Possible solutions:
>Software only - the first transition will trigger the interrupt routine which will
>disable further interrupts from INT1 as it's first command. It will then do what it
> should do and wait until the shot duration has passed before it enables the
>interrupts again and returns.
>Hardware - feed the signal to a 555 configured as a monostable with a pulse duration
>longer than the shot signal, which will ensure one trigger per shot.
>Anybody has remarks, or other suggestions?

>TIA,
>Giald Barak - Israel
>gilad@orbotech.co.il

My vote is for the software solution.  The software timing is easier to change 
and probably more accurate than the 555 timer.  

Are you configuring the OP AMP as a comparator or is the audio output of the 
mic just being amplified?  I would recommend a comparator that can be set to 
trigger only on the gun shots.

Norm

