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

Document Type: Example Program
NI Supported: Yes
Publish Date: Aug 27, 2007

Reading An SPI Interface with CompactRIO

1 ratings | 3.00 out of 5
Print

Downloads

Filename: demultiplexor_spi8.zip
Requirements: View

Filename: demultiplexor_spi.zip
Requirements: View

The SPI (Serial Peripheral Interface) bus is a fairly common, low cost serial data bus that can be easily implemented with a few integrated circuits. It can be found in many micro-processor based electronic devices, where it may be used to communicate between the processor and A/D (Analog-to-Digital) or D/A (Digital-to-Analog) converters or other devices. In this example, a commercial device is used to decode the current positions of 16 digital switches which had been transmitted over a remote control radio system. Rather than read these 16 bits individually, the SPI bus used to drive a digital latch/driver was intercepted and decoded using CompactRIO hardware and LabVIEW software. This solution used only three digital input bits, and could easily be expanded to handle 32 or more switches while still only using the three digital input lines.

This Example has been created by David Thomson. David Thomson works at the NOAA Aeronomy Lab, where he develops atmospheric chemistry instrumentation for use on high-altitude research aircraft. He is also the principal of Original Code Consulting, an NI Alliance Member which provides LabVIEW development and system integration for laboratory, R&D, and manufacturing clients.

Note: The second example, demultiplexor_spi8, preforms the same function as the original, but has been updated for LabVIEW 8.0 and later versions that use the Project Explorer.

Requirements


Filename: demultiplexor_spi8.zip

Software Requirements


Application Software: LabVIEW Professional Development System 8.0
Toolkits and Add-Ons: LabVIEW Real-Time Module 8.0, LabVIEW FPGA Module 8.0
Language(s): LabVIEW

Hardware Requirements


Hardware Group: CompactRIO, Real-Time (RT)
Hardware Model: cRIO-9002, NI 9411
Driver: NI-RIO 1.0

 
Filename: demultiplexor_spi.zip

Software Requirements


Application Software: LabVIEW Professional Development System 7.1
Toolkits and Add-Ons: LabVIEW FPGA Module 1.1, LabVIEW Real-Time Module 7.1
Language(s): LabVIEW

Hardware Requirements


Hardware Group: CompactRIO
Hardware Model: NI 9411

 
1 ratings | 3.00 out of 5
Print

Reader Comments | Submit a comment »

 

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/).