To help protect the device from data corruption in noisy or poorly controlled environments, a
number of safety features have been built in to the device. The main security measures can
be summarized as follows:
●The WEL bit is reset at power-up.
●Chip Select (S) must rise after the eighth clock count (or multiple thereof) in order to
start a non-volatile Write cycle (in the memory array or in the Status register).
●Accesses to the memory array are ignored during the non-volatile programming cycle,
and the programming cycle continues unaffected.
●Invalid Chip Select (S) and Hold (HOLD) transitions are ignored.
For any instruction to be accepted and executed, Chip Select (S
) must be driven high after
the rising edge of Serial Clock (C) that latches the last bit of the instruction, and before the
next rising edge of Serial Clock (C).
For this, “the last bit of the instruction” can be the eighth bit of the instruction code, or the
eighth bit of a data byte, depending on the instruction (except in the case of RDSR and
READ instructions). Moreover, the “next rising edge of CLOCK” might (or might not) be the
next bus transaction for some other device on the bus.
When a Write cycle is in progress, the device protects it against external interruption by
ignoring any subsequent READ, WRITE or WRSR instruction until the present cycle is
complete.
Each instruction starts with a single-byte code, as summarized in Ta b le 3 .
If an invalid instruction is sent (one not contained in Ta bl e 3 ), the device automatically
deselects itself.
Table 3.Instruction set
InstructionDescriptionInstruction Format
WRENWrite Enable0000 X110
WRDIWrite Disable0000 X100
RDSRRead Status Register0000 X101
WRSRWrite Status Register0000 X001
READRead from Memory Array0000 A8011
WRITEWrite to Memory Array 0000 A8010
1. X = Don’t Care.
2. A8 = 1 for the upper half of the memory array of the M95040-125, and 0 for the lower half, and is Don’t
Care for other devices.
(1)
(1)
(1)
(1)
(2)
(2)
6.1 Write Enable (WREN)
The Write Enable Latch (WEL) bit must be set prior to each WRITE and WRSR instruction.
The only way to do this is to send a Write Enable instruction to the device.
As shown in Figure 7, to send this instruction to the device, Chip Select (S
and the bits of the instruction byte are shifted in, on Serial Data Input (D). The device then
enters a wait state. It waits for a the device to be deselected, by Chip Select (S
high.
Figure 7.Write Enable (WREN) sequence
) is driven low,
) being driven
16/36Doc ID 022545 Rev 1
M95040-125, M95020-125, M95010-125Instructions
C
D
AI03790D
S
Q
2134567
High Impedance
0
Instruction
6.2 Write Disable (WRDI)
One way of resetting the Write Enable Latch (WEL) bit is to send a Write Disable instruction
to the device.
As shown in Figure 8, to send this instruction to the device, Chip Select (S
) is driven low,
and the bits of the instruction byte are shifted in, on Serial Data Input (D).
The device then enters a wait state. It waits for a the device to be deselected, by Chip Select
(S
) being driven high.
The Write Enable Latch (WEL) bit, in fact, becomes reset by any of the following events:
●Power-up
●WRDI instruction execution
●WRSR instruction completion
●WRITE instruction completion
●Write Protect (W) line being held low.
Figure 8.Write Disable (WRDI) sequence
Doc ID 022545 Rev 117/36
InstructionsM95040-125, M95020-125, M95010-125
6.3 Read Status Register (RDSR)
One of the major uses of this instruction is to allow the MCU to poll the state of the Write In
Progress (WIP) bit. This is needed because the device will not accept further WRITE or
WRSR instructions when the previous Write cycle is not yet finished.
As shown in Figure 8, to send this instruction to the device, Chip Select (S
) is first driven low.
The bits of the instruction byte are then shifted in, on Serial Data Input (D). The current state
of the bits in the Status register is shifted out, on Serial Data Out (Q). The Read Cycle is
terminated by driving Chip Select (S
) high.
The Status register may be read at any time, even during a Write cycle (whether it be to the
memory area or to the Status register). All bits of the Status register remain valid, and can
be read using the RDSR instruction. However, during the current Write cycle, the values of
the non-volatile bits (BP0, BP1) become frozen at a constant value. The updated value of
these bits becomes available when a new RDSR instruction is executed, after completion of
the Write cycle. On the other hand, the two read-only bits (Write Enable Latch (WEL), Write
In Progress (WIP)) are dynamically updated during the ongoing Write cycle.
Bits b7, b6, b5 and b4 are always read as 1. The status and control bits of the Status
register are as follows:
Table 4.Status register format
b7 b0
1 1 1 1 BP1 BP0 WEL WIP
Block Protect bits
Write Enable Latch bit
Write In Progress bit
6.3.1 WIP bit
The Write In Progress (WIP) bit indicates whether the memory is busy with a Write or Write
Status register cycle. When set to 1, such a cycle is in progress, when reset to 0 no such
cycle is in progress.
6.3.2 WEL bit
The Write Enable Latch (WEL) bit indicates the status of the internal Write Enable Latch.
When set to 1 the internal Write Enable Latch is set, when set to 0 the internal Write Enable
Latch is reset and no Write or Write Status Register instruction is accepted.
6.3.3 BP1, BP0 bits
The Block Protect (BP1, BP0) bits are non-volatile. They define the size of the area to be
software protected against Write instructions. These bits are written with the Write Status
Register (WRSR) instruction. When one or both of the Block Protect (BP1, BP0) bits is set to
1, the relevant memory area (as defined in Table 2: Write-protected block size) becomes
protected against Write (WRITE) instructions. The Block Protect (BP1, BP0) bits can be
written provided that the Hardware Protected mode has not been set.
18/36Doc ID 022545 Rev 1
M95040-125, M95020-125, M95010-125Instructions
C
D
S
213456789101112131415
Instruction
0
AI01444D
Q
7 6543210
Status Register Out
High Impedance
MSB
7 6543210
Status Register Out
MSB
7
Figure 9.Read Status Register (RDSR) sequence
Doc ID 022545 Rev 119/36
InstructionsM95040-125, M95020-125, M95010-125
C
D
AI01445B
S
Q
213456789101112131415
High Impedance
InstructionStatus
Register In
0
7654320
1
MSB
6.4 Write Status Register (WRSR)
The Write Status Register (WRSR) instruction allows new values to be written to the Status
register. Before it can be accepted, a Write Enable (WREN) instruction must previously have
been executed.
The Write Status Register (WRSR) instruction is entered by driving Chip Select (S
) low,
sending the instruction code followed by the data byte on Serial Data input (D), and driving
the Chip Select (S
) signal high. Chip Select (S) must be driven high after the rising edge of
Serial Clock (C) that latches in the eighth bit of the data byte, and before the next rising edge
of Serial Clock (C). Otherwise, the Write Status Register (WRSR) instruction is not
executed.
Driving the Chip Select (S
timed write cycle that takes t
) signal high at a byte boundary of the input data triggers the self-
to complete (as specified in AC tables under Section 9: DC
W
and AC parameters). The instruction sequence is shown in Figure 10.
While the Write Status Register cycle is in progress, the Status register may still be read to
check the value of the Write in progress (WIP) bit: the WIP bit is 1 during the self-timed write
cycle t
reset at the end of the write cycle t
, and, 0 when the write cycle is complete. The WEL bit (Write enable latch) is also
W
.
W
The Write Status Register (WRSR) instruction allows the user to change the values of the
BP1, BP0 bits which define the size of the area that is to be treated as read only, as defined
in Table 2: Write-protected block size.
The contents of the BP1, BP0 bits are updated after the completion of the WRSR
instruction, including the t
write cycle.
W
The Write Status Register (WRSR) instruction has no effect on the b7, b6, b5, b4, b1 and b0
bits in the Status register. Bits b7, b6, b5, b4 are always read as 0.
Figure 10. Write Status Register (WRSR) sequence
The instruction is not accepted, and is not executed, under the following conditions:
●if the Write Enable Latch (WEL) bit has not been set to 1 (by executing a Write Enable
instruction just before)
●if a write cycle is already in progress
●if the device has not been deselected, by Chip Select (S) being driven high, after the
20/36Doc ID 022545 Rev 1
eighth bit, b0, of the data byte has been latched in
●if Write Protect (W) is low during the WRSR command (instruction, address and data)
M95040-125, M95020-125, M95010-125Instructions
C
D
AI01440E
S
Q
A7
21345678910111213141516171819
A6 A5 A4 A3 A2 A1 A0A8
20 21 22
76543
2
0
1
High Impedance
Data Out
InstructionByte Address
0
6.5 Read from Memory Array (READ)
As shown in Figure 11, to send this instruction to the device, Chip Select (S) is first driven
low. The bits of the instruction byte and address byte are then shifted in, on Serial Data Input
(D). For the M95040, the most significant address bit, A8, is incorporated as bit b3 of the
instruction byte, as shown in Table 3: Instruction set. The address is loaded into an internal
address register, and the byte of data at that address is shifted out, on Serial Data Output
(Q).
If Chip Select (S
) continues to be driven low, an internal bit-pointer is automatically
incremented at each clock cycle, and the corresponding data bit is shifted out.
When the highest address is reached, the address counter rolls over to zero, allowing the
Read cycle to be continued indefinitely. The whole memory can, therefore, be read with a
single READ instruction.
The Read cycle is terminated by driving Chip Select (S
Select (S
) signal can occur at any time during the cycle.
) high. The rising edge of the Chip
The first byte addressed can be any byte within any page.
The instruction is not accepted, and is not executed, if a Write cycle is currently in progress.
Table 5.Address range bits
Device M95040-125 M95020-125M95010-125
Address bitsA8-A0A7-A0A6-A0
Figure 11. Read from Memory Array (READ) sequence
1. Depending on the memory size, as shown in Table 5: Address range bits, the most significant address bits
are Don’t Care.
Doc ID 022545 Rev 121/36
InstructionsM95040-125, M95020-125, M95010-125
AI01442D
C
D
S
Q
A7
21345678910111213141516171819
A6 A5 A4 A3 A2 A1 A0A8
20 21 22 23
High Impedance
InstructionByte Address
0
7654320
1
Data Byte
6.6 Write to Memory Array (WRITE)
As shown in Figure 12, to send this instruction to the device, Chip Select (S) is first driven
low. The bits of the instruction byte, address byte, and at least one data byte are then shifted
in, on Serial Data input (D). The instruction is terminated by driving Chip Select (S
byte boundary of the input data. The self-timed Write cycle, triggered by the rising edge of
Chip Select (S
), continues for a period tW (as specified in tables under Section 9: DC and
AC parameters). After this time, the Write in Progress (WIP) bit is reset to 0.
) high at a
In the case of Figure 12, Chip Select (S
has been latched in, indicating that the instruction is being used to write a single byte. If,
though, Chip Select (S
) continues to be driven low, as shown in Figure 13, the next byte of
input data is shifted in, so that more than a single byte, starting from the given address
towards the end of the same page, can be written in a single internal Write cycle. If Chip
Select (S
) still continues to be driven low, the next byte of input data is shifted in, and used to
overwrite the byte at the start of the current page.
The instruction is not accepted, and is not executed, under the following conditions:
●if the Write Enable Latch (WEL) bit has not been set to 1 (by executing a Write Enable
instruction just before)
●if a Write cycle is already in progress
●if the device has not been deselected, by Chip Select (S) being driven high, at a byte
boundary (after the rising edge of Serial Clock (C) that latches the last data bit, and
before the next rising edge of Serial Clock (C) occurs anywhere on the bus)
●if Write Protect (W) is low or if the addressed page is in the area protected by the Block
Protect (BP1 and BP0) bits
Note:The self-timed write cycle t
events: [Erase addressed byte(s)], followed by [Program addressed byte(s)]. An erased bit is
read as “0” and a programmed bit is read as “1”.
Figure 12. Byte Write (WRITE) sequence
) is driven high after the eighth bit of the data byte
is internally executed as a sequence of two consecutive
W
1. Depending on the memory size, as shown in Table 5: Address range bits, the most significant address bits
are Don’t Care.
22/36Doc ID 022545 Rev 1
M95040-125, M95020-125, M95010-125Instructions
C
D
S
2134567891011121314151617181920 21 22 23
InstructionByte Address
0
Data Byte 1
C
D
AI01443D
S
262527 28 29 30 31
8+8N
24
Data Byte 16
9+8N
10+8N
11+8N
12+8N
13+8N
14+8N
15+8N
136
137
138
139
140
141
142
143
Data Byte N
763210
54
Data Byte 2
7
A7 A6 A5 A4 A3 A2 A1 A0A87654320
1
7 65432107654320
1
Figure 13. Page Write (WRITE) sequence
1. Depending on the memory size, as shown in Table 5: Address range bits, the most significant address bits
are Don’t Care.
Doc ID 022545 Rev 123/36
Power-up and delivery statesM95040-125, M95020-125, M95010-125
7 Power-up and delivery states
7.1 Power-up state
After power-up, the device is in the following state:
●low power Standby Power mode
●deselected (after Power-up, a falling edge is required on Chip Select (S) before any
instructions can be started).
●not in the Hold Condition
●the Write Enable Latch (WEL) is reset to 0
●Write In Progress (WIP) is reset to 0
The BP1 and BP0 bits of the Status register are unchanged from the previous power-down
(they are non-volatile bits).
7.2 Initial delivery state
The device is delivered with the memory array set at all 1s (FFh). The Block Protect (BP1
and BP0) bits are initialized to 0.
24/36Doc ID 022545 Rev 1
M95040-125, M95020-125, M95010-125Maximum rating
8 Maximum rating
Stressing the device outside the ratings listed in Ta bl e 6 may cause permanent damage to
the device. These are stress ratings only, and operation of the device at these, or any other
conditions outside those indicated in the operating sections of this specification, is not
implied. Exposure to absolute maximum rating conditions for extended periods may affect
device reliability.
Table 6.Absolute maximum ratings
SymbolParameterMin.Max.Unit
Ambient operating temperature–40130°C
T
STG
T
LEAD
V
O
V
I
I
OL
I
IH
V
CC
V
ESD
1. Compliant with JEDEC Std J-STD-020 (for small body, Sn-Pb or Pb assembly), with the ST ECOPACK®
7191395 specification, and with the European directive on Restrictions on Hazardous Substances (RoHS)
2002/95/EU.
2. Positive and negative pulses applied on pin pairs, according to the AEC-Q100-002 (compliant with JEDEC
Std JESD22-A114, C1=100pF, R1=1500Ω, R2=500Ω)
Storage temperature–65150°C
Lead temperature during solderingsee note
(1)
°C
Output voltage–0.50VCC+0.6V
Input voltage–0.506.5V
DC output current (Q = 0)-5mA
DC output current (Q = 1)-5mA
Supply voltage–0.506.5V
Electrostatic pulse (Human Body Model) voltage
(2)
-4000V
Doc ID 022545 Rev 125/36
DC and AC parametersM95040-125, M95020-125, M95010-125
!)#
6
##
6
##
6
##
6
##
)NPUTANDOUTPUT
TIMINGREFERENCELEVELS
)NPUTVOLTAGELEVELS
9 DC and AC parameters
This section summarizes the operating and measurement conditions, and the DC and AC
characteristics of the device. The parameters in the DC and AC characteristic tables that
follow are derived from tests performed under the measurement conditions summarized in
the relevant tables. Designers should check that the operating conditions in their circuit
match the measurement conditions when relying on the quoted parameters.
In order to meet environmental requirements, ST offers these devices in different grades of
ECOPACK
specifications, grade definitions and product status are available at: www.st.com.
ECOPACK
®
packages, depending on their level of environmental compliance. ECOPACK®
®
is an ST trademark.
Figure 18. SO8N — 8-lead plastic small outline 150 mils body width, package outline
1. Drawing is not to scale.
Table 15.SO8N — 8-lead plastic small outline, 150 mils body width, package
mechanical data
millimetersinches
Symbol
TypMinMaxTypMinMax
(1)
A--1.75--0.0689
A1-0.10.25-0.00390.0098
A2-1.25--0.0492-
b-0.280.48-0.0110.0189
c-0.170.23-0.00670.0091
ccc--0.1--0.0039
D4.94.850.19290.1890.1969
E65.86.20.23620.22830.2441
E13.93.840.15350.14960.1575
e1.27--0.05--
h-0.250.5-0.00980.0197
k-0°8°-0°8°
L-0.41.27-0.01570.05
32/36Doc ID 022545 Rev 1
L11.04--0.0409--
1. Values in inches are converted from mm and rounded to 4 decimal digits.
M95040-125, M95020-125, M95010-125Package mechanical data
Table 16.TSSOP8 — 8-lead thin shrink small outline, package mechanical data
millimetersinches
Symbol
TypMinMaxTypMinMax
(1)
A--1.2--0.0472
A1-0.050.15-0.0020.0059
A210.81.050.03940.03150.0413
b-0.190.3-0.00750.0118
c-0.090.2-0.00350.0079
CP--0.1--0.0039
D32.93.10.11810.11420.122
e0.65--0.0256--
E6.46.26.60.2520.24410.2598
E14.44.34.50.17320.16930.1772
L0.60.450.750.02360.01770.0295
L11--0.0394--
α-0°8°-0°8°
N (number of leads)88
1. Values in inches are converted from mm and rounded to 4 decimal digits.
Doc ID 022545 Rev 133/36
Part numberingM95040-125, M95020-125, M95010-125
11 Part numbering
Table 17.Ordering information scheme
Example:M95040–W MN 3 T P /S
Device type
M95 = SPI serial access EEPROM
Device function
040 = 4 Kbit (512 x 8)
020 = 2 Kbit (256 x 8)
010 = 1 Kbit (128 x 8)
Operating voltage
blank = V
W = VCC = 2.5 to 5.5V
Package
MN = SO8 (150 mil width)
DW = TSSOP8 (169 mil width)
= 4.5 to 5.5V
CC
Device grade
3 = Device tested with high reliability certified flow.
Automotive temperature range (–40 to 125 °C)
Option
blank = Standard packing
T = Tape and reel packing
Plating technology
P = RoHS compliant and halogen-free (ECOPACK
Process
/S = Manufacturing technology code
®
)
For a list of available options (speed, package, etc.) or for further information on any aspect
of this device, please contact your nearest ST sales office.
34/36Doc ID 022545 Rev 1
M95040-125, M95020-125, M95010-125Revision history
12 Revision history
Table 18.Document revision history
DateVersionChanges
02-Jan-20121Initial release.
Doc ID 022545 Rev 135/36
M95040-125, M95020-125, M95010-125
Please Read Carefully:
Information in this document is provided solely in connection with ST products. STMicroelectronics NV and its subsidiaries (“ST”) reserve the
right to make changes, corrections, modifications or improvements, to this document, and the products and services described herein at any
time, without notice.
All ST products are sold pursuant to ST’s terms and conditions of sale.
Purchasers are solely responsible for the choice, selection and use of the ST products and services described herein, and ST assumes no
liability whatsoever relating to the choice, selection or use of the ST products and services described herein.
No license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted under this document. If any part of this
document refers to any third party products or services it shall not be deemed a license grant by ST for the use of such third party products
or services, or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoever of such
third party products or services or any intellectual property contained therein.
UNLESS OTHERWISE SET FORTH IN ST’S TERMS AND CONDITIONS OF SALE ST DISCLAIMS ANY EXPRESS OR IMPLIED
WARRANTY WITH RESPECT TO THE USE AND/OR SALE OF ST PRODUCTS INCLUDING WITHOUT LIMITATION IMPLIED
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE (AND THEIR EQUIVALENTS UNDER THE LAWS
OF ANY JURISDICTION), OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT.
UNLESS EXPRESSLY APPROVED IN WRITING BY TWO AUTHORIZED ST REPRESENTATIVES, ST PRODUCTS ARE NOT
RECOMMENDED, AUTHORIZED OR WARRANTED FOR USE IN MILITARY, AIR CRAFT, SPACE, LIFE SAVING, OR LIFE SUSTAINING
APPLICATIONS, NOR IN PRODUCTS OR SYSTEMS WHERE FAILURE OR MALFUNCTION MAY RESULT IN PERSONAL INJURY,
DEATH, OR SEVERE PROPERTY OR ENVIRONMENTAL DAMAGE. ST PRODUCTS WHICH ARE NOT SPECIFIED AS "AUTOMOTIVE
GRADE" MAY ONLY BE USED IN AUTOMOTIVE APPLICATIONS AT USER’S OWN RISK.
Resale of ST products with provisions different from the statements and/or technical features set forth in this document shall immediately void
any warranty granted by ST for the ST product or service described herein and shall not create or extend in any manner whatsoever, any
liability of ST.
ST and the ST logo are trademarks or registered trademarks of ST in various countries.
Information in this document supersedes and replaces all information previously supplied.
The ST logo is a registered trademark of STMicroelectronics. All other names are the property of their respective owners.