CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Simple Analogue problem

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
kel



Joined: 17 Oct 2005
Posts: 68
Location: Brisbane

View user's profile Send private message

Simple Analogue problem
PostPosted: Mon Feb 27, 2006 7:19 pm     Reply with quote

[url]C:\Documents and Settings\n4849892\Desktop\kel.gif[/url]
sonicdeejay



Joined: 20 Dec 2005
Posts: 112

View user's profile Send private message

PostPosted: Mon Feb 27, 2006 7:36 pm     Reply with quote

Try uploading your picture @ www.tinypic.com or any image hosting first...so all of the ppl can see what you trying to show...

Smile
kel



Joined: 17 Oct 2005
Posts: 68
Location: Brisbane

View user's profile Send private message

sampling the waveform!!
PostPosted: Tue Mar 07, 2006 6:48 am     Reply with quote

[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
Code:
DIV_32 which
meaning that it will be sampling every 2us.Is this enough?can anyone help me how to use ADC to do this!
Any idea?
Twisted Evil
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Tue Mar 07, 2006 7:53 am     Reply with quote

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

View user's profile Send private message Visit poster's website

PostPosted: Tue Mar 07, 2006 9:38 am     Reply with quote

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

View user's profile Send private message

Thanks guys
PostPosted: Wed Mar 08, 2006 9:09 pm     Reply with quote

The integrator reset is unpredictable thatz why i'm seeking for assistance.the question is how frequeen do i have to sample the signal?
Surprised
Guest








Use a one shot.
PostPosted: Thu Mar 09, 2006 1:51 am     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group