Q-Code User Manual
Ver. 7.0 2021/11/30
184
address 0x1201.
SPI_WRD(0x4321, 0xAB, SPI1), R0=0xD, R1=0xC, SPI_TX(R1:R0),
X0=0xEF, SPI_TX(X0), SPI_CS_Off
; Through SPI1, write 0xAB into address 0x4321, 0xCD into address 0x4322 and 0xEF into
address 0x4323.
4.9.16 SPI_RDD(Addr, Result, SPIGroup)
Send Read Data command to SPI Flash. Read data from specified address, user can read many bytes
data at one time with SPI_RX commad.
After finished reading, it needs to issue SPI_CS_Off command
to end the reading action.
Addr:
Specify 24-bit address of reading data which can be immediate value or variable specified.
When specified by a variable, high bit variable can be omitted, the omitted bit is defaulted as 0.
Result:
Save the variable of reading data.
SPIGroup:
Select the corresponding SPI channel.
NY6 does not support SPIGroup parameter.
NY7 supports SPI1 or SPI2; default is SPI1 if omitted.
Note:
1. NY4 / NY5 / NY5+ / NY6A / NY9T / NX1 do not support this command.
2. This command is applicable to the SPI Flash of N25Q series; the instruction is 0x03.
3. While the command executes, it is automatically set CS pin as low level. After the data
finished reading, it needs to issue SPI_CS_Off command to end the read action.
4. The address is added by 1 automatically every time a byte is read.
Ex.
SPI_RDD(0x4321, R1:R0), SPI_CS_Off
; Save the data in address 0x4321 into [R1:R0] through SPI1.
R0=0x3, X1=0x12, SPI_RDD(X1:R0, X2, SPI2), SPI_CS_Off(SPI2)
; Save the data in address 0x123 into X2 through SPI2.
SPI_RDD(0x1234, X0, SPI1), SPI_RX(R3:R2), SPI_RX(X2, SPI1), SPI_CS_Off
; Save the data in address 0x1234 into X0 through SPI1, the data in address 0x1235 into [R3:R2],
the data in address 0x1236 into X2.
4.9.17 SPI_GetAddr(Index, Result, SPIGroup)
Users can add user defined file or reserved blocks through User Defined Sections page in
SPI_Encoder
. Then use this command to get the address of each block to excute read, write or erase
operations.
When users add a file or defines the reserved blocks, the adding order (the Sec field) is the index value.
Specify the index value of the block in the parameter of command to obtain the corresponding address.
Please refer to
SPI_Encoder
User Manual for detailed operation.