ts-7000
[Top] [All Lists]

[ts-7000] TS-7200 TS-ADC16 code issue

To:
Subject: [ts-7000] TS-7200 TS-ADC16 code issue
From: " [ts-7000]" <>
Date: 27 Jun 2014 12:28:02 -0700


We're having a problem getting going on the TS-7200 using the TS-ADC16 for ADC input.  The shell library works great, and we can use the DAC fine from our C code, but we're missing something on the ADC sequence.  We are randomly getting FIFO overflow errors.  We tried to go break down the shell library and copy the basic functionality to get an example going but something is still missing.  We would appreciate if someone could point out the problem(s).


Thanks.


our example.c code

randomly generates this error, maybe 3 out of 5 times: 

ADC machine stopped prematurely due to FIFO overflow: 0x0362 Fifo: 10923


#include <sys/types.h>

#include <sys/time.h>

#include <stdio.h>

#include "lib/tsadclib1624.h"


#define MaxBufferSize 10000

#define Channels 16

#define DACrange DACRANGE_02VB 

#define ADCrange ADCRANGE_05S

#define SampleRate 100

#define NumSamples 10


int main()

{

uint16_t *bufferArray[Channels];

int16_t *workArray[Channels];

uint16_t index;

uint16_t *aBuffer;

int8_t J;

bool b;

int v;

int numberOfSamplesAcquired;


// Create Buffers

for (index=0; index < 16; index++)

{

if ((aBuffer = malloc(MaxBufferSize+1 * sizeof(uint16_t))) == NULL)

{

printf("Error malloc\n");

return;

}

bufferArray[index] = aBuffer;

}


// Initialize board

tsadclib1624_init(SBC_TS7200, 16, 10000);


// Check for buffers

b = tsadclib1624_buffers();

if (b == TRUE)

{

printf("Buffer OK\n");


for (index = 0; index < 16; index++)

{

workArray[index] = bufferArray[index];

}



usleep(50000);


// Start sampling

tsadclib1624_sample(0, 2, SampleRate, NumSamples, ADCrange, workArray, FALSE);


numberOfSamplesAcquired = tsadclib1624_pollResults(0, TRUE);


// Print out buffers

for (J=0; J<16; J++)

{

printf("\nIndex: %d\n", J);


if (workArray[J] != NULL)

{

for (index=0; index<NumSamples; index++)

{

printf("%d,", *workArray[J]++);

}

}

}

}else

{

printf("Buffor NOT OK");

}

}




__._,_.___

Posted by:



__,_._,___
<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU