AnsweredAssumed Answered

How to set ADIS16228 in manual FFT, please...

Question asked by CristiDumitrescu on Sep 1, 2014
Latest reply on Sep 15, 2014 by CristiDumitrescu

Hello all

 

My name is Cristian Dumitrescu and I am from Romania, working at S.C. AEROFINA S.A..

We've recently puchased a ADIS16228 for evaluation/testing purposes. The sensor is controlled by a ATXmega128A4 microcontroller and the software is developed using CodeVision (C language).

I've managed to control some of the functions for the ADIS16228 sensor (e.g. id retrieval, self test, status reading a.s.o), but it seems I can't make it acquire data for a (manual) FFT.

The only documentation I have is the sensor data sheet.

 

Here is the code used to (try to) launch a manual FFT

 

#define WkWait 1000

 

// FF configuration

// Initiate FF (manual FFT)

SPI(0x9A01); // manual FFT, no rectangle, SR0

SPI(0x9B01);

// Initiate FF resolution

SPI(0x9C00); // all 1 g

SPI(0x9D00);

// Select sample frequency

SPI(0xBA05);  // 5: Sample rate = 640 SPS

SPI(0xBB00);

// Set FFT average (1 average)

SPI(0x8C01);

SPI(0x8D01);

SPI(0x8E01);

SPI(0x8F01);

// Clear DIAG_STAT (clear flags = no error)

SPI(0xBE10);

SPI(0xBF00)

 

// Start manual FFT via command

SPI(0xBE00);               

SPI(0xBF08);

             

// Timeout cycle

Waits = 0; AValue = 0; SPI(0x3C00); Wait(1);

do

  {

   SPI(0xE8E8); // Escape code (from manual)

   Waitus(50);

   AValue = SPI(0x3C00); Waits++; Wait(1);

  }

while ((Waits < WkWait) && ((AValue & 0x80) == 0));

 

if (Waits >= WkWait) XValue = 1; else XValue = 0;

 

and the function SPI is

 

unsigned int SPI(unsigned int Data)

  {

   unsigned char L, H;

   SET_SPIC_SS_LOW;                    // Enable CS

   Waitus(100);                        // Wait 100 microseconds to settle

   H = spic_master_tx_rx(Data >> 8);   // Send high byte

   L = spic_master_tx_rx(Data);        // Send low byte

   SET_SPIC_SS_HIGH;                   // Disable CS

   Waitus(100);                        // Wait 100 microseconds to settle

   Waitus(32);                         // Wait another 32 microseconds between requests

   return ((unsigned int)H << 8) + L;

  }

 

The delays in this function were obtained according to our particular schematic.

SPI sends a word (16 bit data) in two SPI byte-operations (spic_master_tx_rx is a standard function).

 

The problem is that nothing happens; the program always signals "timeout" (XValue == 1), i.e. a 1 second timeout.

 

Can anyone tell me where does this program fail ? Or if the register values should be updated otherwise ? (order/value)

Or better: would someone provide a piece of code that works for this particular case (manual FFT); language is not important.

 

Thank you

Outcomes