hi
first of all determine the highest frequency of the ur analogue wave u may use cro.
once u know the frequency u can choose adc with sampling period greater than twice the highest frequency and take samples of it.if u want to take 128 samples u have to adjust samplng frequency accordingly.
hope this helps
pimr
Hi, sorry for not giving more information in my question
The purpose of my project is to design, built and test a low-cost electronic system that will analyze the characteristic of analogue waveforms. It must able to measure the frequency, mean value, rms value, peak-to-peak voltage and duty cycle of an analogue waveform.The processed results can be displayed on a LCD screen. The electronic system will be implemented primarily through the use of an analogue circuitry (that will make sure the input voltage falls between 0 to 5V), a 8-bit A/D converter (TLC548), a PIC16F628 micro-controller (I cannot use a built-in ADC PIC), and a LCD Alphanumeric 20 X 4.
:arrow:
My project is going to measure these values for an analogue waveforms 50/60Hz mains. The number of 8-bit samples that I need to take is 128 because 256 is not enough to store in the PIC 16F628. My question is how to make my system take 128 samples from the analogue waveform :?:
I also facing problems in writing the code for my project(assembly language). Can somebody guide me to write the code for frequency, peak-to-peak, average, and duty cycle measurement of an analogue waveform?
mmmmm, kinda a digital osciloscope, i think i've seen that somewhere over here....
Well, if you want to sample a waveform, u can use a sammple and hold ciruit, is not hard to buil, u can use mosfet transistors and copacitors to make it, check this pdf paper.
Here is what i think, looking at the datasheet of the ADC, there is a chip select pin that sincronises de digital data, put in that pin a frecuency you want generated by the PIC, of course u have to take in consideration the sincronisation with the rest of the circuitery, and then simply count 128 raising edges of falling edges of the chip select pin to get the exactly 128 samples u want, after the samples are taken the chip select pin remains high.....
As you want to capture only 128 samples, you may want to start the sampling at the zero-crossing to capture the complete cycle. I can be a stand-alone circuite generating an interrupt at ZC, so you can start sampling. Or, you can make a program to look for ZC ( start of the cycle) and start writing the values in the array when ZC is detected in software.
As you need to sample mains, which is repeatative, I suggest you to visit **broken link removed**
look for Minimum Mass Waveform Capture for a simple solution for high resolution (but slow) technique.
For the " Minimum Mass Waveform Capture ", do I need my ADC as well? If yes, how should I connect the zero cross detector in my project? Before the ADC OR after the ADC? :idea:
Here is what i think, looking at the datasheet of the ADC, there is a chip select pin that sincronises de digital data, put in that pin a frecuency you want generated by the PIC, of course u have to take in consideration the sincronisation with the rest of the circuitery, and then simply count 128 raising edges of falling edges of the chip select pin to get the exactly 128 samples u want, after the samples are taken the chip select pin remains high.....
I'm not quite understand what you have said. hmm.. The frequency that I have to put to the chip select pin - Is it the 50Hz mains? What you mean by "take in consideration the sincronisation with the rest of the circuitery"? Can you explain more details to get 128 samples?