Professional Documents
Culture Documents
Existing System
Keeping the same concern in mind many developers have come up with
innovative applications. Few of such applications are as follows-
1. VithU app:
This is an emergency app initiated by a popular Indiancrime television series
Gumrah aired on Channel in this app when the power button of the Smartphone is
pressed twice consecutively, it will begin sending out alert messages with a link to the
location of the user every two minutes to the contacts fed into the app.
2. SHE (Society Harnessing Equipment):
It is a garment designed by three engineers from Chennai. This garment has an
electric circuit that can generate 3800kv of current which can help the victim to
escape. In case of multiple attacks, it can send up to 82 electric shocks. Since the
fabric is bilayer, the user is not affected. It can also send emergency messages.
3. ILA security:
The co-founders of this system, McGivern, James Phillips, and Neil Munn,
have designed three personal alarms that can shock and disorient potential attackers
and draw attention to dangerous situations.
4. Using Pressure Sensors:
The proposed system is to designa portable device which resembles a normal
belt. It consists of Arduino Board, threshold of the pressure sensor crosses, the device
will get activated automatically. Immediately the location of the victim will be tracked
with the help of GPS and emergency messages will be sent to three contacts and one
to police control room every two minutes with updated location. The screaming alarm
unit will be activated and will send out sirens to call out for help.
Step supply
Bridge Filter
down Regulator
Rectifier Circuit
T/F
Power to all sections
Transformer:
Usually, D.C voltages are required to operate various electronic equipment
and these voltages are 5V, 9V or 12V. But these voltages cannot be obtained
directly. Thus the A.C input available at the mains supply i.e., 230V is to be
brought down to the required voltage level. This is done by a transformer. Thus, a
step down transformer is employed to decrease the voltage to a required level.
Rectifier:
The output from the transformer is fed to the rectifier. It converts A.C. into
pulsating D.C. The rectifier may be a half wave or a full wave rectifier. In this
project, a bridge rectifier is used because of its merits like good stability and full
wave rectification.
Filter:
Capacitive filter is used in this project. It removes the ripples from the
output of rectifier and smoothens the D.C. Output received from this filter is
constant until the mains voltage and load is maintained constant. However, if either
of the two is varied, D.C. voltage received at this point changes. Therefore, a
regulator is applied at the output stage.
Voltage regulator:
As the name itself implies, it regulates the input applied to it. A voltage
regulator is an electrical regulator designed to automatically maintain a constant
voltage level. In this project, power supply of 5V and 12V are required. In order to
obtain these voltage levels, 7805 and 7812 voltage regulators are to be used. The
first number 78 represents positive supply and the numbers 05, 12 represent the
required output voltage levels.
The software residing on the memory chip is also called the firmware. The
embedded system architecture can be represented as a layered architecture as shown
in Fig.
The operating system runs above the hardware, and the application software
runs above the operating system. The same architecture is applicable to any
computer including a desktop computer. However, there are significant differences.
It is not compulsory to have an operating system in every embedded system. For
small appliances such as remote control units, air conditioners, toys etc., there is no
need for an operating system and you can write only the software specific to that
application.
Now, let us see the details of the various building blocks of the hardware of an
embedded system.
Memory:
The memory is categorized as Random Access 11emory (RAM) and Read
Only Memory (ROM). The contents of the RAM will be erased if power is switched
off to the chip, whereas ROM retains the contents even if the power is switched off.
So, the firmware is stored in the ROM. When power is switched on, the processor
reads the ROM; the program is program is executed.
Input devices:
Unlike the desktops, the input devices to an embedded system have very
limited capability. There will be no keyboard or a mouse, and hence interacting with
the embedded system is no easy task. Many embedded systems will have a small
keypad-you press one key to give a specific command. A keypad may be used to
input only the digits. Many embedded systems used in process control do not have
any input device for user interaction; they take inputs from sensors or transducers
1fnd produce electrical signals that are in turn fed to other systems.
Output devices:
The output devices of the embedded systems also have very limited
capability. Some embedded systems will have a few Light Emitting Diodes (LEDs)
to indicate the health status of the system modules, or for visual indication of
alarms. A small Liquid Crystal Display (LCD) may also be used to display some
important parameters.
Communication interfaces:
The embedded systems may need to, interact with other embedded systems
at they may have to transmit data to a desktop. To facilitate this, the embedded
systems are provided with one or a few communication interfaces such as RS232,
RS422, RS485, Universal Serial Bus (USB), IEEE 1394, Ethernet etc.
Application-specific circuitry:
Sensors, transducers, special processing and control circuitry may be
required fat an embedded system, depending on its application. This circuitry
interacts with the processor to carry out the necessary work. The entire hardware
has to be given power supply either through the 230 volts main supply or through a
battery. The hardware has to design in such a way that the power consumption is
minimized.
Introduction to Microcontrollers:
Microprocessors and microcontrollers are widely used in embedded systems
products. Microcontroller is a programmable device. A microcontroller has a CPU
in addition to a fixed amount of RAM, ROM, I/O ports and a timer embedded all on
a single chip. The fixed amount of on-chip ROM, RAM and number of I/O ports in
microcontrollers makes them ideal for many applications in which cost and space
are critical.
The Intel 8052 is Harvard architecture, single chip microcontroller (C)
which was developed by Intel in 1980 for use in embedded systems. It was popular
in the 1980s and early 1990s, but today it has largely been superseded by a vast
range of enhanced devices with 8052-compatible processor cores that are
manufactured by more than 20 independent manufacturers including Atmel,
Infineon Technologies and Maxim Integrated Products.
8052 is an 8 -bit processor, meaning that the CPU can work on only 8 bits of
data at a time. Data larger than 8 bits has to be broken into 8-bit pieces to be
processed by the CPU. 8052 is available in different memory types such as UV-
EPROM, Flash and NV-RAM.
The features, pin description of the microcontroller and the software tools
used are discussed in the following sections.
FEATURES
Compatible with MCS-51 Products
8K Bytes of In-System Programmable (ISP) Flash Memory
Endurance: 1000 Write/Erase Cycles
4.0V to 5.5V Operating Range
Fully Static Operation: 0 Hz to 33 MHz
Three-level Program Memory Lock
256 x 8-bit Internal RAM
The Idle Mode stops the CPU while allowing the RAM, timer/counters,
serial port, and interrupt system to continue functioning. The Power- down mode
saves the RAM contents but freezes the oscillator, disabling all other chip functions
until the next interrupt or hardware reset.
BLOCK DIAGRAM
PIN DESCRIPTION
VCC : Supply voltage.
GND: Ground.
Port 0
Port 0 is an 8-bit open drain bidirectional I/O port. As an output port, each
pin can sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be
used as high impedance inputs. Port 0 can also be configured to be the multiplexed
low order address/data bus during accesses to external program and data memory. In
this mode, P0 has internal pull- ups. Port 0 also receives the code bytes during Flash
programming and outputs the code bytes during program verification. External pull-
ups are required during program verification.
Port 1
Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 1
output buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins,
they are pulled high by the internal pull-ups and can be used as inputs. As inputs,
Port 1 pins that are externally being pulled low will source current (IIL) because of
the internal pull-ups. In addition, P1.0 and P1.1 can be configured to be the
timer/counter 2 external count input (P1.0/T2) and the timer/counter 2 trigger input
(P1.1/T2EX), respectively, as shown in the following table. Port 1 also receives the
low-order address bytes during Flash programming and verification.
Port 2
Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 2
output buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins,
they are pulled high by the internal pull-ups and can be used as inputs. As inputs,
Port 2 pins that are externally being pulled low will source current (IIL) because of
the internal pull-ups. Port 2 emits the high-order address byte during fetches from
external program memory and during accesses to external data memory that use 16-
bit addresses (MOVX @ DPTR). In this application, Port 2 uses strong internal pull
-ups when emitting 1s. During accesses to external data memory that use 8-bit
addresses (MOVX @ RI), Port 2 emits the contents of the P2 Special Function
Register. Port 2 also receives the high-order address bits and some control signals
during Flash programming and verification.
Port 3
Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 3 output
buffers can sink/source four TTL inputs. When 1s are written to Port 3 pins, they are
pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 3 pins
that are externally being pulled low will source current (IIL) because of the pull-
ups. Port 3 also serves the functions of various special features of the AT89S52, as
shown in the following table. Port 3 also receives some control signals for Flash
programming and verification.
RST
Reset input. A high on this pin for two machine cycles while the oscillator is
running resets the device. This pin drives High for 96 oscillator periods after the
Watchdog times out. The DISRTO bit in SFR AUXR (address 8EH) can be used to
disable this feature. In the default state of bit DISRTO, the RESET HIGH out
feature is enabled.
ALE/PROG
Address Latch Enable (ALE) is an output pulse for latching the low byte of the
address during accesses to external memory. This pin is also the program pulse
input (PROG) during Flash programming. In normal operation, ALE is emitted at a
constant rate of 1/6 the oscillator frequency and may be used for external timing or
clocking purposes. Note, however, that one ALE pulse is skipped during each
access to external data memory. If desired, ALE operation can be disabled by setting
bit 0 of SFR location 8EH. With the bit set, ALE is active only during a MOVX or
MOVC instruction.
PSEN
Program Store Enable (PSEN) is the read strobe to external program memory. When
the AT89S52 is executing code from external program memory, PSEN is activated
twice each machine cycle, except that two PSEN activations are skipped during
each access to external data memory.
EA/VPP
External Access Enable. EA must be strapped to GND in order to enable the device
to fetch code from external program memory locations starting at 0000H up to
FFFFH. Note, however, that if lock bit 1 is programmed, EA will be internally
latched on reset. EA should be strapped to VCC for internal program executions.
This pin also receives the 12-volt programming enable voltage (VPP) during Flash
programming.
XTAL1
Input to the inverting oscillator amplifier and input to the internal clock operating
circuit.
XTAL2
Output from the inverting oscillator amplifier. XTAL1 and XTAL2 are the input and
output, respectively, of an inverting amplifier that can be configured for use as an on-
chip oscillator, as shown in Figure.
Either a quartz crystal or ceramic resonator may be used. To drive the device from an
external clock source, XTAL2 should be left unconnected while XTAL1 is driven, as
shown in the below figure. There are no requirements on the duty cycle of the external
clock signal, since the input to the internal clocking circuitry is through a divide-by-
two flip-flop, but minimum and maximum voltage high and low time specifications
must be observed.
However,All 8052 microcontrollers have 16-bit addressing bus and can address 64
kb memory. It is neither a mistake nor a big ambition of engineers who were
working on basic core development. It is a matter of very clever memory
organization which makes these controllers a real programmers tidbit .
Program Memory
The oldest models of the 8052 microcontroller family did not have any internal
program memory. It was added from outside as a separate chip. These models are
recognizable by their label beginning with 803 (for ex. 8031 or 8032) . All later
models have a few Kbytes ROM embedded, even though it is enough for writing
most of the programs, there are situations when additional memory is necessary. A
typical example of it is the use of so called lookup tables. They are used in cases
when something is too complicated or when there is no time for solving equations
describing some process. The example of it can be totally exotic (an estimate of
self-guided rockets meeting point) or totally common (measuring of temperature
using non-linear thermos element or asynchronous motor speed control). In those
cases, all needed estimates and approximates are executed in advance and the final
results are put in the tables (similar to logarithmic tables).
EA=0 In this case, internal program memory is completely ignored, only a program
stored in external memory is to be executed.
EA=1 In this case, a program from built-in ROM is to be executed first (to the last
location). Afterwards, the execution is continued by reading additional memory.
In both cases, P0 and P2 are not available to the user because they are used for data
and address transmission. Besides, the pins ALE and PSEN are used too.
Data Memory
As already mentioned, Data Memory is used for temporarily storing and
keeping data and intermediate results created and used during microcontrollers
operating. Besides, this microcontroller family includes many other registers such as:
hardware counters and timers, input/output ports, serial data buffers etc. The previous
versions have the total memory size of 256 locations, while for later models this
number is incremented by additional 128 available registers. In both cases, these first
256 memory locations (addresses 0- FFh) are the base of the memory. Common to all
types of the 8052 microcontrollers. Locations available to the user occupy memory
space with addresses from 0 to 7Fh. First 128 registers and this part of RAM is
divided in several blocks.
Using trick in this case means that additional memory block shares the same
addresses with existing locations intended for the SFRs (80h- FFh). In order to
differentiate between these two physically separated memory spaces, different ways
of addressing are used. A direct addressing is used for all locations in the SFRs,
while the locations from additional RAM are accessible using indirect addressing.
When the program during execution encounters the instruction which resides in
external memory (ROM), the microcontroller will activate its control output ALE
and set the first 8 bits of address(A0- A7) on P0.
In this way, IC circuit 74HCT573 which "lets in" the first 8 bits to memory address
pins is activated. A signal on the pin ALE closes the IC circuit 74HCT573 and
immediately afterwards 8 higher bits of address (A8-A15) appear on the port. In this
way, a desired location in additional program memory is completely addressed. The
only thing left over is to read its content.
Pins on P0 are configured as inputs, the pin PSEN is activated and the
microcontroller reads content from memory chip. The same connections are used
both for data and lower address byte.
Similar occurs when it is a needed to read some location from external Data
Memory. Now, addressing is performed in the same way, while reading or writing is
performed via signals which appear on the control outputs RD or WR.
Addressing
While operating, processor processes data according to the program
instructions. Each instruction consists of two parts. One part describes what should
be done and another part indicates what to use to do it. This later part can be data
(binary number) or address where the data is stored. All 8052 microcontrollers use
two ways of addressing depending on which part of memory should be accessed:
Direct Addressing
On direct addressing, a value is obtained from a memory location while the
address of that location is specified in instruction. Only after that, the instruction
can process data (how depends on the type of instruction: addition, subtraction,
copy). Obviously, a number being changed during operating a variable can reside
at that specified address. For example: Since the address is only one byte in size
(the greatest number is 255), this is how only the first 255 locations in RAM can be
accessed in this case the first half of the basic RAM is intended to be used freely,
while another half is reserved for the SFRs.
Indirect Addressing
On indirect addressing, a register which contains address of another register
is specified in the instruction. A value used in operating process resides in that
another register. For example: Only RAM locations available for use are accessed
by indirect addressing (never in the SFRs). For all latest versions of the
A Register (Accumulator)
B Register
R Registers (R0-R7)
This is a common name for the total 8 general purpose registers (R0, R1, R2
... R7). Even they are not true SFRs, they deserve to be discussed here because of
their purpose. The bank is active when the R registers it includes are in use. Similar
to the accumulator, they are used for temporary storing variables and intermediate
results. Which of the banks will be active depends on two bits included in the PSW
Register. These registers are stored in four banks in the scope of RAM.
It may help to think of a GPS receiver as similar to a standard radio. Like the
radio in your car, a GPS receiver is collecting radio signals from the ether and
magically turning these signals into information we can use. In the case of a GPS
receiver the stations are satellites broadcasting 11,000 miles away in space and
the music is a binary code, but the antenna and radio hardware are subject to similar
kinds of interference that affect your car radios ability to produce a clear sound. In
your car speaker we hear this interference as static; in your GPS receiver the
interference may result in positional static, i.e., degradation of accuracy.
Satellites
The United States Global Positioning System (GPS) is the first fully
operational Global Navigation Satellite System (GNSS). Each satellite broadcasts a
signal that is used by receivers to determine precise position anywhere in the world.
The receiver tracks multiple satellites and determines a pseudo range measurement
(a range measurement based on time) that is then used to determine the user
location. A minimum of four satellites is necessary to establish an accurate three-
dimensional position.
24 GPS satellites are currently in orbit around the earth. the first was
launched in 1972 and the latest satellite was launched in 2012. The maximum
available at any time from a point in Oregon is generally between 4 to 11. The
satellites send out radio signals that are collected and read by the GPS receiver.
GPS satellites broadcast signals from space that are picked up and identified
by GPS receivers. Each GPS receiver then provides three-dimensional location
(latitude, longitude, and altitude) plus the time.
SPACE SEGMENT:
24+ satellites
20,200 km altitude
55 degrees inclination 12-hour
orbital period
5 ground control stations
Each satellite passes over a ground monitoring station every 12 hours
The full constellation of 24 satellites that make up the GPS space segment
are orbiting the earth about 20,200 km above us. They are constantly moving,
making two complete orbits in less than 24 hours. These satellites are travelling at
speeds of roughly 7,000 miles an hour.
GPS satellites are powered by solar energy. They have backup batteries
onboard to keep them running in the event of a solar eclipse, when there's no solar
power. Small rocket boosters on each satellite keep them flying in the correct path.
Here are some other interesting facts about the GPS satellites (also called
NAVSTAR, the official U.S. Department of Defense name for GPS):
satellites broadcast at the same two frequencies, 1.57542 GHz (L1 signal) and 1.2276
GHz (L2 signal). The satellite network uses a CDMA spread- spectrum technique
where the low-bitrate message data is encoded with a high-rate pseudo-random (PRN)
sequence that is different for each satellite.
The receiver must be aware of the PRN codes for each satellite to reconstruct
the actual message data. The C/A code, for civilian use, transmits data at 1.023
million chips per second, whereas the P code, for U.S. military use.
Today's GPS receivers are extremely accurate, thanks to their parallel multi-
channel design. Garmin's 12 parallel channel receivers are quick to lock onto
satellites when first turned on and they maintain strong locks, even in dense
foliage or urban settings with tall buildings. Certain atmospheric factors and other
sources of error can affect.
Fig:
When people talk about "a GPS," they usually mean a GPS receiver. The
Global Positioning System (GPS) is actually a constellation of 24 Earth-orbiting
satellites The U.S. military developed and implemented this satellite network as a
military navigation system, but soon opened it up to everybody else.
The hardware connections required to connect to the ESP8266 module are fairly
straight-forward but there are a couple of important items to note related to power:
The ESP8266 requires 3.3V powerdo not power it with 5 volts! The ESP8266 needs
to communicate via serial at 3.3V and does not have 5V tolerant inputs, so you need
level conversion to communicate with a 5V microcontroller like most Arduinos use.
However, if youre adventurous and have no fear you can possibly get away with
ignoring the second requirement. But nobody takes any responsibility for what
happens if you do. :) Here are the connections available on the ESP8266 WiFi
module: ESP8266 WiFi Module
USES:
In industrial and commercial applications, push buttons can be linked
together by a mechanical linkage so that the act of pushing one button causes the
other button to be released. In this way, a stop button can "force" a start button to be
released. This method of linkage is used in simple manual operations in which the
machine or process have no electrical circuits for control.
Red pushbuttons can also have large heads (called mushroom heads) for easy
operation and to facilitate the stopping of a machine. These pushbuttons are called
emergency buttons and are mandated by the electrical code in many jurisdictions for
increased safety. This large mushroom shape can also be found in buttons for use
with operators who need to wear gloves for their work and could not actuate a
regular flush push button. The source of the energy to illuminate the light is not
directly tied to the contacts on the back of the pushbutton but to the action the
pushbutton controls. In popular culture, the phrase the button (sometimes
capitalized) refers to a (usually fictional) button that a military or government leader
could press to launch nuclear weapons.
TIMERS:
The 8052 has two timers: Timer 0 and Timer 1. They can be used either as
timers to generate a time delay or as counters to count events happening outside the
microcontroller. Lower byte register of Timer 0 is TL0 and higher byte is TH0.
Similarly, lower byte register of Timer1 is TL1 and higher byte register is TH1.
These components are specialized for being used with the microcontrollers,
which means that they cannot be activated by standard IC circuit
Pins Functions
There are pins along one side of the small printed board used for connection
to the microcontroller. There are total of 14 pins marked with numbers (16 in case
the background light is built in). Their function is described in the table below
LCD screen:
LCD screen consists of two lines with 16 characters each. Each character
consists of 5x7 dot matrix. Contrast on display depends on the power supply
voltage and whether messages are displayed in one or two lines. For that reason,
variable voltage 0- Vdd is applied on pin marked as Vee. Trimmer potentiometer is
usually used for that purpose. Some versions of displays have built in backlight
(blue or green diodes). When used during operating, a resistor for current limitation
should be used (like with any LE diode).
CONTRAST CONTROL:
To have a clear view of the characters on the LCD, contrast should be
adjusted. To adjust the contrast, the voltage should be varied. For this, a preset is
used which can behave like a variable voltage device. As the voltage of this preset is
varied, the contrast of the LCD can be adjusted.
Potentiometer:
Variable resistors used as potentiometers have all three terminals connected.
This arrangement is normally used to vary voltage, for example to set the switching
point of a circuit with a sensor, or control the volume (loudness) in an amplifier
circuit. If the terminals at the ends of the track are connected across the power
supply, then the wiper terminal will provide a voltage which can be varied from
zero up to the maximum of the supply.
Presets:
These are miniature versions of the standard variable resistor. They are
designed to be mounted directly onto the circuit board and adjusted only when the
circuit is built. For example, to set the frequency of an alarm tone or the sensitivity
of a light-sensitive circuit. A small screwdriver or similar tool is required to adjust
presets. Presets are much cheaper than standard variable resistors so they are
sometimes used in projects where a standard variable resistor would normally be
used.
Multiturn presets are used where very precise adjustments must be made.
The screw must be turned many times (10+) to move the slider from one end of the
track to the other, giving very fine control.
MEMORY:
In the design of all microprocessors-based systems, semiconductor memories
are used as primary storage for code and data. Semiconductor memories are
connected directly to the CPU and they are the memory that the CPU first asks for
information (code and data). For this reason, semiconductor memories are
sometimes referred to as primary memory.
Memory capacity:
The number of bits that a semiconductor memory chip can store is called
chip capacity. It can be in units of Kilobits, Megabits and so on. This must be
distinguished from the storage capacity of computer system. While the memory
capacity of a memory IC chip is always given in bits, the memory capacity of a
computer system is given in bytes.
Memory organization:
Memory chips are organized into a number of locations within the IC. Each
location can hold 1 bit, 4 bits, 8 bits or even 16 bits, depending on how it is
designed internally. The number of bits that each location within the memory chip
can hold is always equal to the number of data pins on the chip. i.e., the total
number of bits that a memory chip can store is equal to the number of locations
times the number of data bits per location.
Speed:
One of the most important characteristics of a memory chip is the speed at
which its data can be accessed. The speed of the memory chip is commonly referred
to as its access time. The access time of memory chip varies from a few
nanoseconds to hundreds of nanoseconds, depending on the IC technology used in
the design and fabrication process.
The different types of memories are RAM, ROM, EPROM and EEPROM. RAM
and ROM are inbuilt in the microprocessor.
EEPROM has several advantages over other memory devices, such as the
fact that its method of erasure is electrical and therefore instant. In addition, in
EEPROM one can select which byte to be erased, in contrast to flash, in which the
entire contents of ROM are erased. The main advantage of EEPROM is that one can
program and erase its contents while it is in system board. It does not require
physical removal of the memory chip from its socket. In general, the cost per bit for
EEPROM is much higher when compared to other devices.
Two wire serial interface, fully i2c bus compatible. Byte and multibit write (up
to 4 bytes) .
Page write (up to 8 bytes).
Byte, random and sequential read modes Self-timed programming cycle
Automatic address incrementing
Enhanced ESD/Latch up performances.
SIGNAL DESCRIPTIONS
Serial Clock (SCL):
The SCL input pin is used to synchronize all data in and out of the memory. A
resistor can be connected from the SCL line to VCC to act as a pull up.
Mode (MODE):
The MODE input is available on pin 7 and may be driven dynamically. It
must be at VIL or VIH for the Byte Write mode, VIH for Multibit Write mode or
VIL for Page Write mode. When unconnected, the MODE input is internally read as
VIH (Multibit Write mode).
DEVICE OPERATION
I2C Bus Background
The ST24/25x04 supports the I2C protocol. This protocol defines any device
that sends data onto the bus as a transmitter and any device that reads the data as a
receiver. The device that controls the data transfer is known as the master and the
other as the slave. The master will always initiate a data transfer and will provide
the serial clock for synchronization.
Start Condition:
START is identified by a high to low transition of the SDA line while the
clock SCL is stable in the high state. A START condition must precede any
command for data transfer. Except during a programming cycle, the ST24/25x04
continuously monitor the SDA and SCL signals for a START condition and will not
respond unless one is given.
Stop Condition:
STOP is identified by a low to high transition of the SDA line while the
clock SCL is stable in the high state. A STOP condition terminates communication
between the ST24/25x04 and the bus master. A STOP condition at the end of a Read
command, after and only after a No Acknowledge, forces the standby state. A STOP
condition at the end of a Write command triggers the internal EEPROM write cycle.
Data Input:
During data input the ST24/25x04 sample the SDA bus signal on the rising
edge of the clock SCL. Note that for correct device operation the SDA signal must
be stable during the clock low to high transition and the data must change ONLY
when the SCL line is low.
Memory Addressing:
To start communication between the bus master and the slave ST24/25x04,
the master must initiate a START condition. Following this, the master sends onto
the SDA bus line 8 bits (MSB first) corresponding to the device select code (7 bits)
and a READ or WRITE bit. The 4 most significant bits of the device select code are
the device type identifier, corresponding to the I2C bus definition. For these
memories the 4 bits are fixed as 1010b. The following 2 bits identify the specific
memory on the bus. They are matched to the chip enable signals E2, E1. Thus up to
4 x 4K memories can be connected on the same bus giving a memory capacity total
of 16 Kilobits. After a START condition any memory on the bus will identify the
device code and compare the
following 2 bits to its chip enable inputs E2, E1. The 7th bit sent is the block
number (one block = 256 bytes).
The 8th bit sent is the read or write bit (RW), this bit is set to 1 for read and
0 for write operations. If a match is found, the corresponding memory will
acknowledge the identification on the SDA bus during the 9th bit time.
Write Operations:
The Multibit Write mode (only available on the ST24/25C04 versions) is
selected when the MODE pin is at VIH and the Page Write mode when MODE pin
is at VIL. The MODE pin may be driven dynamically with CMOS input levels.
Following a START condition the master sends a device select code with the RW bit
reset to 0. The memory acknowledges this and waits for a byte address. The byte
address of 8 bits provides access to one block of 256 bytes of the memory. After
receipt of the byte address the device again responds with an acknowledge. For the
ST24/25W04 versions, any write command with WC = 1 will not modify the
memory content.
Byte Write:
In the Byte Write mode, the master sends one data byte, which is
acknowledged by the memory. The master then terminates the transfer by
generating a STOP condition. The Write mode is independent of the state of the
MODE pin which could be left floating if only this mode was to be used. However,
it is not a recommended operating mode, as this pin has to be connected to either
VIH or VIL, to minimize the stand-by current.
Multibit Write:
For the Multibit Write mode, the MODE pin must be at VIH. The Multibit
Write mode can be started from any address in the memory. The master sends from
one up to 4 bytes of data, which are each acknowledged by the memory. The
transfer is terminated by the master generating a STOP condition. The duration of
the write cycle is Tw = 10ms maximum except when bytes are accessed on 2 rows
(that is have different values for the 6 most significant address bits A7-A2), the
programming time is then doubled to a maximum of 20ms. Writing more than 4
bytes in the Multibit Write mode may modify data bytes in an adjacent row (one
row is 8 bytes long). However, the Multibit Write can properly write up to 8
consecutive bytes as soon as the first address of these 8 bytes is the first address of
the row, the 7 following bytes being written in the 7 following bytes of this same
row.
Page Write:
For the Page Write mode, the MODE pin must be at VIL. The Page Write
mode allows up to 8 bytes to be written in a single write cycle, provided that they
are all located in the same row in the memory: that is the 5 most significant
memory address bits (A7 -A3) are the same inside one block. The master sends
from one up to 8 bytes of data, which are each acknowledged by the memory. After
each byte is transferred, the internal byte address counter (3 least significant bits
only) is incremented. The transfer is terminated by the master generating a STOP
condition. Care must be taken to avoid address counter roll-over which could
result in data being overwritten. Note that, for any write mode, the generation by the
master of the STOP condition starts the internal memory program cycle. All inputs
are disabled until the completion of this cycle and the memory will not respond to
any request.
Data in the upper block of 256 bytes of the memory may be write protected.
The memory is write protected between a boundary address and the top of memory
(address 1FFh) when the PRE input pin is taken high and when the Protect Flag (bit
b2 in location 1FFh) is set to 0. The boundary address is user defined by writing it
in the Block Address Pointer. The Block Address Pointer is an 8 bit EEPROM
register located at the address 1FFh. It is composed by 5 MSBs Address Pointer,
which defines the bottom boundary address and 3 LSBs which must be programmed
at 0. This Address Pointer can therefore address a boundary in steps of 8 bytes.
Read Operations:
Read operations are independent of the state of the MODE pin. On delivery,
the memory content is set at all "1s" (or FFh) .
Sequential Read:
This mode can be initiated with either a Current Address Read or a Random
Address Read. However, in this case the master DOES acknowledge the data byte
output and the memory continues to output the next byte in sequence. To terminate
the stream of bytes, the master must NOT acknowledge the last byte output, but
MUST generate a STOP condition. The output data is from consecutive byte
addresses, with the internal byte address counter automatically incremented after
each byte output. After a count of the last memory address, the address counter will
roll - over and the memory will continue to output data.