![](templates/subSilver/images/CCSLogo.jpg) |
![CCS C Software and Maintenance Offers](templates/subSilver/images/forumAd6.jpg) |
View previous topic :: View next topic |
Author |
Message |
Dave_in_Dore Guest
|
Confusion with Sampling rate |
Posted: Wed Mar 11, 2009 8:37 am |
|
|
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](images/smiles/icon_razz.gif) |
|
![](templates/subSilver/images/spacer.gif) |
RLScott
Joined: 10 Jul 2007 Posts: 465
|
Re: Confusion with Sampling rate |
Posted: Wed Mar 11, 2009 8:57 am |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah Guest
|
|
Posted: Wed Mar 11, 2009 9:05 am |
|
|
It is the interval between the samples (250Hz).
Best Wishes |
|
![](templates/subSilver/images/spacer.gif) |
Dave_in_Dore Guest
|
Thanks |
Posted: Wed Mar 11, 2009 9:06 am |
|
|
Thanks Rob for clearing that up for me.
Best wishes
Dave |
|
![](templates/subSilver/images/spacer.gif) |
Dave_in_Dore Guest
|
|
Posted: Wed Mar 11, 2009 9:08 am |
|
|
And Ttlemah plus anyone else who replies.
Regards
Dave |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah Guest
|
|
Posted: Wed Mar 11, 2009 9:32 am |
|
|
The old problem of overlapped replies...
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... |
|
![](templates/subSilver/images/spacer.gif) |
|
|
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
|