From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

LabVIEW FPGA I2S Decoder

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Hardware

  • CompactRIO|SingleBoardRIO
  • PXI|VXI

    Software

  • LabVIEW FPGA Module
  • LabVIEW

    Driver

  • NI RIO

Code and Documents

Attachment

Download All
Overview

This example demonstrates how to decode digital I²S bus data into audio channels with LabVIEW FPGA.

 

Description

The example demonstrated how to decode a I²S signal using LabVIEW FPGA. The code can be used on most LabVIEW FPGA targets (e.g. R series, CompactRIO) that support high-speed digital input. I²S is used to encode digital audio data within systems and components. For example digital audio inside of an MP3 player or DVD player is commonly communicated using the I²S protocol.

The example uses a Single Cycle Timed Loop in the FPGA diagram to monitor the three signals of the I²S protocol.

It monitors the LRClk (WS) and SClk lines looking for signal transitions/edges, and collects data bits from the SData (SD) line, writing completed audio samples to a DMA buffer for transfer to the host VI.

 

Requirements

 Software

  • LabVIEW Full Development System 2012 (or compatible)
  • LabVIEW FPGA Module 2012 (or compatible)
  • LabVIEW Real-Time Module 2012 (or compatible), if you use a RealTime Target for the Host VI

 Hardware

  • You have to migrate this example to your LabVIEW FPGA Target. You must recompile the FPGA VI.

 

Steps to Implement or Execute Code

  1. Download and open the attached ZIP-file
  2. Open the [Host] Display I2S Data.vi inside the LabVIEW project and follow the instructions on the Front Panel

 

Additional Information or References
I2S FPGA Diagram.png

 

**The code for this example has been edited to meet the new Community Example Style Guidelines. The edited copy is marked with the text ‘NIVerified’. Read here for more information about the new Example Guidelines and Community Platform.**

Discussion Forum Thread on I2S: http://forums.ni.com/t5/Components/I2S-Encoding-and-Decoding-Signals-in-LabVIEW/td-p/959062

IS2 Specification

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
JacobScott
Member
Member
on

The I2S Specification link above actually links to an I2C Specification.

Christian_L
Active Participant
Active Participant
on

Thank you for letting us know about the incorrect link. I have fixed it in the document.

authored by
Christian L, CLA
Systems Engineering Manager - Automotive and Transportation
NI - Austin, TX