English
Language : 

AMIS-30521 Datasheet, PDF (22/28 Pages) AMI SEMICONDUCTOR – Micro-stepping Motor Driver
AMIS−30521, NCV70521
Examples of Combined READ and WRITE Operations
In the following examples successive READ and WRITE
operations are combined. In Figure 19 the Master first reads
the status from Register at ADDR4 and at ADDR5 followed
by writing a control byte in Control Register at ADDR2.
Note that during the write command (in Figures 18 and 19)
the old data of the pointed register is returned at the moment
the new data is shifted in.
Registers are updated with the internal status at the
rising edge of the internal AMIS−30521/NCV70521
clock when CS = 1
CS
The NEW DATA is written into the corresponding
internal register at the rising edge of CS
DI
DATA from previous
command or NOT VALID
after POR or RESET
DO
COMMAND
READ DATA
from ADDR4
DATA
OLD DATA
or NOT VALID
COMMAND
READ DATA
from ADDR5
DATA
DATA
from ADDR4
COMMAND
WRITE DATA
to ADDR2
DATA
DATA
from ADDR5
COMMAND
NEW DATA
for ADDR2
DATA
OLD DATA
from ADDR2
Figure 19. Two Successive READ Commands Followed by a WRITE Command
After the write operation the Master could initiate a read
back command in order to verify if the data is correctly
written, as illustrated in Figure 20. During reception of the
READ command the old data is returned for a second time.
Only after receiving the READ command the new data is
Registers are Updated with the Internal Status at the
Rising Edge of CS
transmitted. This rule also applies when the master device
wants to initiate an SPI transfer to read the Status Registers.
Because the internal system clock updates the Status
Registers only when CS line is high, the first read out byte
might represent old status information.
Registers are Updated with the Internal Status at the
Rising Edge of the Internal 521 Clock when CS = 1
CS
DI
COMMAND
WRITE DATA
to ADDR2
DATA
NEW DATA
for ADDR2
COMMAND
READ DATA
from ADDR2
COMMAND or
DUMMY
DATA
DATA
DATA
DATA
DO
OLD DATA
or NOT VALID
OLD DATA
from ADDR2
OLD DATA
from ADDR2
NEW DATA
from ADDR2
Figure 20. A WRITE Operation Where DATA From the Master is Written in SPI Register with Address 2 Followed
by a READ Back Operation to Verify a Correct WRITE Operation
NOTE:
The internal data−out shift buffer of the AMIS−30521/NCV70521 is updated with the content of the selected SPI register only at
the last (every eighth) falling edge of the CLK signal (see SPI Transfer Format and Pin Signals). As a result, new data for
transmission cannot be written to the shift buffer at the beginning of the transfer packet and the first byte shifted out might
represent old data.
Table 11. SPI CONTROL REGISTERS (All SPI Control Registers have Read/Write Access and default to ”0” after Power−on or
hard reset)
Structure
Content
Bit 7
Bit 6 Bit 5 Bit 4
Bit 3
Bit 2
Bit 1 Bit 0
Access
R/W
R/W R/W R/W
R/W
R/W
R/W R/W
Address
Reset
0
0
0
0
0
0
0
0
CR0 (01h)
Data
SM[2:0]
CUR[4:0]
CR1 (02h)
Data
DIRCTRL NXTP
−
−
PWMF PWMJ
EMC[1:0]
CR2 (03h)
Data
MOTEN
SLP SLAG SLAT
−
−
−
−
Where:
R/W: Read and Write access
Reset: Status after Power−On or hard reset
http://onsemi.com
22