TS-7180 FRAM

From embeddedTS Manuals
Revision as of 12:17, 4 July 2017 by Ian (talk | contribs)

The TS-7180 has an optional 4Kbit ferroelectric random access memory (FRAM) organized as 512B. It is accessible via the SPI bus.

The FRAM may be accessed from userspace using the linux kernel's spidev device. It will appear as "/dev/spidev2.2".

There is some sample code in the linux kernel Documentation folder that may be used for accessing SPI slaves from the command-line. Some examples of using this program follow.

# Read from address 0x0000 
./spidev_test -D /dev/spidev2.2 -p "\x03\x00\x00\x00\x00"
RX | 00 00 00 00 00

# Enable writes
./spidev_test -D /dev/spidev2.2 -p "\x06"

# Read the status register to verify that bit #1 is now set
./spidev_test -D /dev/spidev2.2 -p "\x05\x00" 
RX | 00 02

# Write to address 0x0000
./spidev_test -D /dev/spidev2.2 -p "\x02\x00\x00\x12\x34"

# Read back to verify
./spidev_test -D /dev/spidev2.2 -p "\x03\x00\x00\x00\x00"
RX | 00 00 00 12 34