TS-7180 FRAM: Difference between revisions

From embeddedTS Manuals
No edit summary
No edit summary
Line 1: Line 1:
The TS-7180 has 4Kbit ferroelectric random access memory (FRAM) organized as 512B.  It is accessible via the SPI bus.
The TS-7180 has 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.  It will appear as: '''/sys/class/spi_master/spi2/spi2.2/eeprom'''


There is some [https://github.com/torvalds/linux/blob/master/tools/spi/spidev_test.c 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.
The [http://www.cypress.com/file/136461/download datasheet] is available from Cypress Semiconductors' website.
 
<source lang=bash>
 
# Read from address 0x0000
./spidev_test -D /dev/spidev2.2 -p "\x03\x00\x00"
RX | 00 00 00
 
# Set the FRAM_WP# line high
tshwctl -a 5 -w 3
 
# 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\x12"
 
# Read back to verify
./spidev_test -D /dev/spidev2.2 -p "\x03\x00\x00"
RX | 00 00 12
 
# Disable writes
./spidev_test -D /dev/spidev2.2 -p "\x04"
 
</source>

Revision as of 16:52, 2 July 2018

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

The FRAM may be accessed from userspace. It will appear as: /sys/class/spi_master/spi2/spi2.2/eeprom

The datasheet is available from Cypress Semiconductors' website.