What is Sampling Frequency ?

Status
Not open for further replies.

kseng2002

Member level 2
Joined
Aug 27, 2004
Messages
51
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
Malaysia
Activity points
467
Hi,

Can any1 tell me what is sampling frequency for ADC ? How to determine the sampling freqeuncy for the ADC in PIC16F73? Please advice ! Thx !
 

Hi,
Sampling frequency is the rate of sampling(reading) analog input with an ADC, in a secod.
 

Hi kseng2002,

The sampling frequency (also known as sampling rate) is how many samples you take in one second.

First, you need to read the datasheet sections - Section 21 in the "PIC Micro Mid-Range Family Reference Manual (DS33023)" downloadable from Microchip.

Now, to explain that stuff: The sampling rate depends on:

(1) How long the analogue circuit takes to settle
(2) How long the AD converter takes to make a reading
(3) How often you can take that reading with your code.

The parameter Tacq is the amount of time needed for the analogue circuit to settle. Tacq is calculated like this:

Tacq = Tamp + Tc + Tcoff

where

Tamp is the settling time of the amplifier
Tc is the time taken to charge the holding capacitor
Tcoff is the temperature coefficient (only needed if >25 Celcius)

The datasheets shows how to get values for these from its internal circuit diagram on page 21-6 and 21-7.

In their example, the Acquisition Time, Tacq, comes out at nearly 12 us.

Next comes the actual AD conversion. Read page 21-8 onwards. The AD clock is a division of the system clock, as shown in table 21.1.

The time of conversion per bit is defined as Tad, and a complete conversion (so you can then read the register) is 9.5 x Tad. Tad must be at least 1.6 us for a proper conversion on standard devices, this is why you must set the clock division depending on the system clock. The table 21.1 shows acceptable values (unshaded). If you are using a system clock other than those given you will have to choose a divisor (2,8,32) setting that gives 1.6 us or longer for Tad.

Now, having got the Tad value, we can work out how long it takes the ADC to convert the full byte. It's just 9.5 x Tad.

So now we have the full time needed to convert one reading:

Conversion Time = Tacq + (9.5 x Tad)

If you have set the system clock and divisor to give the minimum 1.6 us Tad, are using 5V supply and at 50 Celcius like their example on page 21-6, the total conversion time will be:

Conversion Time = 12us + (9.5 x 1.6us) = 27.2 us

This then is the fastest you can go, giving maximum sample rate of 1/0.0000272 = 36764 Samples per Second.

The rest depends on how often your code can actually take and use this value. That's up to you!

Hope this helps,
FoxyRick.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…