ADC sampling at fixed rate
Can anybody suggest a mod to the 3208 & family drivers, to sample at a fixed rate (I need 8 KHz)?
The driver itself seems to use both counters. so I can't immediately see how to nail down a 125 uS sampling interval.
Any thoughts?
Thanks
The driver itself seems to use both counters. so I can't immediately see how to nail down a 125 uS sampling interval.
Any thoughts?
Thanks

Comments
OBJ adcObj : "MCP3208_fast" PUB fillBuffer(bufferSize, bufferAddress, channel, delayTime) | i, waitTime ' Fills a supplied buffer with samples from an MCP3208 ADC at regular intervals. ' Note that adcObj.start needs to be called before calling this routine. ' See the comments in MCP3208_fast for how to call that. ' ' bufferSize is the number of (word) entries in the buffer ' bufferAddress is the address of the start of the buffer ' channel is the number of the ADC channel to use ' delayTime is the time between samples in microseconds ' delayTime *= clkfreq / 1_000_000 ' Convert from microseconds to clock ticks waitTime := cnt ' Get a starting time repeat i from 0 to bufferSize-1 ' Repeat for specified number of samples waitcnt(waitTime += delayTime) ' Wait for specified time (first interval is not used) word[noparse][[/noparse] bufferAddress ][noparse][[/noparse] i ] := adcObj.in(channel) ' Read and store a 12 bit sample