Discussion in 'General Electronics Chat' started by mik3, Mar 2, 2009.

1. ### mik3 Thread Starter Senior Member

Feb 4, 2008
4,846
63
Hello guys,

Does anyone knows what is the maximum sampling frequency for an analog port of a PIC uC working at 8MHz?

I am using PIC18F2550 and I want to sample a 10KHz sinewave as to calculate its average.
From the datasheet of the uC I calculated that the maximum achievable sampling rate is about 85KHz. This value is too low for my needs.

Am i correct in my calculation or I misunderstood something?

2. ### russ_hensel Distinguished Member

Jan 11, 2009
820
47
Not sure, but does not sound too far off to me. If you just want the average why not do that in an analog circuit?

3. ### mik3 Thread Starter Senior Member

Feb 4, 2008
4,846
63
My bright ideas to reduce components

4. ### ElVale New Member

Mar 3, 2009
2
0
Why is 85KHz not enough for a 10 KHz signal? anyway you have to check out the adquisition time in the datasheet at the A/D conversion requirements table. If I'm not wrong, maximum sampling frequency posible is about 130KHz.

5. ### jut Senior Member

Aug 25, 2007
224
2
I see you're using a USB PIC. I ventured there before, but got scared and went back to RS232. Have you got the USB communications working?

In table 28-29, page 400 of the most current 2550 data sheet, I'm seeing a

acquisition time of...
1.4 us

conversion time of...
11*Tad = 11(.7 us) = 7.7 us

discharge time of...
0.2 us

Total is 9.3 us. Which is 107 kHz.

6. ### mik3 Thread Starter Senior Member

Feb 4, 2008
4,846
63
Jut,

I won't use the USB function and I got almost the same calculations as you. However, this a very low sampling frequency to sample a 10KHz signal and obtain good results thus I will use analog components to find the average value of the 10 KHz signal.