ΣSigmaStudio Ask AI Русский Log in

Re-Triggerable One Shot Needed

SigmaDSP & SigmaStudio ByronS Jun 26, 2013 00:00 7 replies Original on forum ↗
Subscribe
ByronS Question
Jun 26, 2013 00:00

My application involves the 1701. Thanks to other posts, I have a configuration that detects the audio level with an envelope detector and as long as the audio stays below a threshold, I output a logic 1. As soon as the audio goes beyond the threshold the logic output goes to 0 after the 'IsRMSthreshold' block. So far this works perfectly and I use this logic output to start a timer for 15 seconds. I need a tone brief tone burst to get added to my audio signal every 15 seconds that no source audio occurs. I have the timer circuit working to handle the 15 seconds detection and output a logic 1 after the 15 seconds transpires. The part I'm having problems with is turning this logic 1 from my timer output into a one shot enable signal for a brief 100-200 ms duration. The idea of the one shot is to control the duration of the tone burst added back to the audio stream.

Since this application requires continuous operation, so I also need a feedback loop to reset the 15 second timer and get it to start over. For this I'm thinking I could use the output of whatever one shot pulse generator, invert it to a logic zero and feed this back to one of the inputs of my AND gate. The main issue is coming up with the equivalent to a hardware 'retriggerable one shot timer'.

Any insight would be appreciated!

13e644e3407aaaa1d18cd0ba1e7a9232.jpg
13e644e3407aaaa1d18cd0ba1e7a9232.jpg
13e644e3407aaaa1d18cd0ba1e7a9232.jpg-450x220.jpg
13e644e3407aaaa1d18cd0ba1e7a9232.jpg-450x220.jpg
KJBob Reply
Jun 27, 2013 00:00

Hi Byron,

Two timers with feedback will do the trick. Please see the arrangement below:

The ABCD comparator does double duty as a threshold detector and AND gate. It breaks the feedback loop when beeps aren't needed. Otherwise, the two timers set up a 0.1 second beep with 14.9 seconds of silence (total 15 sec.).

Best regards,

Bob

1e005056f6025e99ed78d7a21285b056.jpg
1e005056f6025e99ed78d7a21285b056.jpg
1e005056f6025e99ed78d7a21285b056.jpg-534x253.jpg
1e005056f6025e99ed78d7a21285b056.jpg-534x253.jpg
ByronS Reply
Jun 27, 2013 00:00

Thanks Bob, it works great. One little issue that it took me a bit to find is that when you copy and paste projects, things like the Buffer' block does not maintain the original Bit position. Once I realized this and set it back to what you had, it worked fine.

The final piece to get this going completely will be to use an input GPIO as a means of enabling or starting the whole process. When the input goes high, I want this configuration to be active, but when it's low I want to disable the entire thing. Any thoughts where the best place to add an enable would be? I was thinking of an AND gate just before TIMER1 so that my GPIO would be one input, and the ABCD output would be the other. When the output of the AND is low, it would keep the timer in reset.

KJBob Reply
Jun 27, 2013 00:00

Hello Byron,

You're free to break the "reset and start over" path anywhere between the Timer2 output up to the ABCD output. Anything that passes this signal through when desired while forcing a zero when it isn't, will work.

Timers work in "28.0" format (when high, their inputs and outputs are a 1 in the LSB). AND gates work on 5.23 signals (a 1 at full audio level). If the AND gate doesn't work, try something that operates with 28.0 signals.

Bob

ByronS Reply
Jul 23, 2013 00:00

I have a very un-expected side effect to this project that I can't explain. The entire level detection and generation of a tone when no audio occurs on the main audio channel works great. The sense programming basically monitors the main channel. I find that if I don't connect my sense programming I get one signal level out from the 1701 on the main channel, but as soon as I connect the sense programming back up, my output level drops by 1/2. How is it possible that the progamming can introduce this kind of attenuation? I've made no other changes in hardware or programming so I'm convinced the effect is caused by the addition of the sense.

The main audio channel goes into two different linear gain blocks as well as into a running average block (part of sense programming) as shown below. Can a running average block load down the audio path similarly to the way an additional load can in hardware?

Please note I'm not using a signal merger block as shown above in this post since I don't have a balanced audio path that requires it. Is that the source of the issue?

906bcd0df7d81066c7ad7ad49b49d7d7.jpg
906bcd0df7d81066c7ad7ad49b49d7d7.jpg
906bcd0df7d81066c7ad7ad49b49d7d7.jpg-296x515.jpg
906bcd0df7d81066c7ad7ad49b49d7d7.jpg-296x515.jpg
KJBob Reply
Jul 24, 2013 00:00

Hi Byron,

As you expect, there's no loading effect inside a SigmaStudio signal flow. The T-connections are merely numerical equivalences set at link-time, so an output can "drive" many inputs without loss. Thus, the running average block won't load the signal to which it's connected. My example used the signal merger only to allow stereo in and out.

Of course this leaves unexplained the attenuation you're experiencing. I'm not sure from your post how (or, where) you're disconnecting and re-connecting the sense programming part of your circuit. If for example you're changing the connection at a hardware ADC input pin, note that the ADCs are current-sensing -- so each input needs its own resistor as shown below:

If your input circuit has only one resistor, connecting both input pins there splits the current between them. The result is 6dB less level.

Bob

7fe92998f0906ed7a7404f99525733c6.jpg
7fe92998f0906ed7a7404f99525733c6.jpg
7fe92998f0906ed7a7404f99525733c6.jpg-450x298.jpg
7fe92998f0906ed7a7404f99525733c6.jpg-450x298.jpg
ByronS Reply
Jul 24, 2013 00:00

Thanks Bob. Each input channel is independent from one another in my application each with there own input resistor. Running each side of a half duplex audio channel through each input both of which are ground referenced. For this example, I'm only usiing one side of the audio channel to sense audio or the lack there of, and send out a brief tone burst on the exact same channel when no audio level is detected. That aside, I'm simply comparing output levels from before I added the entire sense programming section to what I get after and measure the difference. I've been disconnecting the sense directly after the T connection.

There is likely something else simple that I'm over looking here. I'll update this post once I've looked into it further, but I wanted to get some preliminary indication from you if there was a simple explaination for what I'm seeing. Didn't think the loading thing was likely but it was the closest analogy I could think of to illustration the apparent effect I'm seeing.

Greatly appreciate the feedback!

ByronS Reply
Jul 25, 2013 00:00

Solution was very simple. I was using a Merger block to combine my tone burst with the main audio channel. Didn't realize it until looking closer at the definition of what it does, but it attenuates each channel to avoid additive effects causing clipping. In my case I never need both tone paths to be active at the same time so it's an either or situation meaning a simple summing block could be used.