Q-Code User Manual
Ver. 7.0 2021/11/30
179
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 0xC7.
3. This command will automatically set WEL bit to 1, users do not need to execute SPI_WREN
command additionally.
4. Depending on the different size of the SPI Flash, erasing may take seconds to tens of
seconds. All commands are invalid during erasing process except SPI_RDSR command.
5. After the erasing is completed, the “SPI_EraseEnd” path is automatically executed. User
will know the SPI_EraseEnd completing time through this path to perform subsequent
actions.
Ex.
SPI_CE
; Transmit Chip Erase command to SPI Flash through SPI1 and excute erasing all memory.
SPI_CE(SPI2)
; Transmit Chip Erase command to SPI Flash through SPI2 and excute erasing all memory.
Erase: SPI_CE(SPI1), R0=1
SPI_EraseEnd: R0=0
; Transmit Chip Erase command to SPI Flash through SPI1. When erase is in progress, set R0
as 1. When the erase is completed, set R0 as 0.
4.9.9 SPI_SE(Addr, Count, SPIGroup)
Transmit Sector Erase command to SPI Flash and erasr sector(s). The size of a sector is 4KB, users
can specify the amount of sector to be erased once.
The system will not enter sleep mode when the erase action is executing. After the erasing is
completed, the “SPI_EraseEnd” path will be automatically executed. User can read the WIP bit (bit0)
status of the status register by using the SPI_RDSR command. When the erase is in progress, the
WIP bit is 1; when the erase is completed, the WIP bit is 0.
Addr
:
Specify the address to be erased which can be an immediate value or specified by variable. The
size of a sector is 4KB. When using immediate value addressing, user needs to fill in the 24-bit
address, but Bit[11: 0] is invalid. When using variable addressing, user only needs to fill in the
valid bit Bit[23:12].
Count
:
The amount of sector to be erased, the range is from 1 to 16; default is 1 if omitted.
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.