Beruflich Dokumente
Kultur Dokumente
In the last few years, there has been an increasing demand for low-power and
portable-energy sources due to the development and mass consumption of portable
electronic devices .Furthermore, the portable-energy sources must be associated with
environmental issues and imposed regulations. These demandssupport research in
the areas of portable-energy generation methods.
2. INTRODUCTION TO ATMEL
2.1. FEATURES:
• Compatible with MCS®-51 Products
• 8K Bytes of In-System Programmable (ISP) FlashMemory–
Endurance: 10,000 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
• 32 Programmable I/O Lines
• Three 16-bit Timer/Counters
• Eight Interrupt Sources
• Full Duplex UART Serial Channel
• Low-power Idle and Power-down Modes
• Dual Data Pointer
• Power-off Flag
• Fast Programming Time
2.2.DESCRIPTION
PORT 0:
Port 0 is an 8-bit open-drain bi-directional 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 may 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 bi-directional 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 Port 1 also receives the low-order address bytes during Flash
programming and verification.
PORT 2:
Port 2 is an 8-bit bi-directional 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 uses 16-bit
addresses (MOVX @ DPTR). In this application, it uses strong internal pull-ups when
emitting 1s. During accesses to external data memory that uses 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 inter- nal 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.
RST:
Reset input. A high on this pin for two machine cycles while the oscillator is
running resets the device.
ALE/PROG:
Address Latch Enable 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. Otherwise,
the pin is weakly pulled high. Setting the ALE-disable bit has no effect if the
microcontroller is in external execution mode.
PSEN:
Program Store Enable is the read strobe to external program memory. When
the AT89C51 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,
for parts that require 12-volt VPP.
XTAL1:
Input to the inverting oscillator amplifier and input to the internal clock
operating circuit.
XTAL2:
Output from the inverting oscillator amplifier.
The AT89S52 provides the following standard features: 8K bytes of Flash, 256
bytes of RAM, 32 I/O lines, Watchdog timer, two data pointers, three 16-bit
timer/counters, a six-vector two-level interrupt architecture, a full duplex serial port,
on-chip oscillator, and clock circuitry.
In addition, the AT89S52 is designed with static logic for operation down to
zero frequency and supports two software selectable power saving modes. 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 con-tents but freezes the oscillator,
disabling all other chip functions until the next interrupt or hardware reset.
2.3.1. BLOCK DIAGRAM OF AT89S52
2.4. REGISTERS:
The Power Off Flag (POF) is located at bit 4 (PCON.4) in the PCON SFR. POF is
set to “1” during power up. It can be set and rest under software control and is
not affected by reset.
MCS-51 devices have a separate address space for Program and Data
Memory. Up to 64bytes each of external Program and Data Memory can be
addressed.
For example, the following direct addressing instruction accesses the SFR at
location 0A0H (which is P2).
MOV 0A0H, #data
Instructions that use indirect addressing access the upper 128 bytes of RAM.
For example, the following indirect addressing instruction, where R0 contains 0A0H,
accesses the data byte at address 0A0H, rather than P2 (whose address is 0A0H).
MOV @R0, #data
Note that stack operations are examples of indirect addressing, so the upper
128 bytes of data RAM are available as stack space.
2.4.6. Timer 2 :
In the Counter function, the register is incremented in response to a 1-to-0
transition at its corre- sponding external input pin, T2. In this function, the
external input is sampled during S5P2 of every machine cycle. When the samples
show a high in one cycle and a low in the next cycle, the count is incremented.
The new count value appears in the register during S3P1 of the cycle following the
one in which the transition was detected. Since two machine cycles (24 oscillator
periods) are required to recognize a 1-to-0 transition, the maximum count rate is
1/24 of the oscillator frequency. To ensure that a given level is sampled at least
once before it changes, the level should be held for at least one full machine cycle.
2.6. INTERRUPTS:
The AT89C52 has a total of six interrupt vectors: two external interrupts
(INT0 and INT1), three timer interrupts (Timers 0, 1, and 2), and the serial port
interrupt. These interrupts are all shown in Figure 6. Each of these interrupt sources
can be individually enabled or disabled by setting or clearing a bit in Special
Function Register IE. IE also contains a global disable bit, EA, which disables all
interrupts at once. Note that Table shows that bit position IE.6 is unimplemented. In
the AT89C51, bit position IE.5 is also unimplemented. User software should not
write 1s to these bit positions, since they may be used in future AT89 products.
Timer 2 interrupt is generated by the logical OR of bits TF2 and EXF2 in register
T2CON.
In fact, the service routine may have to determine whether it was TF2 or
EXF2 that generated the interrupt, and that bit will have to be cleared in software.
The Timer 0 and Timer 1 flags, TF0 and TF1, are set at S5P2 of the cycle in which
the timers overflow.
2.7.Oscillator Characteristics:
XTAL1 and XTAL2 are the input and output, respectively, of an inverting
amplifier which can be configured for use as an on-chip oscillator, as shown in
Figure 1. Either 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 Fig 2.2 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.
On-chip hardware inhibits access to internal RAM in this event, but access to
the port pins is not inhibited. To eliminate the possibility of an unexpected write to a
port pin when Idle is terminated by reset, the instruction following the one that
invokes Idle should not be one that writes to a port pin or to external memory.
POWER SUPPLY
Power supply unit consists of Step down transformer, Rectifier, Regulator unit,
filters.
AC Voltage
DC Voltage
Fig 4.7 Typical Block of Power Supply
The Step down Transformer is used to step down the main supply voltage from
230V AC to lower value. This 230 AC voltage cannot be used directly, thus it is
stepped down. The step down voltage is consists of 12V.The Transformer consists of
primary and secondary coils. To reduce or step down the voltage, the transformer is
designed to contain less number of turns in its secondary core. The output from the
secondary coil is also AC waveform. Thus the conversion from AC to DC is essential.
This conversion is achieved by using the Rectifier Circuit/Unit.
4.7.3 RECTIFIER:
The Rectifier circuit is used to convert the AC voltage into its corresponding
DC voltage. Rectifier having three types,
The simple function of the diode is to conduct when forward biased and not to
conduct in reverse bias. The Forward Bias is achieved by connecting the diode’s
positive with positive of the battery and negative with battery’s negative. The
efficient circuit used is the Full wave Bridge rectifier circuit. The output voltage of
the rectifier is in rippled form, the ripples from the obtained DC voltage are
removed using other circuits available. The circuit used for removing the ripples is
called Filter circuit.
The simple capacitor filter is the most basic type of power supply filter. The
application of the simple capacitor filter is very limited. It is sometimes used on
extremely high-voltage, low-current power supplies for cathode-ray and similar
electron tubes, which require very little load current from the supply. The capacitor
filter is also used where the power-supply ripple frequency is not critical; this
frequency can be relatively high. The capacitor (C1) shown in figure 4-15 is a simple
filter connected across the output of the rectifier in parallel with the load.
Capacitors are used as filter. The ripples from the DC voltage are removed and
pure DC voltage is obtained. And also these capacitors are used to reduce the
harmonics of the input voltage. The primary action performed by capacitor is
charging and discharging. It charges in positive half cycle of the AC voltage and it
will discharge in negative half cycle. Here we used 1000µF capacitor. So it allows
only AC voltage and does not allow the DC voltage. This filter is fixed before the
regulator. Thus the output is free from ripples.
4.7.4 REGULATOR
The Filter circuit is often fixed after the Regulator circuit. Capacitor is
most often used as filter. The principle of the capacitor is to charge and discharge. It
charges during the positive half cycle of the AC voltage and discharges during the
negative half cycle. So it allows only AC voltage and does not allow the DC voltage.
This filter is fixed after the Regulator circuit to filter any of the possibly found ripples
in the output received finally. Here we used 0.1µF capacitor. The output at this
stage is 5V and is given to the Microcontroller
Piezoelectric sensors:
One disadvantage of piezoelectric sensors is that they cannot be used for truly
static measurements. A static force will result in a fixed amount of charges on the
piezoelectric material. While working with conventional readout electronics,
imperfect insulating materials, and reduction in internal sensor resistance will result
in a constant loss of electrons, and yield a decreasing signal. Elevated temperatures
cause an additional drop in internal resistance and sensitivity. The main effect on
the piezoelectric effect is that with increasing pressure loads and temperature, the
sensitivity is reduced due to twin-formation. While quartz sensors need to be cooled
during measurements at temperatures above 300°C, special types of crystals like
GaPO4 gallium phosphate do not show any twin formation up to the melting point of
the material itself.
However, it is not true that piezoelectric sensors can only be used for very fast
processes or at ambient conditions. In fact, there are numerous applications that
show quasi-static measurements, while there are other applications with
temperatures higher than 500°C.
Piezoelectric sensors are also seen in nature. Dry bone is piezoelectric, and is
thought by some to act as a biological force sensor.[3][4]
Principle of operation
Transverse effect
A force is applied along a neutral axis (y) and the charges are generated
along the (x) direction, perpendicular to the line of force. The amount of
charge depends on the geometrical dimensions of the respective
piezoelectric element. When dimensions a,b,c apply,
Cx = dxyFyb / a,
where a is the dimension in line with the neutral axis, b is in line with the
charge generating axis and d is the corresponding piezoelectric coefficient.[5]
Longitudinal effect
The amount of charge produced is strictly proportional to the applied force
and is independent of size and shape of the piezoelectric element. Using
several elements that are mechanically in series and electrically in parallel is
the only way to increase the charge output. The resulting charge is
Cx = dxxFxn,
where dxx is the piezoelectric coefficient for a charge in x-direction released
by forces applied along x-direction (in pC/N). Fx is the applied Force in x-
direction [N] and n corresponds to the number of stacked elements .
Shear effect
Again, the charges produced are strictly proportional to the applied forces
and are independent of the element’s size and shape. For n elements
mechanically in series and electrically in parallel the charge is
Cx = 2dxxFxn.
In contrast to the longitudinal and shear effects, the transverse effect opens the
possibility to fine-tune sensitivity on the force applied and the element dimension.
Electrical properties
A detailed model includes the effects of the sensor's mechanical construction and
other non-idealities.[3] The inductance Lm is due to the seismic mass and inertia of
the sensor itself. Ce is inversely proportional to the mechanical elasticity of the
sensor. C0 represents the static capacitance of the transducer, resulting from an
inertial mass of infinite size.[3] Ri is the insulation leakage resistance of the
transducer element. If the sensor is connected to a load resistance, this also acts in
parallel with the insulation resistance, both increasing the high-pass cutoff
frequency.
In the flat region, the sensor can be modeled as a voltage source in series with the
sensor's capacitance or a charge source in parallel with the capacitance
For use as a sensor, the flat region of the frequency response plot is typically used,
between the high-pass cutoff and the resonant peak. The load and leakage
resistance need to be large enough that low frequencies of interest are not lost. A
simplified equivalent circuit model can be used in this region, in which Cs represents
the capacitance of the sensor surface itself, determined by the standard formula for
capacitance of parallel plates.[3][4] It can also be modeled as a charge source in
parallel with the source capacitance, with the charge directly proportional to the
applied force, as above.[2]
Sensor design
The main difference in the working principle between these two cases is the way
forces are applied to the sensing elements. In a pressure sensor a thin membrane is
used to transfer the force to the elements, while in accelerometers the forces are
applied by an attached seismic mass.
Sensors often tend to be sensitive to more than one physical quantity. Pressure
sensors show false signal when they are exposed to vibrations. Sophisticated
pressure sensors therefore use acceleration compensation elements in addition to
the pressure sensing elements. By carefully matching those elements, the
acceleration signal (released from the compensation element) is subtracted from
the combined signal of pressure and acceleration to derive the true pressure
information.
Vibration sensors can also be used to harvest otherwise wasted energy from
mechanical vibrations. This is accomplished by using piezoelectric materials to
convert mechanical strain into usable electrical energy.[5]
Sensing materials
Two main groups of materials are used for piezoelectric sensors: piezoelectric
ceramics and single crystal materials. The ceramic materials (such as PZT ceramic)
have a piezoelectric constant / sensitivity that is roughly two orders of magnitude
higher than those of single crystal materials and can be produced by inexpensive
sintering processes. The piezoeffect in piezoceramics is "trained", so unfortunately
their high sensitivity degrades over time. The degradation is highly correlated with
temperature. The less sensitive crystal materials (gallium phosphate, quartz,
tourmaline) have a much higher – when carefully handled, almost infinite – long
term stability.
SOFTWARE REQUIREMENTS
6.1 EMBEDDED C
Also the keywords and operational functions that more nearly resemble the
human thought process may be used. If embedded C is used the programming and
program test time is drastically reduced. The C run-time library contains many
standard routines such as: formatted output, numeric conversions and floating point
arithmetic. Existing program parts can be more easily included into new programs
because of modular program construction techniques. The language C is a very
portable language (based on the ANSI standard) that enjoys wide popular support
and is easily obtained for most systems. Existing program investments can be
quickly adapted to other processors has needed.
A UART is usually an individual (or part of an) integrated circuit used for serial
communications over a computer or peripheral device serial port. UARTs are now
commonly included in microcontrollers. A dual UART or DUART combines two UARTs
into a single chip. Many modern ICs now come with a UART that can also
communicate synchronously; these devices are called USARTs.
The UART usually does not directly generate or receive the external signals
used between different items of equipment. Typically, separate interface devices
are used to convert the logic level signals of the UART to and from the external
signaling levels.
Communication may be "full duplex" (both send and receive at the same
time) or "half duplex" (devices take turns transmitting and receiving).
As of 2008, UARTs are commonly used with RS-232 for embedded systems
communications. It is useful to communicate between microcontrollers and also
with PCs. Many chips provide UART functionality in silicon, and low-cost chips exist
to convert logic level signals (such as TTL voltages) to RS-232 level signals (for
example, Maxim's MAX232).
The parity bit can either makes the number of "one" bits between any
start/stop pair odd, or even, or it can be omitted. Odd parity is more reliable
because it assures that there will always be at least one data transition, and this
permits many UARTs to resynchronize.
A data communication pulse can only be in one of two states but there are
many names for the two states. When on, circuit closed, low voltage, current
flowing, or a logical zero, the pulse is said to be in the "space" condition. When off,
circuit open, high voltage, current stopped, or a logical one, the pulse is said to be
in the "mark" condition. A character code begins with the data communication
circuit in the space condition. If the mark condition appears, a logical one is
recorded otherwise a logical zero.
The start bit is always a 0 (logic low), which is also called a space. The start
bit signals the receiving DTE that a character code is coming. The next five to eight
bits, depending on the code set employed, represent the character. In the ASCII
code set the eighth data bit may be a parity bit. The next one or two bits are always
in the mark (logic high, i.e., '1') condition and called the stop bit(s). They provide a
"rest" interval for the receiving DTE so that it may prepare for the next character
which may be after the stop bit(s). The rest interval was required by mechanical
Teletypes which used a motor driven camshaft to decode each character. At the
end of each character the motor needed time to strike the character bail (print the
character) and reset the camshaft.
All operations of the UART hardware are controlled by a clock signal which
runs at a multiple (say, 16) of the data rate - each data bit is as long as 16 clock
pulses. The receiver tests the state of the incoming signal on each clock pulse,
looking for the beginning of the start bit. If the apparent start bit lasts at least one-
half of the bit time, it is valid and signals the start of a new character. If not, the
spurious pulse is ignored. After waiting a further bit time, the state of the line is
again sampled and the resulting level clocked into a shift register. After the required
number of bit periods for the character length (5 to 8 bits, typically) have elapsed,
the contents of the shift register is made available (in parallel fashion) to the
receiving system. The UART will set a flag indicating new data is available, and may
also generate a processor interrupt to request that the host processor transfers the
received data. In some common types of UART, a small first-in, first-out (FIFO)
buffer memory is inserted between the receiver shift register and the host system
interface. This allows the host processor more time to handle an interrupt from the
UART and prevents loss of received data at high rates.
Transmitting and receiving UARTs must be set for the same bit speed,
character length, parity, and stop bits for proper operation. The receiving UART may
detect some mismatched settings and set a "framing error" flag bit for the host
system; in exceptional cases the receiving UART will produce an erratic stream of
mutilated characters and transfer them to the host system.
Typical serial ports used with personal computers connected to modems use
eight data bits, no parity, and one stop bit; for this configuration the number of
ASCII character per seconds equals the bit rate divided by 10.
6.4.4 History
Some early telegraph schemes used variable-length pulses (as in Morse code)
and rotating clockwork mechanisms to transmit alphabetic characters. The first
UART-like devices (with fixed-length pulses) were rotating mechanical switches
(commutators). These sent 5-bit Baudot codes for mechanical teletypewriters, and
replaced morse code. Later, ASCII required a seven bit code. When IBM built
computers in the early 1960s with 8-bit characters, it became customary to store
the ASCII code in 8 bits.
Gordon Bell designed the UART for the PDP series of computers. Western
Digital made the first single-chip UART WD1402A around 1971; this was an early
example of a medium scale integrated circuit.
6.4.5 STRUCTURE
These were the software’s and protocols used in monitoring and controlling the
temperature and voltage.