9–26
Chapter 9: Using User Flash Memory in MAX II Devices
Software Support for UFM Block
Table 9–10. Instruction Set for SPI
Name
Opcode
Operation
WREN
WRDI
RDSR
WRSR
READ
00000110
00000100
00000101
00000001
00000011
00000010
00100000
01100000
Enable Write to UFM
Disable Write to UFM
Read Status Register
Write Status Register
Read data from UFM
Write data to UFM
Sector erase
WRITE
SECTOR-ERASE
UFM-ERASE
Erase the entire UFM
block (both sectors)
The READand WRITEopcodes are instructions for transmission, which means the data
will be read from or written to the UFM.
WREN, WRDI, RDSR, and WRSRare instructions for the status register, where they do
not have any direct interaction with UFM, but read or set the status register within the
interface logic. The status register provides status on whether the UFM block is
available for any READor WRITEoperation, whether the interface is WRITEenabled,
and the state of the UFM WRITEprotection. The status register format is shown in
Table 9–11. For the read only implementation of ALTUFMSPI (Base or Extended
mode), the status register does not exist, saving LE resources.
Table 9–11. Status Register Format
Position
Bit 7
Status
X
Default at Power-Up
Description
0
0
0
0
0
0
0
—
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
X
—
X
—
X
—
BP1
BP0
WEN
Indicate the current level of block write protection (1)
Indicate the current level of block write protection (1)
1= SPI WRITEenabled state
0= SPI WRITE disabled state
1 = Busy, UFM WRITEor ERASEcycle in progress
0 = No UFM WRITEor ERASEcycle in progress
Bit 0
nRDY
0
Note to Table 9–11:
(1) Refer to Table 9–12 and Table 9–13 for more information about status register bits BPI and BPO.
The following paragraphs describe the instructions for SPI.
READ
READis the instruction for data transmission, where the data is read from the UFM
block. When data transfer is taking place, the MSB is always the first bit to be
transmitted or received. The data output stream is continuous through all addresses
until it is terminated by a low-to-high transition at the nCSport. The READoperation
is always performed through the following sequence in SPI, as shown in Figure 9–26:
MAX II Device Handbook
© October 2008 Altera Corporation