Instructions M95040, M95020, M95010
16/42
6 Instructions
Each instruction starts with a single-byte code, as summarized in Ta bl e 4 .
If an invalid instruction is sent (one not contained in Tabl e 4), the device automatically
deselects itself.
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
) 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.
Figure 7. Write Enable (WREN) sequence
Table 4. Instruction set
Instruction Description Instruction Format
WREN Write Enable 0000 X110
(1)
1. X = Don’t Care.
WRDI Write Disable 0000 X100
(1)
RDSR Read Status Register 0000 X101
(1)
WRSR Write Status Register 0000 X001
(1)
READ Read from Memory Array 0000 A
8
011
(2)
2. A8 = 1 for the upper half of the memory array of the M95040, and 0 for the lower half, and is Don’t Care for
other devices.
WRITE Write to Memory Array 0000 A
8
010
(2)
C
D
AI01441D
S
Q
21 34567
High Impedance
0
Instruction
M95040, M95020, M95010 Instructions
17/42
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
C
D
AI03790D
S
Q
21 34567
High Impedance
0
Instruction
Instructions M95040, M95020, M95010
18/42
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 9, 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 on-going 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:
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 Tabl e 3) 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.
Table 5. Status Register format
b7 b0
1 1 1 1 BP1 BP0 WEL WIP
Block Protect bits
Write Enable Latch bit
Write In Progress bit

M95020-MN6

Mfr. #:
Manufacturer:
STMicroelectronics
Description:
EEPROM 5.5V 2K (256x8)
Lifecycle:
New from this manufacturer.
Delivery:
DHL FedEx Ups TNT EMS
Payment:
T/T Paypal Visa MoneyGram Western Union

Products related to this Datasheet