Hey TJF,

with 6285 ns I was only able to set the amount of samples to 1 without 
getting an error. With 6290 works everything fine.

Here is some c samplecode for you, it keeps writing all the samples to a 
file in burst of 1000000/4 samples per writing burst.

#include "unistd.h"
#include "stdio.h"
#include "../c_wrapper/pruio.h"


//! The main function.
int main(int argc, char **argv)
{
  FILE* oFile;
  uint8 bDiv = 4, bStep;
  uint32 bSize = 1e6;
  uint32 bsSize = bSize/bDiv;
  oFile = fopen("output","wb");
  pruIo *io = pruio_new(PRUIO_DEF_ACTIVE, 0x98, 0, 1); //! create new 
driver structure
  pruio_adc_setStep(io, 9, 4, 0, 0, 0); // step 9 for AIN-4
  if (pruio_config(io, bSize, 1 << 9, 6290, 0)){ // '1 << 9' -> step 9, 
'6285' ns -> 159.1 kHz
        printf("config failed (%s)\n", io->Errr);}
  else{
    pruio_rb_start(io);
    sleep(1);
    while(1){
      while(io->DRam[0] < (bStep+1) * bsSize && io->DRam[0] > bStep * bsSize
){
        sleep(1);
      }
      printf("start writing %u\n",bStep*bsSize);
      fwrite(io->Adc->Value, sizeof(uint16), 16000, oFile);
      printf("end writing %u\n",(bStep+1)*bsSize);
      bStep = bStep+1 < bDiv ? bStep+1 : 0;
    }
  }
  pruio_destroy(io);
  return 0;
}

Greetings,
Nils Kohrs

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to