PDA

View Full Version : ADC for 40kHz sine wave recognition



Le'neord
- 10th August 2006, 09:29
Only 25usec is available and needs to take 13-14 samples to construct the incoming wave. Each conversion total is 2 usec if on single pin so problem there. Is it possible, maybe using parallel ADC pins or an offboard 1mHz ADC chip with parallel outs.

Melanie
- 10th August 2006, 10:37
PICs aren't suited for every application you come across... and for many applications they need help...

If you need to detect 40kHz... try an old, tried and tested and very cheap NE567... it will tell you when you've got 40kHz... and it only takes a small handfull of components to detect a Sine-wave from other waveforms.

You need to boil water to make coffee... you get a PIC, plus temperature sensor, plus heating element plus triac plus... plus... plus... or... you just pick up a kettle and plug it in the wall...

Le'neord
- 14th August 2006, 09:58
The 40 Khz signal I receive will have distortions and frequency variations that I need to recognize. I plan on using the PIC18F2331 dip28 200ksps to start. Will the Pbasic assembler have all I need to run ADC continuous and FIFO the results or will I have to paste assembler pieces of code into my program later.

Melanie
- 14th August 2006, 10:46
Who knows, you may have to do just that... I don't think a PIC even at 40MHz will be able to take sufficient samples of a single wave period for you to construct a good enough picture of the incomming waveform to analyse distortions. However, if those distortions are constant within the waveform, you could take a number of samples across several wave periods (eg ten measurements across each of ten wave periods, and each set of measurements is offset from the previous by a constant) and combine them to produce an average picture. Still not something that I would attempt with a PIC.

If you phase lock your incomming signal to a generated sinewave at 40kHz, you will easily be able to detect deviations from the norm by negative summation. A PIC could then handle the results. Example, if you have a 2-channel Oscilloscope, CH1 has your input frequency, CH2 contains a pure Sinewave at 40KHz 180 degrees out of phase with CH1. By adding the two traces, the resultant is the deviation of the incomming waveform from the reference.