View previous topic :: View next topic |
Author |
Message |
kel
Joined: 17 Oct 2005 Posts: 68 Location: Brisbane
|
Simple Analogue problem |
Posted: Mon Feb 27, 2006 7:19 pm |
|
|
[url]C:\Documents and Settings\n4849892\Desktop\kel.gif[/url] |
|
|
sonicdeejay
Joined: 20 Dec 2005 Posts: 112
|
|
Posted: Mon Feb 27, 2006 7:36 pm |
|
|
Try uploading your picture @ www.tinypic.com or any image hosting first...so all of the ppl can see what you trying to show...
|
|
|
kel
Joined: 17 Oct 2005 Posts: 68 Location: Brisbane
|
sampling the waveform!! |
Posted: Tue Mar 07, 2006 6:48 am |
|
|
[url].[/url]
the waveform above has period of 60 ms.It's an acoustic waveform that has been passed through an integrator and then inverted.its amplitude decreases when an object is in water tank and returns back to its normal state when no object is in water tank.The decrease in amplitude is proportional to the object size.Larger object will larger amplitude decrease and viceversa.I have set set meaning that it will be sampling every 2us.Is this enough?can anyone help me how to use ADC to do this!
Any idea?
|
|
|
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
|
Posted: Tue Mar 07, 2006 7:53 am |
|
|
Does the PIC know when these cycles will happen? You want to take your samples just before to reset. If the PIC knows when that is and the flat top is fairly broad then this is easy.
If the integrator reset is unpredictable then you need to sample often enough to be sure to have one sample land on the flat top. Then loop through 60ms of samples and see if the new sample is the biggest you have seen. At the end of 60ms you will have the biggest sample in the set. _________________ The search for better is endless. Instead simply find very good and get the job done. |
|
|
treitmey
Joined: 23 Jan 2004 Posts: 1094 Location: Appleton,WI USA
|
|
Posted: Tue Mar 07, 2006 9:38 am |
|
|
I was thinking about a schmitt trigger and adjust the trigger level to detect high or low. |
|
|
kel
Joined: 17 Oct 2005 Posts: 68 Location: Brisbane
|
Thanks guys |
Posted: Wed Mar 08, 2006 9:09 pm |
|
|
The integrator reset is unpredictable thatz why i'm seeking for assistance.the question is how frequeen do i have to sample the signal?
|
|
|
Guest
|
Use a one shot. |
Posted: Thu Mar 09, 2006 1:51 am |
|
|
Feed that signal to a one shot that triggers on a rising edge. Make the one shot time 40 to 50 mSec. Use that falling edge as a H to L edge interrupt and then perform the A/D. You may have to tweak the time to account for any latencies in the convert time of the A/D.
There may be a way to use the internal comparitor, if it has one, to start a timer that performs the interrupt. |
|
|
|