help with timebase for sampled data
k
Posts: 7
Hello,
We have an analog signal that we want to convert to digital data using the LTC1298 ADC. We followed the code for BasicStamp II shown in the manual. The values are being displayed in the Debug window. However, we were wondering if the time axis can be obtained also, because we eventually want to plot the sampled data in an application like MATLAB.
We only really need to get samples for about 10 seconds or so. We want to see the time axis and plot our data in MATLAB to see if the ADC is sampling fast enough. I'm at a loss as to how to go about it. I mean, there's mention of COUNT, RCTIME, FREQOUT commands in the posts, but sorry I find it confusing. Any help in the right direction will be appreciated.
Thanks in advance for any info.
We have an analog signal that we want to convert to digital data using the LTC1298 ADC. We followed the code for BasicStamp II shown in the manual. The values are being displayed in the Debug window. However, we were wondering if the time axis can be obtained also, because we eventually want to plot the sampled data in an application like MATLAB.
We only really need to get samples for about 10 seconds or so. We want to see the time axis and plot our data in MATLAB to see if the ADC is sampling fast enough. I'm at a loss as to how to go about it. I mean, there's mention of COUNT, RCTIME, FREQOUT commands in the posts, but sorry I find it confusing. Any help in the right direction will be appreciated.
Thanks in advance for any info.
Comments
But i will try Mr. Green's suggestion about getting the rough timebase. We will plot the data in MATLAB and see if the signal is getting sampled properly.
Thanks for the replies.
To get an easy to build 120 hz signal, you can sync off the power grid, assuming you have 60 hz power. One possible way to do this is find a low voltage dc power supply with no filtering. They usually have a small transformer running through a bridge rectifier to achieve a pulsing dc at 120 hz. Fed through a voltage divider and with a protection resistor, the stamp should see this as a sequence of pulses at 120 hz.
The code in the manual could be modified to make it faster, by dispensing with the subroutines and optimizing for speed in a straight line loop. The fact remains that the conversion on the LTC1298 is limited by the speed of the shiftout command and the speed of the PBASIC interpreter to about 4 milliseconds for the core sequence,
A faster Stamp, like the BS2p could help with the speed issue, but it will still take tight programming.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
We do have microcontroller samples from Microchip. Will those be able to achieve the sampling rate (120Hz) that we need? And if we do use the PICs, will it be harder to program them? I hear one can program a PIC with BASIC, so can we still use the Parallax documentation for the LTC1298 (and also the eb500) to do the same project with the PIC?
The Propeller can do 12 bit ADC at a 20K samples per second rate, more than fast enough for your project.
Post Edited (Mike Green) : 5/13/2008 3:04:35 PM GMT