![Ratoc Systems REX-USB61 User Manual Download Page 44](http://html.mh-extra.com/html/ratoc-systems/rex-usb61/rex-usb61_user-manual_788102044.webp)
3.SPI/I2C Control Utility
Page.3-20
・
Sample of SPI script
:
(Write 4bytes data(00h 01h 02h 03h) from the address of 15h, and read
the data to confirm the data is written properly. And also, write data on the file, and read the data to a
file to confirm the data is written. Sampling rate(frequency) is 3MHz/External power supply is 5V)
# Sample of SPI script
# ATMEL: AT25080 Serial EEPROM Input/Output
MODE=SPI
# SPI mode
FILE1 "write.bin"
# data file to be sent
FILE2 "read.bin"
# file to save received data
POWER=ON5
# External power supply 5V
INTERVAL=20
# Time interval between data transmission 20
μ
sec.
FREQUENCY=3000
# Set sampling rate(frequency) at 3MHz.
SAMPLING=0
# Specify an edge to renew data
FB=MSB
# Set a bit order
SS=0
# Select slave select pin as 0
#
# From here, access to a device
#
# Write 4 bytes data from address 0015h
SSSET
# Activate SS signal at the Low level
06h
#
Operation
code
WREN
SSRESET
# Activate SS signal at the High level
SSSET
# Activate SS signal at the Low level
02h,15h,00h
#
Operation code WRITE
+
write address
00h,01h,02h,03h
#
Write
data
SSRESET
# Activate SS signal at the High level
# Confirm data is written properly
# Read 4 bytes data from address 0015h
SSSET
# Activate SS signal at the Low level
03h,15h,00h
# Operation code READ+ read address
REPEAT=4
# Repeat the next command 4 times
00h
# Read 1 byte of dummy data
SSRESET
# Activate SS signal at the High level
# Write data on FILE1 from address 0015h
SSSET
# Activate SS signal at the Low level
06h
#
Operation
code
WREN
SSRESET
# Activate SS signal as the High level
SSSET
# Activate SS signal at the Low level
02h,15h,00h
#
Operation code WRITE
+
write address
FILE1
#
Write
data
on
FILE1
SSRESET
# Activate SS signal at the High level
# (Continue to the following page)