The M25P40 is a 4 Mbit (512 K × 8) Serial Flash memory, with advanced write protection
mechanisms, accessed by a high speed SPI-compatible bus.
The memory can be programmed 1 to 256 bytes at a time, using the Page Program
instruction.
The memory is organized as 8 sectors, each containing 256 pages. Each page is 256 bytes
wide. Thus, the whole memory can be viewed as consisting of 2048 pages, or 524,288
bytes.
The whole memory can be erased using the Bulk Erase instruction, or a sector at a time,
using the Sector Erase instruction.
In order to meet environmental requirements, Numonyx offers the M25P40 in ECOPACK®
packages. ECOPACK® packages are Lead-free and RoHS compliant.
Figure 1.Logic diagram
V
CC
D
C
S
W
HOLD
Table 1.Signal names
Signal nameFunctionDirection
CSerial ClockInput
DSerial Data inputInput
QSerial Data outputOutput
SChip SelectInput
W
HOLD
V
CC
V
SS
Write ProtectInput
HoldInput
Supply voltage
Ground
M25P40
V
SS
Q
AI04090
6/53
M25P40Description
Figure 2.SO and VFQFPN connections
M25P40
SV
1
2
W
3
4
SS
1. There is an exposed central pad on the underside of the VFQFPN package. This is pulled, internally, to
VSS, and must not be allowed to be connected to any other voltage or signal line on the PCB.
2. See Section 11: Package mechanical for package dimensions, and how to identify pin-1.
8
7
6
5
AI04091B
CC
HOLDQ
C
DV
7/53
Signal descriptionM25P40
2 Signal description
2.1 Serial Data output (Q)
This output signal is used to transfer data serially out of the device. Data is shifted out on the
falling edge of Serial Clock (C).
2.2 Serial Data input (D)
This input signal is used to transfer data serially into the device. It receives instructions,
addresses, and the data to be programmed. Values are latched on the rising edge of Serial
Clock (C).
2.3 Serial Clock (C)
This input signal provides the timing of the serial interface. Instructions, addresses, or data
present at Serial Data input (D) are latched on the rising edge of Serial Clock (C). Data on
Serial Data output (Q) changes after the falling edge of Serial Clock (C).
2.4 Chip Select (S)
When this input signal is High, the device is deselected and Serial Data output (Q) is at high
impedance. Unless an internal Program, Erase or Write Status Register cycle is in progress,
the device will be in the Standby Power mode (this is not the Deep Power-down mode).
Driving Chip Select (S
After Power-up, a falling edge on Chip Select (S
instruction.
) Low selects the device, placing it in the Active Power mode.
2.5 Hold (HOLD)
The Hold (HOLD) signal is used to pause any serial communications with the device without
deselecting the device.
During the Hold condition, the Serial Data output (Q) is high impedance, and Serial Data
input (D) and Serial Clock (C) are Don’t Care.
To start the Hold condition, the device must be selected, with Chip Select (S
2.6 Write Protect (W)
The main purpose of this input signal is to freeze the size of the area of memory that is
protected against program or erase instructions (as specified by the values in the BP2, BP1
and BP0 bits of the Status Register).
) is required prior to the start of any
) driven Low.
8/53
M25P40Signal description
2.7 VCC supply voltage
VCC is the supply voltage.
2.8 VSS ground
VSS is the reference for the VCC supply voltage.
9/53
SPI modesM25P40
3 SPI modes
These devices can be driven by a microcontroller with its SPI peripheral running in either of
the two following modes:
●CPOL=0, CPHA=0
●CPOL=1, CPHA=1
For these two modes, input data is latched in on the rising edge of Serial Clock (C), and
output data is available from the falling edge of Serial Clock (C).
The difference between the two modes, as shown in Figure 4, is the clock polarity when the
bus master is in Stand-by mode and not transferring data:
●C remains at 0 for (CPOL=0, CPHA=0)
●C remains at 1 for (CPOL=1, CPHA=1)
Figure 3.Bus Master and memory devices on the SPI bus
V
SS
V
CC
R
SPI Interface with
(CPOL, CPHA) =
(0, 0) or (1, 1)
SPI Bus Master
CS3CS2 CS1
1. The Write Protect (W) and Hold (HOLD) signals should be driven, High or Low as appropriate.
SDO
SDI
SCK
Device
W
V
CC
HOLD
V
CQD
RR R
SPI Memory
S
CQD
SS
SPI Memory
S
Device
W
V
CC
HOLD
V
CQD
SS
SPI Memory
Device
S
V
CC
V
SS
HOLD
W
AI12836b
Figure 3 shows an example of three devices connected to an MCU, on an SPI bus. Only one
device is selected at a time, so only one device drives the Serial Data output (Q) line at a
time, the other devices are high impedance. Resistors R (represented in Figure 3) ensure
that the M25P40 is not selected if the Bus Master leaves the S
line in the high impedance
state. As the Bus Master may enter a state where all inputs/outputs are in high impedance
at the same time (for example, when the Bus Master is reset), the clock line (C) must be
connected to an external pull-down resistor so that, when all inputs/outputs become high
impedance, the S
C do not become High at the same time, and so, that the t
typical value of R is 100 kΩ, assuming that the time constant R*C
line is pulled High while the C line is pulled Low (thus ensuring that S and
requirement is met). The
SHCH
(Cp = parasitic
p
capacitance of the bus line) is shorter than the time during which the Bus Master leaves the
SPI bus in high impedance.
10/53
M25P40SPI modes
Example: Cp = 50 pF, that is R*Cp = 5 µs <=> the application must ensure that the Bus
Master never leaves the SPI bus in the high impedance state for a time period shorter than
5µs.
Figure 4.SPI modes supported
CPHA
CPOL
C
0
0
1
1
C
D
Q
MSB
MSB
AI01438B
11/53
Operating featuresM25P40
4 Operating features
4.1 Page Programming
To program one data byte, two instructions are required: Write Enable (WREN), which is one
byte, and a Page Program (PP) sequence, which consists of four bytes plus data. This is
followed by the internal Program cycle (of duration t
To spread this overhead, the Page Program (PP) instruction allows up to 256 bytes to be
programmed at a time (changing bits from 1 to 0), provided that they lie in consecutive
addresses on the same page of memory.
For optimized timings, it is recommended to use the Page Program (PP) instruction to
program all consecutive targeted bytes in a single sequence versus using several Page
Program (PP) sequences with each containing only a few bytes (see Page Program (PP),
Instruction times (device grade 6) and Table 16: Instruction times (device grade 3)).
4.2 Sector Erase and Bulk Erase
The Page Program (PP) instruction allows bits to be reset from 1 to 0. Before this can be
applied, the bytes of memory need to have been erased to all 1s (FFh). This can be
achieved either a sector at a time, using the Sector Erase (SE) instruction, or throughout the
entire memory, using the Bulk Erase (BE) instruction. This starts an internal Erase cycle (of
duration t
The Erase instruction must be preceded by a Write Enable (WREN) instruction.
or tBE).
SE
PP
).
4.3 Polling during a Write, Program or Erase cycle
A further improvement in the time to Write Status Register (WRSR), Program (PP) or Erase
(SE or BE) can be achieved by not waiting for the worst case delay (t
Write In Progress (WIP) bit is provided in the Status Register so that the application program
can monitor its value, polling it to establish when the previous Write cycle, Program cycle or
Erase cycle is complete.
, tPP, tSE, or tBE). The
W
4.4 Active Power, Standby Power and Deep Power-down modes
When Chip Select (S) is Low, the device is selected, and in the Active Power mode.
When Chip Select (S
mode until all internal cycles have completed (Program, Erase, Write Status Register). The
device then goes in to the Standby Power mode. The device consumption drops to I
The Deep Power-down mode is entered when the specific instruction (the Deep Powerdown (DP) instruction) is executed. The device consumption drops further to I
device remains in this mode until another specific instruction (the Release from Deep
Power-down and Read Electronic Signature (RES) instruction) is executed.
All other instructions are ignored while the device is in the Deep Power-down mode. This
can be used as an extra software protection mechanism, when the device is not in active
use, to protect the device from inadvertent Write, Program or Erase instructions.
) is High, the device is deselected, but could remain in the Active Power
.
CC1
. The
CC2
12/53
M25P40Operating features
4.5 Status Register
The Status Register contains a number of status and control bits that can be read or set (as
appropriate) by specific instructions. For a detailed description of the Status Register bits,
see Section 6.4: Read Status Register (RDSR).
4.6 Protection modes
The environments where non-volatile memory devices are used can be very noisy. No SPI
device can operate correctly in the presence of excessive noise. To help combat this, the
M25P40 features the following data protection mechanisms:
●Power On Reset and an internal timer (t
changes while the power supply is outside the operating specification.
●Program, Erase and Write Status Register instructions are checked that they consist of
a number of clock pulses that is a multiple of eight, before they are accepted for
execution.
●All instructions that modify data must be preceded by a Write Enable (WREN)
instruction to set the Write Enable Latch (WEL) bit. This bit is returned to its reset state
by the following events:
●The Block Protect (BP2, BP1, BP0) bits allow part of the memory to be configured as
read-only. This is the Software Protected Mode (SPM).
●The Write Protect (W) signal allows the Block Protect (BP2, BP1, BP0) bits and Status
Register Write Disable (SRWD) bit to be protected. This is the Hardware Protected
Mode (HPM).
●In addition to the low power consumption feature, the Deep Power-down mode offers
extra software protection from inadvertent Write, Program and Erase instructions, as all
instructions are ignored except one particular instruction (the Release from Deep
Power-down instruction).
) can provide protection against inadvertent
PUW
13/53
Operating featuresM25P40
Table 2.Protected area sizes
Status Register
content
BP2
BP1
BP0
bit
bit
bit
0 0 0 none All sectors
0 0 1 Upper eighth (Sector 7)
0 1 0 Upper quarter (two sectors: 6 and 7) Lower three-quarters (six sectors: 0 to 5)
0 1 1 Upper half (four sectors: 4 to 7)Lower half (four sectors: 0 to 3)
1 0 0 All sectors (eight sectors: 0 to 7)none
1 0 1 All sectors (eight sectors: 0 to 7)none
1 1 0 All sectors (eight sectors: 0 to 7)none
1 1 1 All sectors (eight sectors: 0 to 7)none
1. The device is ready to accept a Bulk Erase instruction if, and only if, all Block Protect (BP2, BP1, BP0) are
0.
4.7 Hold condition
The Hold (HOLD) signal is used to pause any serial communications with the device without
resetting the clocking sequence. However, taking this signal Low does not terminate any
Write Status Register, Program or Erase cycle that is currently in progress.
Memory content
Protected areaUnprotected area
(1)
(eight sectors: 0 to 7)
Lower seven-eighths (seven sectors: 0 to
6)
To enter the Hold condition, the device must be selected, with Chip Select (S
The Hold condition starts on the falling edge of the Hold (HOLD
) signal, provided that this
) Low.
coincides with Serial Clock (C) being Low (as shown in Figure 5).
The Hold condition ends on the rising edge of the Hold (HOLD
) signal, provided that this
coincides with Serial Clock (C) being Low.
If the falling edge does not coincide with Serial Clock (C) being Low, the Hold condition
starts after Serial Clock (C) next goes Low. Similarly, if the rising edge does not coincide
with Serial Clock (C) being Low, the Hold condition ends after Serial Clock (C) next goes
Low. (This is shown in Figure 5).
During the Hold condition, the Serial Data output (Q) is high impedance, and Serial Data
input (D) and Serial Clock (C) are Don’t Care.
Normally, the device is kept selected, with Chip Select (S
) driven Low, for the whole duration
of the Hold condition. This is to ensure that the state of the internal logic remains unchanged
from the moment of entering the Hold condition.
If Chip Select (S
) goes High while the device is in the Hold condition, this has the effect of
resetting the internal logic of the device. To restart communication with the device, it is
necessary to drive Hold (HOLD
) High, and then to drive Chip Select (S) Low. This prevents
the device from going back to the Hold condition.
14/53
M25P40Operating features
Figure 5.Hold condition activation
C
HOLD
Hold
Condition
(standard use)
Hold
Condition
(non-standard use)
AI02029D
15/53
Memory organizationM25P40
5 Memory organization
The memory is organized as:
●524,288 bytes (8 bits each)
●8 sectors (512 Kbits, 65536 bytes each)
●2048 pages (256 bytes each).
Each page can be individually programmed (bits are programmed from 1 to 0). The device is
Sector or Bulk Erasable (bits are erased from 0 to 1) but not Page Erasable.
Table 3.Memory organization
Sector Address range
770000h7FFFFh
660000h6FFFFh
550000h5FFFFh
440000h4FFFFh
3 30000h3FFFFh
2 20000h2FFFFh
1 10000h1FFFFh
0 00000h0FFFFh
16/53
Loading...
+ 37 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.