TS-7180 FRAM: Difference between revisions

From embeddedTS Manuals
No edit summary
mNo edit summary
Line 1: Line 1:
The TS-7180 has an optional 16Kbit ferroelectric random access memory (FRAM) organized as 2KB.  It is accessible via the SPI bus.
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".
The FRAM may be accessed from userspace using the linux kernel's spidev device.  It will appear as "/dev/spidev2.2".
Line 9: Line 9:
# Read from address 0x0000  
# Read from address 0x0000  
./spidev_test -D /dev/spidev2.2 -p "\x03\x00\x00\x00\x00"
./spidev_test -D /dev/spidev2.2 -p "\x03\x00\x00\x00\x00"
RX | 00 00 00 00 00


# Enable writes
# Enable writes

Revision as of 12:17, 4 July 2017

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