User Manual
Copyright © Parallax Inc. Gyroscope Module 3-Axis L3G4200D (#27911) v1.0 10/24/2011 Page 5 of 5
FIFO Modes
FIFO is an acronym for First In, First Out. It used to buffer data to help with flow of communication to
devices.
There are 32 slots of FIFO data, for each of the three output channels: yaw, pitch, and roll (X,Y,Z). Each
slot has 16 bits of data.
The great thing about having a FIFO is the host processor does not need to continuously poll data from
the sensor. Instead, it can wake up only when needed and burst the significant data out from the FIFO.
This buffer can work in five different modes.
There are five FIFO mode settings available; the default mode is “Bypass mode.” To see how to access
different modes, see FIFO_CTRL_REG and FIFO_SRC_REG in the datasheet posted to the 27911 product
page at www.parallax.com.
Bypass Mode
In bypass mode, the FIFO is not operational and for this reason it remains empty.
FIFO Mode
In FIFO mode, data from the yaw, pitch, and roll channels are stored in the FIFO.
Stream Mode
In stream mode, data from yaw, pitch, and roll measurements are stored in the FIFO. The FIFO
continues filling until full (32 slots of 16-bit data for yaw, pitch, and roll). When full, the FIFO discards the
older data as the new data arrives.
Bypass-to-stream Mode
In bypass-to-stream mode, the FIFO starts operating in bypass mode, and once a trigger event occurs,
the FIFO starts operating in stream mode.
Stream-to-FIFO Mode
In stream-to-FIFO mode, data from yaw, pitch, and roll measurements are stored in the
FIFO. An interrupt can be enabled on pin INT2, setting the I2_WTM bit in CTRL_REG3, which is triggered
when the FIFO is filled to the level specified in the WTM. The FIFO continues filling until full (32 slots of
16-bit data for yaw, pitch, and roll).
Example Code
Example code is available for download from the 27911 product page at www.parallax.com
BASIC Stamp 2
The L3G4200D_Gyroscope_Demo.bs2 program reads raw X,Y,Z values from the Gyroscope module using
the default I²C interface, and displays the values in the BASIC Stamp Editor’s Debug Terminal. The
software is a free download from www.parallax.com/basicstampsoftware.
Propeller™ P8X32A
The L3G4200D_example_code.spin program reads raw X,Y,Z values from the Gyroscope module using
the default I²C interface, and displays the values in a serial terminal. It calls FullDuplexSerial.spin, a
library object of the Propeller Tool software, which is available from www.parallax.com/Propeller.