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

Confusion with Sampling rate

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







Confusion with Sampling rate
PostPosted: Wed Mar 11, 2009 8:37 am     Reply with quote

Hi,
PCH Ver 4.073

hoping someone can help me out here.
I am using an 18f4431 with CAP1 input set to trigger on falling edge, which triggers TMR5 in one shot mode to produce a delay, which triggers the on board A/D module, also one shot mode, reason I am doing it like this is once the hardware modules are setup and the A/D Interrupt enabled and the various Tris Reg's set accordingly in the main(), code is just a nop in a while(1) loop so no software to slow things down it just chugs merrily away leaving any code that I will write in main() to display or process the data as I see fit. The frequency input is 250Hz fed into CAP1 (RA2) and AN0 (for A/D), now I have tested this with ICD2, and it works fine with sine/square/triangle wave input, and the resultant data captured in a buffer then exported into Excel to observe the recorded waveforms. Now my confusion is this, when talking about sampling rate and Nyquist theorem for designing a low pass filter to go in front of the A/D, is the sampling rate I use my 250Hz or is it the internal sampling rate of the A/D module when triggered?
Thanks in advance
Dave Razz
RLScott



Joined: 10 Jul 2007
Posts: 465

View user's profile Send private message

Re: Confusion with Sampling rate
PostPosted: Wed Mar 11, 2009 8:57 am     Reply with quote

Dave_in_Dore wrote:
Hi,
...when talking about sampling rate and Nyquist theorem for designing a low pass filter to go in front of the A/D, is the sampling rate I use my 250Hz or is it the internal sampling rate of the A/D module when triggered?

It is the 250 Hz, which if I understand you correctly, is the frequency with which A/D samples are taken. The speed with which the A/D does each conversion does not enter into it.
_________________
Robert Scott
Real-Time Specialties
Embedded Systems Consulting
Ttelmah
Guest







PostPosted: Wed Mar 11, 2009 9:05 am     Reply with quote

It is the interval between the samples (250Hz).

Best Wishes
Dave_in_Dore
Guest







Thanks
PostPosted: Wed Mar 11, 2009 9:06 am     Reply with quote

Thanks Rob for clearing that up for me.
Best wishes
Dave
Dave_in_Dore
Guest







PostPosted: Wed Mar 11, 2009 9:08 am     Reply with quote

And Ttlemah plus anyone else who replies.
Regards
Dave
Ttelmah
Guest







PostPosted: Wed Mar 11, 2009 9:32 am     Reply with quote

The old problem of overlapped replies... Smile

The actual time taken to sample, does have some secondary effects, but _not_ if you are filtering the signal well. You can get 'aliasing' effects at high frequencies generated by multiples of the actual reading time, and also you will get some slight high frequency filtration, when the input is connected to the ADC capacitor, during the 'acquire' phase, betfore the actual sampling. However these are all at high frequencies, and if you are filtering well, won't enter things at all...
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