I thought that if I set the conversion time in the A/D Bean and ran continuous conversions using start and stop and storing the data using GET16 in the ON_END event module my sampling rate would be the conversion time (eg conversion time of 4.533 us would yield a 220.6 kHz sampling rate) I tried this but the sampling rate seems considerably lower. Do I need to use triggered sampling to get a constant known sampling rate? Any ideas?
Thank you, Alex, for your input. I want to sample two inputs for 17.5 ms and then do DSP on the data. This requires a known sampling rate and since the 56F800E series are 60 MIPS DSP controllers I thought CW would be more straight forward to use. I will look into reading the A/D outside of a bean. Maybe I will have to use a faster conversion time to compensate for overhead to get the desired sampling rate.
Ray
Alex,
I am monitoring two 40 kHz transducers for 17.5 ms looking for echoes of a transmit pulse. The Nyquist rate is 80 kHz so I am looking at a sampling rate of 100 to 250 kHz. The higher the sampling rate the more memory will be needed to analyze the received data but the resolution has to be good enough to distinguish the signals using correlation. I am currently reading two analog inputs simultaneously in continuous mode. I start the continuous conversions, read and store the samples using the AD1_GetValue16 in the AD1_OnEnd code. Since the difference in the timing between the transducers is critical to my application I prefer this approach.
Feeding a 10 kHz signal from a signal generator into the ADC and calculating the samples per cycle I have tried different values for DIV in the ADC control register 2 and have calculated the following sampling rates:
DIV kHz
8 233
10 200
12 185
15 160
20 133
30 96
This was done using a 56F8323 on the 56F800DEMO board with a 60 MHz clock. I assume that this will translate directly to my target 56F8365 running the same code. I have not tried using the triggered approach suggested by Petr as yet. The triggered method should yield any needed sampling rate as apposed to just what you get playing with the value of DIV.
Ray
Alex
I believe the ADC writes the results into the buffer and I read the buffer with the GetValue16. The buffer can hold the results from up to 8 inputs but I don’t think it can hold 8 conversions from one input and even if it can I would not want 8 fast conversions and a delay. I need a consistent sampling rate.
I am still analyzing the data I took using the DIV manipulation. If that is adequate for my project I will move on otherwise I will try the triggered approach.
Thank you Petr for your suggestions.
Ray
Message Edited by alex_spotw on 2006-06-30 02:11 PM