Chapter 9: Using User Flash Memory in MAX II Devices
Software Support for UFM Block
9–19
Figure 9–16.
Full Erase Sequence Triggered Using the Slave Address
S
Slave Address
A
6
A
5
A
4
A
3
111
R/W
A
P
S – Start Condition
P – Stop Condition
A – Acknowledge
'0' (write)
From Master to Slave
From Slave to Master
Sector Erase (Byte Address Triggered)
This sector erase operation is triggered by defining a 7- to 10-bit byte address for each
sector depending on the memory size. The trigger address for each sector is entered
on page 4 of the altufm MegaWizard Plug-In Manager, as shown in
When a write operation is executed targeting this special byte address
location, the UFM sector that contains that byte address location is erased. This sector
erase operation is automatically followed by a write of the intended write byte to that
address. The default byte address location for UFM Sector 0 erase is address 0x00. The
default byte address location for UFM Sector 1 erase is [(selected memory size)/2].
You can specify another byte location as the trigger-erase addresses for each sector.
This sector erase operation supports up to eight UFM blocks or serial EEPROMs on
the I
2
C bus. This sector erase operation requires acknowledge polling.
Sector Erase (A
2
Triggered)
This sector erase operation uses the received A
2
slave address bit to distinguish
between an erase or read/write operation. This slave operation decoding occurs when
the master transmits the slave address after generating the start condition. If the A
2
bit
received by the UFM slave is 1, the sector erase operation is selected. If the A
2
bit
received is 0, the read/write operation is selected. While this reserves the A
2
bit as an
erase or read/write operation bit, the A
0
and A
1
bits still act as slave address bits to
address the UFM. With this erase option, there can be up to four UFM slaves cascaded
on the bus for 1-Kbit and 2-Kbit memory sizes. Only two UFM slaves can be cascaded
on the bus for 4-Kbit memory size, since A
0
of the slave address becomes the ninth bit
(MSB) of the byte address. After the slave acknowledges the slave address and its
erase or read/write operation bit, the master can transfer any byte address within the
sector that must be erased. The internal UFM sector erase operation only begins after
the master generates a stop condition.
shows the sector erase sequence
using the A
2
bit of the slave address.
Figure 9–17.
Sector Erase Sequence Indicated Using the A
2
Bit of the Slave Address
S
Slave Address
R/W
A
2
= '1'
A
Byte Address
A
P
S – Start Condition
P – Stop Condition
A – Acknowledge
'0' (write)
(1)
From Master to Slave
From Slave to Master
Note to
(1) A
2
= 0 indicates a read/write operation is executed in place of an erase. In this case, the R/W bit determines whether
it is a read or write operation.