Analog Devices ADIS16265 Programmable Low Power Gyroscope: SPI LabVIEW FPGA IP
This document outlines how to use the Analog Device ADIS16265 Programmable Low Powered Gyroscope Evaluation Board with LabVIEW FPGA implementation of the SPI (Serial Peripheral Interface) digital communication protocol. This example reads and displays graphically the angular rate. This same driver is functional with the ADIS16250, ADIS16255 and the ADIS16265.
Table of Contents
- Device Overview
- Using NI RIO and LabVIEW FPGA with SPI devices
- Hardware Setup
- Driver Setup
- Other Analog Digital Drivers
The Analog Devices ADIS16265 Evaluation Board can output through an SPI serial interface the angular rate as well as the internal temperature.
Using NI RIO and LabVIEW FPGA with SPI devices
This example uses a LabVIEW FPGA implementation of the SPI bus to communicate with the ADIS16265 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 provide 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
An NI 9401 is used to connect the ADIS16265 Evaluation Board to the CompactRIO. The following wire diagram was implemented:
|PIN label||NI 9401 Digital I/O Module||ADIS16250/PCB|
Power: Connect pin 10 of ADIS16265 to +5V
Ground: Connect pin 12 of NI 9401 module to power source ground
There are three main steps to communication with the ADIS16265
- Interaction between host API and LabVIEW FPGA SPI engine
- Configure the SPI Bus to communicate with the device
- 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 ADIS16265. 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.
To read data, two 16-bit write operations must be performed. The first write will specify which data source to read from, while the second block of bits will simply return the data. Data polling can be achieved by two methods. The first method consists of continuously writing 16 bits to the device, pipelining the write and read operations. This increases throughput, however, it is important to note that on any given iteration, the binary data received will be from the prior iteration call. The second method consists of two consecutive blocks of 16 bits, while this lowers throughput it insures that every read call will return data on the current loop iteration.
- ADIS16265_configuration.vi: Configures device
- ADIS16265_convert_bin_to_real.vi: converts binary data to angular rate
- ADIS16265_convert_temp_to_real.vi: converts binary data to temperature
- ADIS16265_read_pipeline.vi: writes 1 block of 16 bits to the device
- ADIS16265_read_write_single_point.vi: write 2 sequential blocks of 16 bits to the device
Other Analog Digital Drivers
Find more sensor drivers for Analog Device sensors here.
Using LabVIEW FPGA implementation of the SPI communication protocol, we can communicate with many distributed embedded sensors. The ADIS16265 is one of many sensors that use this common bus to return digitized data to as master for processing.
Reader Comments | Submit a comment »