Table Of Contents

Transferring Data between Clock Domains Using FIFOs

Last Modified: September 20, 2016

Before completing this task, verify that FIFOs are the best data storage and transfer option for your application.

Use FIFOs to move data between Clock-Driven Loops to ensure that every data sample is valid and that every data sample written by one loop is read by the other loop.

What to Use

What to Do

Create the following diagram to transfer data between clock domains without data loss.

Customize the gray sections for your unique programming goals.

Use a reference to a local FIFO implemented in block RAM to ensure that the Write FIFO and Read FIFO nodes in separate Clock-Driven Loops access the same FIFO. To implement a FIFO in block RAM, select the FIFO in the shared resource collection. In the Behavior section of the Item tab, ensure Storage is set to Block RAM.
Use a Case Structure and Feedback Nodes to retain data samples for multiple clock cycles when the other Clock-Driven Loop is not ready for data.

Perform operations inside the Case Structure on the data you write to the FIFO shared between clock domains.

Wire the data from the Case Structure to both Write FIFO and the sender data indicator. For the False case, wire the data from the previous clock cycle through the Case Structure. Also, add a False constant to the Case Structure and wire the False constant to input valid of Write FIFO to communicate that the data is not valid.

Use Read FIFO to ensure that every data sample entering the Clock-Driven Loop is valid. Read FIFO reads every sample sent from the other Clock-Driven Loop. Read FIFO also monitors the buffer depth of the FIFO shared between both loops to determine whether the data it reads is valid.
Perform operations on the data from the other clock domain. To preserve the last processed data sample produced by this Clock-Driven Loop when no new valid samples are available, use a Case Structure and a Feedback Node to retain a data sample for multiple clock cycles. The following image shows the False case of the Case Structure in this section.

Examples

Search LabVIEW for the following installed examples: Multiple Clock Domains


Recently Viewed Topics