Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Analog Devices ADIS16003 Dual-Axis Accelerometer: SPI LabVIEW FPGA IP

5 ratings | 3.00 out of 5
Print

Overview

The ADIS16003/PCB is a simple evaluation board that provides convenient access to the ADIS16003. This example program uses NI LabVIEW FPGA and CompactRIO to communicate with and control the sensor.

Device Overview

The Analog Devices ADIS16003 Evaluation Board can output acceleration along 2 axis through an SPI serial interface.

Using NI RIO and LabVIEW FPGA with SPI devices

This example uses a LabVIEW FPGA implementation of the SPI bus to communicate with the ADIS16003 Evaluation Board. There are two LabVIEW elements to this example. The first is a LabVIEW FPGA interface that performs the SPI communication. The second is a LabVIEW host API that interacts with the FPGA from a host PC or real-time controller. We have chosen a CompactRIO system with an NI 9401 module to connection to the device.

For more information on the LabVIEW FPGA SPI implementation and the host API, refer to Implementing SPI Communication Protocol in LabVIEW FPGA and Understanding the SPI Bus with NI LabVIEW.

Hardware Setup

An NI 9401 is used to connect the ADIS16003 Evaluation Board to the CompactRIO. The following wiring diagram was implemented:

PIN label NI 9401 Digital I/O Module ADIS16003/PCB
SCLK 20 2
MOSI 22 6
MISO 14 4
CS1 23 3
CS2 25 5
Ground 12 7

Power: connect pin 10 of ADIS16003 to +5v.

Ground: connect pin 12 of NI 9401 Module to power source ground.

Driver Setup

There are three main steps to communication with the ADIS16003:

  1. Interact between host API and LabVIEW FPGA SPI engine
  2. Configure the SPI Bus to communicate with the device
  3. Read or write data to and from the device

Using the host API created for interacting with the LabVIEW FPGA SPI engine, it is relatively simple to communicate with the ADIS16003. With the provided example, most of the configuration is provided and moving the program to a different FPGA target is fairly straight forward. A reference to the top-level FPGA VI is open and waits for notification from the FPGA that it is ready for data transmission.

The SPI bus must first be configured to read or write data from the device. This is accomplished by setting the chip select to 0, the chip mode to 3 (CPOL=1, CPHA=1) and setting the appropriate clock rate.

By writing data to the appropriate control register, one can change the sensitivity and/or offset of the sensor. This is achieved by sending the write bit, the address of the control register you wish to write into and the data you want to write to the device.


[+] Enlarge Image

 

SubVIs

  • ADIS16003_read: Configures device
  • ADIS16003_convert_bin_to_real.vi: converts binary data to angular rate
  • ADIS16003_convert_temp_to_real.vi: converts binary data to temperature 

Other Analog Digital Drivers

Find more sensor drivers for Analog Device sensors here.

Conclusion

Using the LabVIEW FPGA implementation of the SPI communication protocol, we can communicate with many distributed embedded sensors. The ADIS16003 is one of many sensors that use this common bus to return digitized data to a master for processing.

Originally Authored By: Greg Crouch, National Instruments

5 ratings | 3.00 out of 5
Print

Reader Comments | Submit a comment »

Version 8.5
Can you provide the 8.5 version, please... :) Thanks alot.
- auralius. mr_manurung@yahoo.com - Sep 24, 2009

 

Legal
This example program (this "program") was developed by a National Instruments ("NI") Applications Engineer. Although technical support of this program may be made available by National Instruments, this program may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this program with each new revision of related products and drivers. THIS EXAMPLE PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).