Chapter 7: User Flash Memory in MAX V Devices
7–17
Software Support for UFM Block
Page Write Operation
Page write operation has a similar sequence as the byte write operation, except that
several bytes of data are transmitted in sequence before the master issues a stop
condition. The internal write from the MAX V logic array to the UFM begins only
after the master generates a stop condition. While the UFM internal write cycle is in
progress, the ALTUFM_I2C logic ignores any attempt made by the master to initiate a
new transfer. The ALTUFM_I2C megafunction allows you to choose the page size of 8
bytes, 16 bytes, or 32 bytes for the page write operation.
A write operation is only possible to an erased UFM block or word location. The UFM
block differs from serial EEPROMs, requiring an erase operation before writing new
data in the UFM block. A special erase sequence is required, as discussed in “Erase
Operation”.
Acknowledge Polling
The master can detect whether the internal write cycle is completed by polling for an
acknowledgement from the slave. The master can re-send the start condition together
with the slave address as soon as the byte write sequence is finished. The slave does
not acknowledge if the internal write cycle is still in progress. The master can repeat
the acknowledge polling and proceed with the next instruction after the slave
acknowledges.
Write Protection
The ALTUFM_I2C megafunction includes an optional Write Protection (WP) port
available on page 4 of the ALTUFM MegaWizard Plug-In Manager. In the
MegaWizard Plug-In Manager, you can choose the WP port to protect either the full or
upper half memory.
When WP is set to 1, the upper half or the entire memory array (depending on the
write protection level selected) is protected, and the write and erase operations are not
allowed. The ALTUFM_I2C megafunction acknowledges the slave address and
memory address. After the master transfers the first data byte, the ALTUFM_I2C
megafunction sends a not-acknowledge condition to the master to indicate that the
instruction will not execute. When WP is set to
allowed.
0, the write and erase operations are
Erase Operation
Commercial serial EEPROMs automatically erase each byte of memory before writing
into that particular memory location during a write operation. However, the MAX V
UFM block is flash based and only supports sector erase operations. Byte erase
operations are not supported. When using read/write mode, a sector or full memory
erase operation is required before writing new data into any location that previously
contained data. The block cannot be erased when the ALTUFM_I2C megafunction is
in read-only mode.
Data can be initialized into memory for read/write and read-only modes by including
a memory initialization file (.mif) or hexadecimal file (.hex) in the ALTUFM
MegaWizard Plug-In Manager. This data is automatically written into the UFM
during device programming by the Quartus II software or third-party programming
tool.
January 2011 Altera Corporation
MAX V Device Handbook