Hi guys,
I am wondering if anybody had any luck with making TS-ADC24 work with high
sampling rates?
I use TS-ADC24 to sample 4 channels at 200kHz, it runs for few minutes and then
the application is freezing. The application (and board) runs fine at 50 kHz.
If I increase sampling rate to 250kHz, the board is freezing in few seconds.
(According to TS-ADC24 specs, the card should be able to collect 4 channels @
500 kHz)
I can understand occasional FIFO buffer overflow, but the fact that the board
is simply freezing and does not return anything seems to me like a major flaw
is TS design.
Did anybody experience same problem or has any suggestions how I can deal with
TS-ADC24 freezing?
For a reference, below is code that is responsible for data acquisition.
#define ADC_START_MSK 0x0001
...
ADC_CFG = ADC_BASEIO + 0x02; // Configuration register
ADC_STAT = ADC_BASEIO + 0x08; // Status register
...
int n_Success = 1;
unsigned long i = 0;
unsigned short val = 0;
int n_Priority = -21;
int which = PRIO_PROCESS;
id_t pid;
int n_Result = 0;
// Change priority to -20
pid = getpid();
n_Priority = -20;
n_Result = setpriority(which, pid, n_Priority);
// Start ADC acquisition
POKE16((unsigned long)(ADC_CFG), (PEEK16((unsigned long) (ADC_CFG)) |
ADC_START_MSK));
while(i < n_Length)
{
// Read the status register
val = PEEK16((unsigned long) (ADC_STAT));
if ((val & 0xFFC0)) // leave the most recent sample in FIFO
{
// Test for overflow
if ((val & 0x8000))
{
// if there is overflow, exit loop
n_Success = -1;
i = n_Length;
}
else
{
n_Samples[i++] = PEEK16((unsigned long) (ADC_FIFO));
}
}
}
// stop ADC system
// = set bit 0 to 0
POKE16((unsigned long)(ADC_CFG), (PEEK16((unsigned long) (ADC_CFG)) &
~ADC_START_MSK));
// Empty FIFO
while(((PEEK16((unsigned long) (ADC_STAT)) & 0xFFC0) >> 6) > 0)
{
val = PEEK16((unsigned long) (ADC_FIFO));
}
//Restore priority to 0
n_Priority = 0;
n_Result = setpriority(which, pid, n_Priority);
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|