9–20
Chapter 9: Using User Flash Memory in MAX II Devices
Software Support for UFM Block
If the altufm_i2c megafunction is write-protected (WP=1), the slave does not
acknowledge the byte address (which indicates the UFM sector to be erased) sent in
by the master. The master should then send a stop condition to terminate the transfer
and the sector erase operation will not be executed.
No Erase
The no erase operation never erases the UFM contents. This method is recommended
when UFM does not require constant re-writing after its initial write of data. For
example, if the UFM data is to be initialized with data during manufacturing using
2
I C, you may not require writing to the UFM again. In that case, you should use the no
erase option and save logic element (LE) resources from being used to create erase
logic.
Read Operation
The read operation is initiated in the same manner as the write operation except that
the R/W bit must be set to 1. Three different read operations are supported:
■
■
■
Current Address Read (Single Byte)
Random Address Read (Single byte)
Sequential Read (Multi-Byte)
After each UFM data has been read and transferred to the master, the UFM address
register is incremented for all single and multi-byte read operations.
Current Address Read
This read operation targets the current byte location pointed to by the UFM address
register. Figure 9–18 shows the current address read sequence.
Figure 9–18. Current Address Read Sequence
Slave Address
Data
S
A
P
R/W
‘1’ (read)
From Master to Slave
From Slave to Master
S – Start Condition
P – Stop Condition
A – Acknowledge
Random Address Read
Random address read operation allows the master to select any byte location for a
read operation. The master first performs a “dummy” write operation by sending the
start condition, slave address, and byte address of the location it wishes to read. After
the altufm_i2c megafunction acknowledges the slave and byte address, the master
generates a repeated start condition, the slave address, and the R/W bit is set to 1. The
altufm_i2c megafunction then responds with acknowledge and sends the 8-bit data
requested. The master then generates a stop condition. Figure 9–19 shows the random
address read sequence.
MAX II Device Handbook
© October 2008 Altera Corporation