Professional Documents
Culture Documents
Weather Monitoring Systems are the systems, which continuously watch the
changes in the weather by continuous gathering of the present weather conditions.
Weather The continuous weather condition is sensed by a sensor and transmitted through
modem.
Weather Monitoring System (WMS) interface between the real world of physical
parameters, which are analog, and the artificial world of digital computation and control.
Digital systems are used widely because complex circuits are low cost, accurate, and
relatively simple to implement. In addition there is rapid growth in the use of
microcomputers to perform difficult digital control and measurement functions. Modem
works as a Weather acquisition device.
This Project finds it application in real time for Weather Monitoring. Weather
Monitoring System (WMS) is used to retrieve data like temperature, pressure and
Voltage, Currents to remote host. The SHT11 is supplied in a surface-mountable LCC
(Leadless Chip Carrier) type package. The sensors housing consists of a Liquid Crystal
Polymer (LCP) cap with epoxy glob top on a standard 0.8mm FR4 substrate. The device
is free of lead, Cd and Hg.
This project mainly deals with acquisition of temperature and Humidity by using
temperature and Humidity sensor (SHT11) interfaced with Micro controller. The
peripherals equipped here are micro controller, Temperature and humidity sensor, LCD
Display interface, AtoD Converter, Modem along with Power supply unit.
INTERFACES USED:
POWER SUPPLY:
The power supply unit is used to provide a constant 5V supply to different IC’s
this is a standard circuits using external 12VDC adapter and fixed 3-pin voltage regulator.
Diode is added in series to avoid Reverse voltage.
MICRO CONTROLLER:
LCD DISPLAY:
Generation of LCD supply voltage (external supply The PCD8544 is a low power
CMOS LCD controller/driver, designed to drive a graphic display of 48 rows and84
columns. All necessary functions for the display are provided in a single chip, including
on-chip generation of LCD supply and bias voltages, resulting in a minimum of external
components and low power consumption.
MODEM:
The Z02215 is a synchronous single –chip V.22bis modem capable of 2400 bps
full duplex over dial-up lines. It is a full-featured, self-controlled modem that includes a
modem controller, DSP, and Analog Front End (AFE) functions. This device is
specifically designed for use in embedded modem applications where space,
performance, and low power consumption are key requirements.
The bellow figure shows the Weather Monitoring System. It mainly consists of
• Micro Controller
• LCD Module
• RTC Module
• Humidity and Temperature
• Zilog Modem
BLOCK DIAGRAM:
PC
PCD 8554
48X84 Matrix LCD
89C51 MICROCONTROLLER
INTRODUCTION OF MICROCONTROLLER:
READ CYCLE:
1. CPU places address on address bus.
2. Control signals memory - address on address bus is valid
3. Memory chip fetches data from location specified by the address and places on the
data bus
4. Control signals CPU - data on data bus is valid
5. CPU takes data from data bus
WRITE CYCLE:
MEMORY:
Random access refers to the fact that data from any location in the memory chip is
accessible at any time (you simply put the desired address on the address bus). ROM
stands for read only memory. As with RAM, it is random access but it differs from RAM
in two ways:
ROM, as the name suggests, is read only. You cannot write to a ROM chip. A
ROM chip must be programmed, but once programmed, it cannot be (easily) changed
ROM is non-volatile - when power is removed from the chip data is not lost.
There are many types of ROM available; PROM, EPROM, EEPROM and Flash
are the most common.
FEATURES:
89C51 Central Processing Unit
On-chip FLASH Program Memory
Speedup to 33 MHz
Fully Static Operation
RAM expandable externally up to 64 Kbytes
Four interrupt priority levels
Six interrupt sources
Four 8-bit input output ports
Full-duplex enhanced UART
-Framing error detection
-Automatic address recognition
Three 16-bit timers/counters T0, T1and additional T2
Programmable clock out
Second DPTR register
Asynchronous port reset
Power control modes
-Clock can be stopped and resumed
-Idle mode
-Power down mode
Low EMI
Wakeup from power down by an external interrupt
non-volatile FLASH program memory that is parallel programmable
Flash memory features
FLASH EPROM internal program memory with chip erases.
Up to 64K byte external program memory if the internal program memory is disabled
Programmable security bits.
10,000 minimum erase/program cycles for each byte
8051 MICRO CONTROLLER ARCHITECTURE:
1.DESCRIPTION OF BLOCK DIAGRAM:
CPU:
ALU:
The ALU performs arithmetic and logic functions on 8-bit variables. The ALU
can perform addition, subtraction, multiplication and division and the logic unit can
perform logical operations. An important and unique feature of the microcontroller
architecture is that the ALU can also manipulate 1 bit as well as 8-bit data types.
Individual bits may be set, cleared, complemented, moved, tested and used in logic
computation.
ACCUMULATOR:
The Accumulator, as its name suggests, is used as a general register to accumulate
the results of a large number of instructions. It can hold an 8-bit (1-byte) value and is the
most versatile register, the microcontroller has due to the shear number of instructions
that make use of the accumulator. Accumulator holds a source of operand and stores the
result of the arithmetic operations such as addition, subtraction, multiplication and
division. The accumulator can be the source or destination register for logical operations.
The accumulator has several exclusive functions such as rotate, parity computation;
testing for 0, sign acceptor etc. and so on.
PROGRAM COUNTER:
The program counter points to the address of the next instruction to be executed.
As the CPU fetches the opcode from the program ROM, the program counter is
implemented to point to the next instruction. The Microcontroller can access program
addresses 0000 to FFFFH, a total of 64K bytes of code.
When the 8051 is initialized PC always starts at 0000h and is incremented each
time an instruction is executed. PC is always incremented by one. Since some
instructions require 2 or 3 bytes the PC will be incremented by 2 or 3 in these cases. The
Program Counter is special in that there is no way to directly modify its value.
TYPES OF MEMORY:
The 8051 has three very general types of memory. To effectively program the
8051 it is necessary to have a basic understanding of these memory types.
The memory types are illustrated in the following diagram They are:
1.On-Chip Memory
2.External Code Memory
EXTERNAL RAM:
On-Chip Memory refers to any memory (Code, RAM, or other) that physically
exists on the microcontroller itself. On-chip memory can be of several types, but we'll get
into that shortly.
External Code Memory is code (or program) memory that resides off-chip. This is
often in the form of an external EPROM.
External RAM is RAM memory that resides off-chip. This is often in the form of
standard static RAM or flash RAM.
CODE MEMORY:
Code memory is the memory that holds the actual 8051 program that is to be run.
This memory is limited to 64K and comes in many shapes and sizes. Code memory may
be found on-chip, either burned into the microcontroller as ROM or EPROM. Code may
also be stored completely off-chip in an external ROM or, more commonly, an external
EPROM. Flash RAM is also another popular method of storing a program. Various
combinations of these memory types may also be used--that is to say, it is possible to
have 4K of code memory on-chip and 64k of code memory off-chip in an EPROM.
When the program is stored on-chip the 64K maximum is often reduced to 4k, 8k,
or 16k. This varies depending on the version of the chip that is being used. Each version
offers specific capabilities and one of the distinguishing factors from chip to chip is how
much ROM/EPROM space the chip has.
EXTERNAL RAM:
As an obvious opposite of Internal RAM, the 8051 also supports what is called
External RAM.
External RAM is any random access memory which is found off-chip. Since the
memory is off-chip it is not as flexible in terms of accessing, and is also slower. For
example, to increment an Internal RAM location by 1 requires only 1 instruction and 1
instruction cycle. To increment a 1-byte value stored in External RAM requires 4
instructions and 7 instruction cycles. In this case, external memory is 7 times slower!
What External RAM loses in speed and flexibility it gains in quantity. While Internal
RAM is limited to 128 bytes (256 bytes with an 8052), the 8051 supports External RAM
up to 64K.
ON-CHIP MEMORY:
The 128 bytes of internal ram is subdivided as shown on the memory map. The
first 8 bytes (00h - 07h) are "register bank 0". By manipulating certain SFRs, a program
may choose to use register banks 1, 2, or 3. These alternative register banks are located in
internal RAM in addresses 08h through 1Fh. We'll discuss "register banks" more in a
later chapter. For now it is sufficient to know that they "live" and are part of internal
RAM.
Bit Memory also lives and is part of internal RAM. We'll talk more about bit
memory very shortly, but for now just keep in mind that bit memory actually resides in
internal RAM, from addresses 20h through 2Fh.
The 80 bytes remaining of Internal RAM, from addresses 30h through 7Fh, may
be used by user variables that need to be accessed frequently or at high-speed. This area
is also utilized by the microcontroller as a storage area for the operating stack. This fact
severely limits the 8051s stack since, as illustrated in the memory map, the area reserved
for the stack is only 80 bytes--and usually it is less since this 80 bytes has to be shared
between the stack and user variables.
REGISTER BANKS:
The 8051 uses 8 "R" registers which are used in many of its instructions. These
"R" registers are numbered from 0 through 7 (R0, R1, R2, R3, R4, R5, R6, and R7).
These registers are generally used to assist in manipulating values and moving data from
one memory location to another however, as the memory map shows, the "R" Register
R4 is really part of Internal RAM. The microcontroller has four distinct register banks.
When the 8051 is first booted up, register bank 0 (addresses 00h through 07h) is used by
default. The register banks really reside in the first 32 bytes of Internal RAM.
BIT MEMORY:
Special Function Registers (SFRs) are areas of memory that control specific
functionality of the 8051 processor. For example, four SFRs permit access to the 8051s
32 input/output lines. Another SFR allows a program to read or write to the 8051s serial
port. Other SFRs allow the user to set the serial baud rate, control and access timers, and
configure the 8051s interrupt system. program may inspect and/or change the operating
mode of the 8051 by manipulating the values of the 8051's Special Function Registers.
The SFR is part of Internal Memory.
The program may inspect and/or change the operating mode of the 8051 by
manipulating the values of the 8051's Special Function Registers. SFRs are accessed as if
they were normal Internal RAM. The only difference is that Internal RAM is from
address 00h through 7Fh whereas SFR registers exist in the address range of 80h through
FFh Each SFR has an address (80h through FFh) and a name.
Although the address range of 80h through FFh offer 128 possible addresses,
there are only 21 SFRs in a standard 8051. All other addresses in the SFR range (80h
through FFh) are considered invalid. Writing to or reading from these registers may
produce undefined values or behavior.
SFR TYPES:
As mentioned in the chart itself, the SFRs that have a blue background are SFRs
related to the I/O ports. The 8051 has four I/O ports of 8 bits, for a total of 32 I/O lines.
Whether a given I/O line is high or low and the value read from the line are controlled by
the SFRs in green.
The SFRs with yellow background are SFRs which in some way control the
operation or the configuration of some aspect of the 8051. For example, TCON controls
the timers, SCON controls the serial port.
The remaining SFRs, with green backgrounds, are "other SFRs." These SFRs can
be thought of as auxiliary SFRs in the sense that they don't directly configure the 8051
but obviously the 8051 cannot operate without them. For example, once the serial port
has been configured using SCON, the program may read or write to the serial port using
the SBUF register.
SFR DESCRIPTIONS:
The SFRs DPL and DPH work together to represent a 16-bit value called the
Data Pointer. The data pointer is used in operations regarding external RAM and some
instructions involving code memory. Since it is an unsigned two-byte integer value, it can
represent values from 0000h to FFFFh (0 through 65,535 decimal).
PCON (Power Control, Addresses 87h): The Power Control SFR is used to
control the 8051's power control modes. Certain operation modes of the 8051 allow the
8051 to go into a type of "sleep" mode which requires much less power. These modes of
operation are controlled through PCON. Additionally, one of the bits in PCON is used to
double the effective baud rate of the 8051's serial port.
The Timer Control SFR is used to configure and modify the way in which the
8051's two timers operate. This SFR controls whether each of the two timers is running
or stopped and contains a flag to indicate that each timer has overflowed. Additionally,
some non-timer related bits are located in the TCON SFR. These bits are used to
configure the way in which the external interrupts are activated and also contain the
external interrupt flags which are set when an external interrupt has occured.
The Timer Mode SFR is used to configure the mode of operation of each of the
two timers. Using this SFR your program may configure each timer to be a 16-bit timer,
an 8-bit autoreload timer, a 13-bit timer, or two separate timers. Additionally, you may
configure the timers to only count when an external pin is activated or to count "events"
that are indicated on an external pin.
The "timer” or "counter "function is selected by control bits C/T in the special
function register TMOD. These two timer/counters have for operating modes, which are
selected by bit-pairs (M1/M0) in TMOD. Modes 0, 1, and 2 are the same for both
timers/counters. Mode 3 is different.
These two SFRs, taken together, represent timer 0. Their exact behavior depends
on how the timer is configured in the TMOD SFR; however, these timers always count
up. What is configurable is how and when they increment in value.
These two SFRs, taken together, represent timer 1. Their exact behavior depends
on how the timer is configured in the TMOD SFR; however, these timers always count
up. What is configurable is how and when they increment in value.
Address =88H.
Bit addressable.
TF: Timer overflow flag: Set by hardware when the timer/counter overflows. It is
cleared by hardware, as the processor vectors to the interrupt service routine.
TR: timer run control bit: Set or cleared by software to turn timer or counter on/off.
IE: set by CPU when the external interrupt edge (H-to-L transition) is detected. It is
cleared by CPU when the interrupt is processed.
IT: set/cleared by software to specify falling edge/low-level triggered external
interrupt.
This is input/output port 1. Each bit of this SFR corresponds to one of the pins on
the microcontroller. For example, bit 0 of port 1 is pin P1.0, bit 7 is pin P1.7. Writing a
value of 1 to a bit of this SFR will send a high level on the corresponding I/O pin whereas
a value of 0 will bring it to a low level.
SCON (Serial Control, Addresses 98h, Bit-Addressable):
The Serial Control SFR is used to configure the behavior of the 8051's on-board
serial port. This SFR controls the baud rate of the serial port, whether the serial port is
activated to receive data, and also contains flags that are set when a byte is successfully
sent or received.
Bit addressable.
8H
REN set or cleared by software to enable or disable reception.
TB 8 not widely used.
RB 8 not widely used.
TI transmits interrupt flag. Set by hardware at the beginning of the stop bit in mode
1. It must be cleared by software.
RI received interrupts flag. Set by hardware halfway through the stop bit time in
mode 1. It must be cleared by software.
The Serial Buffer SFR is used to send and receive data via the on-board serial
port. Any value written to SBUF will be sent out the serial port's TXD pin. Likewise, any
value which the 8051 receives via the serial port's RXD pin will be delivered to the user
program via SBUF. In other words, SBUF serves as the output port when written to and
as an input port when read from.
This is input/output port 2. Each bit of this SFR corresponds to one of the pins on
the microcontroller. For example, bit 0 of port 2 is pin P2.0, bit 7 is pin P2.7. Writing a
value of 1 to a bit of this SFR will send a high level on the corresponding I/O pin whereas
a value of 0 will bring it to a low level.
IE (Interrupt Enable, Addresses A8h):
1. Reset.
2. Two interrupts are set aside for the timers.
3. Two interrupts are set aside for hardware external hardware interrupts.
4. Serial Communications has a single interrupt (receive and transfer).
The Interrupt Enable SFR is used to enable and disable specific interrupts. The low 7 bits
of the SFR are used to enable/disable the specific interrupts, where as the highest bit is
used to enable or disable ALL interrupts. Thus, if the high bit of IE is 0 all interrupts are
disabled regardless of whether an individual interrupt is enabled by setting a lower bit.
EA disable all interrupts. If EA = 0, now interrupt is acknowledged. If EA = 1, each
interrupt source is individually enabled or disabled by setting or clearing its enable a lap
bit.
---- Not implemented, reserved for future use.
ET2 enables or disables timer 2 overflow or capturer interrupt.
ES enables or disables the serial port interrupt.
ET1 enables or disables timer 1 overflow interrupt.
EX1 enables or disables external interrupt 1.
ET0 enables or disables timer 0 overflow interrupt.
EX0 enables or disables external interrupt 0.
This is input/output port 3. Each bit of this SFR corresponds to one of the pins on
the microcontroller. For example, bit 0 of port 3 is pin P3.0, bit 7 is pin P3.7. Writing a
value of 1 to a bit of this SFR will send a high level on the corresponding I/O pin whereas
a value of 0 will bring it to a low level.
The Interrupt Priority SFR is used to specify the relative priority of each
interrupt. On the 8051, an interrupt may either be of low (0) priority or high (1) priority.
An interrupt may only interrupt interrupts of lower priority. For example, if we configure
the 8051 so that all interrupts are of low priority except the serial interrupt, the serial
interrupt will always be able to interrupt the system, even if another interrupt is currently
executing. However, if a serial interrupt is executing no other interrupt will be able to
interrupt the serial interrupt routine since the serial interrupt routine has the highest
priority.
The Program Status Word is used to store a number of important bits that are set
and cleared by microcontroller instructions. The PSW SFR contains the carry flag, the
auxiliary carry flag, the overflow flag, and the parity flag. Additionally, the PSW register
contains the register bank select flags which are used to select which of the "R" register
banks are currently selected.
The program status word (PSW) register is on 8-bit register. It is also referred to as the
flag register.
CY Carry-flag.
AC Auxiliary carry-flag.
---- Available to the user for general-purpose.
RS1 register bank selector bit 1.
RS0 register bank selector bit 0.
OV overflow flag.
---- User definable bit.
P Parity flag. Set/cleared by hardware each instruction cycle to indicate an
odd/even member of 1 bit in the accumulator.
Other SFRs:
The chart above is a summary of all the SFRs that exist in a standard 8051. All
derivative microcontrollers of the 8051 must support these basic SFRs in order to
maintain compatibility with the underlying MSCS51 standard.
1–8: (Port 1):
Each of these pins can be used as either input or output according to your needs.
Also, pins 1 and 2 (P1.0 and P1.1) have special functions associated with Timer.
9: RESET SIGNAL:
High logical state on this input halts the MCU and clears all the registers.
Bringing this pin back to logical state zero starts the program anew as if the power had
just been turned on. In another words, positive voltage impulse on this pin resets the
MCU. Depending on the device's purpose and environs, this pin is usually connected to
the push-button, reset-upon-start circuit or a brown out reset circuit (covered in the
previous chapter). The image shows one simple circuit for safe reset upon starting the
controller. It is utilized in situations when power fails to reach its optimal voltage.
10-17:
Port 3 as with Port 1, each of these pins can be used as universal input or output.
However, each pin of Port 3 has an alternative function.
Beside its role as universal I/O port, each pin of Port 3 has an alternate function. In order
to use one of these functions, the pin in question has to be designated as input, i.e. the
appropriate bit of register P3 needs to be set. From a hardware standpoint, Port 3 is
similar to Port 0.
As can be seen from the individual descriptions of the ports, they all share highly
similar structure. However, you need to consider which task should be assigned to which
port. For example: if utilizing port as output with high level (5V), avoid using Port 0, as
its pins cannot produce high logical level without an additional resistor connected to +5V.
If using other port to a same end, bear in mind that built-in resistors have
relatively high values, producing the currents limited to few hundreds of amperes as pin
output.
Pin 10:
Pin 11:
Input and output of internal oscillator. Quartz crystal controlling the frequency
commonly connects to these pins. Capacitances within the oscillator mechanism (see the
image) are not critical and are normally about 30pF. Instead of a quartz crystal, miniature
ceramic resonators can be used for dictating the pace. In that case, manufacturers
recommend using somewhat higher capacitances (about 47 puffs). New Mucus works at
frequencies from 0Hz to 50MHz+.
When external memory is used, this port contains the higher address byte
(addresses A8–A15), similar to Port 0. Otherwise, it can be used as universal I/O port.
29: PSEN; MCU activates this bit (brings to low state) upon each reading of byte
(instruction) from program memory. If external ROM is used for storing the program,
PSEN is directly connected to its control pins.
Of the external memory, MCU sends the lower byte of the address register
(addresses A0 – A7) to port P0 and activates the output ALE. External register
(74HCT373 or 74HCT375 circuits are common), memorizes the state of port P0 upon
receiving a signal from ALE pin, and uses it as part of the address for memory chip.
During the second part of the mechanical MCU cycle, signal on ALE is off, and port P0
is used as Data Bus. In this way, by adding only one cheap integrated circuit, data from
port can be multiplexed and the port simultaneously used for transferring both addresses
and data.
31: EA:
Bringing this pin to the logical state zero (mass) designates the ports P2 and P3
for transferring addresses regardless of the presence of the internal memory. This means
that even if there is a program loaded in the MCU it will not be executed, but the one
from the external ROM will be used instead. Conversely, bringing the pin to the high
logical state causes the controller to use both memories, first the internal, and then the
external (if present).
32-39:
Port 0 Similar to Port 2, Port 0 has two-fold role if external memory is used, it
contains the lower address byte (addresses A0-A7); otherwise all bits of the port are
either input or output. Another feature of this port comes to play when it has been
designated as output. Unlike other ports, Port 0 lacks the "pull up" resistor (resistor with
+5V on one end). This seemingly insignificant change has the following consequences:
When designated as input, pin of Port 0 acts as high impedance offering the infinite input
resistance with no "inner" voltage.
When designated as output, pin acts as "open drain". Clearing a port bit grounds
the appropriate pin on the case (0V). Setting a port bit makes the pin act as high
impedance. Therefore, to get positive logic (5V) at output, external "pull up" resistor
needs to be added for connecting the pin to the positive pole.
Therefore, to get one (5V) on the output, external "pull up" resistor needs to be added for
connecting the pin to the positive pole.
SERIAL COMMUNICATION:
The fact that in serial communication a single data line is used instead of the 8-bit
data line of parallel communication makes it not only much cheaper but also makes it
possible for two computers located in two different cities to communicate over the
telephone.
PARITY BIT:
In some systems in order to maintain data integrity, the parity bit of the character
byte is included in the data frame. This means that for each character we have a single
parity bit in addition to start and stop bits. The parity bit is odd or even. In case of an
odd parity bit the number of data bits of a book of including the parity bit, is even.
The rate of data transfer in serial data communication is stated in bps (bits per
second). Another widely used terminology for bps is baud rate. Baud rate is defined as
the number of signal changes per second. As far as the conductor wire is concerned, the
baud rates as bps are the same. If each signal change represents more than one bit, bits
per second may be greater than baud rate.
RS232 STANDARDS:
DTE (Data Terminal Equipment) is a generic term for an item which forms part of
the "information processing" portions of a system. Examples are: computer, printer, and
terminal.
RTS/CTS: These signals are often now used to throttle the rate at which data is
delivered between a DTE and modem: the DTE "drops" RTS when its buffers are nearly
full, and the modem does the same using the CTS signal. This is nowadays referred to as
"hardware handshaking".
It's worth noting that modern high-speed modems almost universally use the
RTS/CTS pair for this purpose. In fact, without hardware handshaking, data compression
in modems would not be possible.
PORT TESTING:
Test the operation of the ports of your 89C51 trainer as follows. Assemble and
run the test program below. The test program toggles the ports of the 89C51. Use a logic
probe or the LED of your digital trainer to watch the bits of the ports toggle on and off.
The time delay in between the "on" and "off" states is 1 second
2. The "ASM "source file containing the program code is created in step 1 is fed to
an 8051 assembler. The assembler converts the instructions into machine code. The
assembler will produce an object file and a list file. The extension for the object file is
"OBJ "by the extension for the list file is "1ST ".
3. Assemblers require a third step calling linking. The link program takes one or more
objects files and produces an absolute object file with the extension "ABS". 8051
trainers that have a monitor program use this ABS file.
4. Next the "ABS "file is fed into a program called "OH "(Object to Hex Converter)
which creates a file with extension "HEX "that these ready to burn into ROM. This
program comes with all 8051 assemblers. Recent Windows-based assemblers combine
steps 2 through 4 into one step.
org 0H
mov A, #0ffH
route:
mov P1, A
acall delay1msec
cpl a
mov P2, a
acall delay1msec
sjmp route
delay1msec:
mov R3, #200
up: mov R2, #250
same: djnz R2, same
djnz R3, up
ret
end
FEATURES:
GENERAL DESCRIPTION:
APPLICATIONS:
Telecommunications equipment.
BLOCK DIAGRAM:
FUNCTIONAL DESCRIPTION:
OSCILLATOR:
The on-chip oscillator provides the clock signal for the display system. No
external components are required and the OSC input must be connected to VDD. An
external clock signal, if used, is connected to this input.
ADDRESS COUNTER (AC):
The address counter assigns addresses to the display data RAM for writing. The
X-address X6 to X0 and the Y-address Y2 to Y0 are set separately. After a write
operation, the address counter is automatically incremented by 1, according to the V flag.
The DDRAM is a 48 ´ 84 bit static RAM which stores the display data. The RAM
is divided into six banks of 84 bytes (6 ´ 8 ´ 84 bits). During RAM access, data is
transferred to the RAM through the serial interface. There is a direct correspondence
between the X-address and the column output number.
TIMING GENERATOR:
The timing generator produces the various signals required to drive the internal
circuits. Internal chip operation is not affected by operations on the data buses.
The display is generated by continuously shifting rows of RAM data to the dot
matrix LCD through the column outputs. The display status (all dots on/off and
normal/inverse video) is set by bits E and D in the ‘display control’ command.
LCD ROW AND COLUMN DRIVERS:
The PCD8544 contains 48 row and 84 column drivers, which connect the
appropriate LCD bias voltages in sequence to the display in accordance with the data to
be displayed. Figure 2 shows typical waveforms. Unused outputs should be left
unconnected.
PIN CONFIGURATION:
When the on-chip oscillator is used, this input must be connected to VDD. An
external clock signal, if used, is connected to this input. If the oscillator and external
clock are both inhibited by connecting the OSC pin to VSS, the display is not clocked
and may be left in a DC state. To avoid this, the chip should always be put into Power-
down mode before stopping the clock.
12 RES: RESET:
This signal will reset the device and must be applied to properly initialize the
chip. The signal is active LOW.
Fig: DDRam to display mapping
ADDRESSING:
Data is downloaded in bytes into the 48 by 84 bits RAM data display matrix of
PCD8544, as indicated in Figs. 3, 4, 5 and 6. The columns are addressed by the address
pointer. The address ranges are: X 0 to 83 (1010011), Y 0 to 5 (101). Addresses outside
these ranges are not allowed. In the vertical addressing mode (V = 1), the Y address
increments after each byte (see Fig.5). After the last Y address (Y = 5), Y wraps around
to 0 and X increments to address the next column. In the horizontal addressing mode (V
= 0), the X address increments after each byte (see Fig.6). After the last X address (X =
83), X wraps around to 0 and Y increments to address the next row. After the very last
address (X = 83 and Y = 5), the address pointers wrap around to address (X = 0 and Y =
0).
DATA STRUCTURE:
handbook, full
Fig: Sequence of writing data bytes into RAM with vertical addressing (V = 1).
48 X 84 PIXELS MATRIX LCD CONTROLLER/DRIVER:
Fig: Sequence of writing data bytes into RAM with horizontal addressing (V = 0).
TEMPERATURE COMPENSATION:
Due to the temperature dependency of the liquid crystals’ viscosity, the LCD
controlling voltage VLCD must be increased at lower temperatures to maintain optimum
contrast. Figure 7 shows VLCD for high multiplex rates. In the PCD8544, the
temperature coefficient of VLCD, can be selected from four values (see Table 2) by
setting bits TC1 and TC0.
1. Upper Limit.
2. Typical curve
3. Temperature coefficient of IC
4. Lower limit
INSTRUCTIONS:
The instruction format is divided into two modes: If D/C (mode select) is set
LOW, the current byte is interpreted as command byte (see Table 1). Figure 8 shows an
example of a serial data stream for initializing the chip. If D/C is set HIGH, the following
bytes are stored in the display data RAM. After every data byte, the address counter is
incremented automatically.
The level of the D/C signal is read during the last bit of data byte. Each
instruction can be sent in any order to the PCD8544. The MSB of a byte is transmitted
first. Figure 9 shows one possible command stream, used to set up the LCD driver. The
serial interface is initialized when SCE is HIGH. In this state, SCLK clock pulses have no
effect and no power is consumed by the serial interface. A negative edge on SCE enables
the serial interface and indicates the start of a data transmission.
• When SCE is HIGH, SCLK clock signals are ignored; during the HIGH time of
SCE, the serial interface is initialized (see Fig.12).
• D/C indicates whether the byte is a command (D/C = 0) or RAM data (D/C = 1);
it is read with the eighth SCLK pulse.
• If SCE stays LOW after the last bit of a command/data byte, the serial interface
expects bit 7 of the next byte at the next positive edge of SCLK (see Fig.12).
• A reset pulse with RES interrupts the transmission. No data is written into the
RAM.
The registers are cleared. If SCE is LOW after the positive edge of RES, the serial
interface is ready to receive bit 7 of a command/data byte (see Fig.13).
Instruction Set:
INITIALIZATION:
Immediately following power-on, the contents of all internal registers and of the
RAM are undefined. A RES pulse must be applied. Attention should be paid to the
possibility that the device may be damaged if not properly reset.
All internal registers are reset by applying an external RES pulse (active LOW) at
pad 31, within the specified time. However, the RAM contents are still undefined. The
RES input must be £0.3VDD when VDD reaches VDDmin (or higher) within a
maximum time of 100 ms after VDD goes HIGH
RESET FUNCTION:
FUNCTION SET:
BIT PD:
• All LCD outputs at VSS (display off)
• Bias generator and VLCD generator off, VLCD can be disconnected
• Oscillator off (external clock possible)
• Serial bus, command, etc. function
• Before entering Power-down mode, the RAM needs to be filled with ‘0’s to
ensure the specified current consumption.
BIT V:
When V = 0, the horizontal addressing is selected. The data is written into the
DDRAM as shown in Fig.
When V = 1, the vertical addressing is selected. The data is written into the
DDRAM, as shown in Fig.
BIT H:
When H = 0 the commands ‘display control’, ‘set Y address’ and ‘set X address’
can be performed; when H = 1, the others can be executed. The ‘write data’ and ‘function
set’ commands can be executed in both cases.
DISPLAY CONTROL:
Bits D and E:
TEMPERATURE CONTROL:
BIAS VALUE:
The bias voltage levels are set in the ratio of R - R - nR - R - R, giving a 1/(n + 4)
bias system. Different multiplex rates require different factors n (see Table 4). This is
programmed by BS2 to BS0. For Mux 1 : 48, the optimum bias value n, resulting in 1/8
bias, is given by:
SET VOP VALUE:
The operation voltage VLCD can be set by software. The values are dependent
on the liquid crystal selected. VLCD = a + (VOP6 to VOP0) b [V]. In the PCD8544,
a = 3.06 and b = .06 giving a program range of 3.00 to 10.68 at room temperature.
Note: That the charge pump is turned off if VOP6 to VOP0 is set to zero.
For Mux 1 : 48, the optimum operation voltage of the liquid can be calculated as:
where Vth is the threshold voltage of the liquid crystal material used.
Caution,
as VOP
increases with
lower
temperatures,
care must be
taken not to set
a VOP that will exceed the maximum of 8.5 V when operating at -25 °C.
APPLICATION INFORMATION:
REAL TIME CLOCK
Real-time clocks run on a special battery that is not connected to the normal
power supply. In contrast, clocks that are not real-time do not function when the
computer is off. RTC should not be confused with real-time computing. It also shouldn't
be confused with CPU clock (The CPU clock regulates the execution of instructions.).
Block Diagram:
FEATURES:
PIN ASSIGNMENT:
For each data transfer, a Command Byte is initiated to specify which register is
accessed. This is to determine whether a read, write, or test cycle is operated and whether
a single byte or burst mode transfer is to occur. Refer to the table shown below and
follow the steps to write the data to the chip. First give a Command Byte of
HT1380/HT1381, and then write a data in the register.
This table illustrates the correlation between Command Byte and their bits:
CH: Clock Halt bit
CH=0 oscillator enabled
CH=1 oscillator disabled
Bit 7 of Reg2:
12/24 mode flag
Bit 7=1, 12-hour mode
Bit 7=0, 24-hour mode
Bit 5 of Reg2:
R/W signal :
The LSB of the Command Byte determines whether the data in the register be
read or be written to.
When it is set as 0 means that a write cycle is to take place otherwise this chip
will be set into the read mode.
A0~A2 :
Burst mode :
Test mode :
When the Command Byte is set as 1001xxx1, HT1380/HT1381 is configured in
test mode. Holtek uses the test mode only for testing purposes. If used generally,
unpredictable conditions may occur.
This register is used to prevent a write operation to any other register. Data can be
written into the designated register only if the Write Protect signal (WP) is set to logic 0.
The Write Protect Register should be set first before restarting the system or before
writing the new data to the system, and it should set as logic1in the read cycle. The Write
Protect bit cannot be written to in the burst mode. Logic is turned on and the
address/command sequence can access the corresponding shift register. The REST pin is
also used to terminate either single-byte or burst mode data format.
D7 of the Seconds Register is defined as the Clock Halt Flag (CH). When this bit
is set to logic 1, the clock oscillator is stopped and the chip goes into a low-power
standby mode. When this bit is written to logic 0, the clock will start.
12-hour/24-hour mode :
The D7 of the hour register is defined as the 12-hour or 24-hour mode select bit.
When this bit is in high level, the 12-hour mode is selected otherwise it’s the 24-hour
mode.
AM-PM mode :
These are two functions for the D5 of the hour register determined by the value
D7 of the same register. One is used in AM/PM selection on the 12-hour mode. When D5
is logic 1, it is PM, otherwise it is AM. The other is used to set the second 10-hour bit
(20~23 hours) on the 24-hour mode.
The REST pin is used to allow access data to the shift register like a toggle
switch. When the REST pin is taken high, the built-in control Data in and Data out .
In writing a data byte with HT1380/HT1381, the read/write should first set as
R/W=0 in the Command Byte and follow with the corresponding data register on the
rising edge of the next eight SCLK cycles. Additional SCLK cycles are ignored. Data
inputs are entered starting with bit 0. In reading a data on the register of
HT1380/HT1381, R/W=1 should first be entered as input. The data bit outputs on the
falling edge of the next eight SCLK cycles. Note that the first data bit to be transmitted
on the first falling edge after the last bit of the read command byte is written. Additional
SCLK cycles re-transmit the data bytes as long as REST remains at high level. Data
outputs are read starting with bit 0.
Crystal selection :
Features:
BLOCK DIAGRAM:
BLOCK DIAGRAM DESCRIPTION :
The SHTxx is a single chip relative humidity and temperature multi sensor
module comprising a calibrated digital output. The device includes a capacitive
polymer sensing element for relative humidity and a band gap temperature sensor.
Both are seamlessly coupled to a 14bit analog to digital converter and a serial interface
circuit on the same chip. This results in superior signal quality, a fast response time and
insensitivity to external disturbances (EMC) at a very competitive price.
• HVAC
• Automotive
• Consumer Goods
• Weather Stations
• (De-) Humidifiers
INTERFACE SPECIFICATIONS :
Power Pins :
The SHTxx requires a voltage supply between 2.4V and 5.5V. After
powerup the device needs 11ms to reach its .sleep. state. No commands should be
sent before that time. Power supply pins (VDD, GND) may be decoupled with a
100 nF capacitor.
The DATA tristate pin is used to transfer data in and out of the device. DATA
changes after the falling edge and is valid on the rising edge of the serial clock
SCK. During communication the DATA line must remain stable while SCK is high. To
avoid signal contention the microcontroler should only drive DATA low. An external
pull-up resistor (e.g 10k ) is required to pull the signal high. (See Figure ) Pull-up
resistors are often included in I/O circuits of microcontrollers.
SENDING A COMMAND :
Two bytes of measurement data and one byte of CRC checksum will then be
transmitted. The uC must acknowledge each byte by pulling the DATA line low.
All values are MSB first, right justified. (e.g. the 5th SCK is MSB for a 12bit value, for a
8bit result the first byte is not used). Communication terminates after the acknowledge
bit of the CRC data. If CRC-8 checksum is not used the controller may terminate the
communication after the measurement data LSB by keeping ack high. The device
automaticaly returns to sleep mode after the measurement and communication have
ended.
If communication with the device is lost the following signal sequence wil reset
its serial interface:
While leaving DATA high, toggle SCK 9 or more times. This must be followed
by a .Transmission Start. sequence preceding the next command. This sequence
resets the interface only. The status register preserves its content.
Relative Humidity :
To compensate for the non-linearity of the humidity sensor and to obtain the
full accuracy it is recommended to convert the readout with the folowing formula1:
TEMPERATURE :
Features:
• Complete modem integrated circuit with integrated controller, data pump and
Analog Front End (AFE) with active hybrid
• Includes an AT command set interpreter in the on-chip ROM with no external
memory required.
• Programmable country parameters through AT commands or EEPROM interface
Automatic determination of AT command speed and parity.
• Includes V.14 asynchronous to synchronous conversion.
• Accepts asynchronous or synchronous terminal data
• Speed matching and RTS/CTS flow control between the modem and the terminal
• Voice answer detection
• Line-In-Use detection before connection
• Pick-up detection during connections
• Supports Tone or Pulse dialing
• Call progress monitoring controls
• Guard tone controls
• Line quality monitoring and auto-retrain
• Auto-Dial and Auto-Answer
• Supports telephone dial blacklisting
• Data modem throughput to 2400 bps
• ITU V.22bis, V.23, V.22, V.21
• Bell 212A, Bell 103, Bell 202, Bell 202T
• FSK (V.23 1200/75 bps, Bell 202/Bell 202T 1200/150 bps, V.21/Bell 103 300
bps), DPSK (V.22/Bell 212A 1200 bps), or QAM Encoding (V.22bis 2400 bps)
• V.23 with Minitel line reversal
• Programmable bi-quad call progress tone detectors.
• Adaptive equalization to compensate for a wide variety of line conditions.
• Programmable transmit attenuation and selectable receive threshold.
Operating over the Public Switched Telephone Network (PSTN), the Z02215
meets the modem standards for V.22bis, V.22, V.23 (Minitel), V.21, Bell 212A, Bell 202,
Bell 202T, and Bell 103. A typical modem can be created by simply adding a phone- line
interface (DAA), and DTE interface.
BLOCK DIAGRAM:
PIN DESCRIPTION:
Modem is inter connected to the PC and micro controller. MAX 232 converts the
RS232 signals into TTL level signals.
With the Parallel Host Interface, a host controller can put the Z02215 on its
processor bus and access it as a peripheral. The Parallel Interface consists of two host
registers:
PIDR is the data register for transmitting and receiving data, including the AT
commands.
In RECEIVE DATA mode (when HRD, HCS, HA0, S/P are Low), Z02215 reads
the data on the Host Parallel Data bus (HD0–HD7) for the external host to read the
contents.
In TRANSMIT DATA mode (when HWR, HCS, HA0, S/P are Low), Z02215
reads the contents placed on the Host Parallel Data bus (HD0–HD7) by the external host
processor.
PISR is the Status register. Bits 0, 1, 6 and 7 of this register are defined in
hardware, and bits 2, 3, 4, and 5 are defined in software as follows:
STATUS REGISTER:
OPERATING MODES:
The modem controller software features several different states of operation.
IDLE:
When the modem is in the IDLE state it is not communicating with another
modem. The modem accepts AT commands from the terminal while IDLE.
DIALING:
When the modem dials it performs the same tasks a person uses to dial a
telephone. The modem does not accept AT commands or data from the terminal while
dialing.
HANDSHAKE:
After successfully completing Handshaking the modems enter the ON-LINE state.
When a modem is in the ON-LINE state, data received from its terminal is sent over the
telephone line to the other modem. Data received from the other modem is sent to the
terminal.
COMMAND:
If the terminal sends a special escape sequence to a modem in the ON-LINE state,
the modem enters the COMMAND state. During COMMAND state the modem
maintains the connection with the other modem but does not pass data between the
terminal and the other modem. Instead, data received from the terminal is treated as AT
commands in the same way as if the modem was in the Idle state. The modem can be
returned to the ON-LINE state by the O command. Data received from the other modem
while a modem is in COMMAND state is discarded unless the modem can buffer it for
display on the terminal when the modem re-enters the ON-LINE state.
RETRAIN:
During a telephone line connection, the modem tries to remain synchronized with
the remote modem by adapting to changes in telephone line connection and bridging
transient noises such as call waiting, analog switching and cross talk. In V.22bis and
higher speed data modes, if the modem loses synchronization with the remote modem
data can not be received until synchronization is restored by a process called Retraining.
During Retraining the modem accepts data and commands from the terminal but does not
transmit data to, or receive data from, the other modem.
AT COMMAND SET:
Command lines are typed to the modem from the terminal when the modem is in
the IDLE or COMMAND state. The modem does not execute any of the commands in a
command line until after the command line is ended by the end-of-line character <CR>.
A command line is a string of characters starting with the A and T characters and ending
with a special end-of-line character, <CR>. Characters typed before the AT are ignored.
Command lines contain, at most, 40 characters after the AT. The modem does not
execute any of the commands in a command line that is too long. To echo command line
characters, use the E1 command.
A partial command line can be aborted by typing a Ctrl-X character. The modem
returns an OK result code and ignores the partial AT command line.
Command lines may contain several commands one after another. The Answer
(A), Dial (D), and Go ON-LINE (O) commands usually cause the following commands
in the command line to be ignored.
The characters in a command line are executed one at a time. Any unexpected
characters (except control characters) stop command line execution and return an
ERROR result code. Unexpected characters include numbers outside the range of values
accepted by the command. All control characters in a command line except Ctrl-X (and
the special characters such as <CR> and <BS>) are ignored. The numerical argument of
a command is assumed to be 0 if it is not provided. For example, the commands
ATH<CR> and ATH0<CR> both hang up the telephone line. When the modem has
executed a command line, the result code of the most recent command executed is
returned to the terminal. If the value written to a modem S-register is outside the range of
values accepted by the S-register, then its value is set to the nearest allowed value.
Leading 0s in numeric arguments, including S-register numbers, are ignored. For
example, both set S-register S1 to 2:
ATS1=2
ATS01=2
All numeric arguments, including S-register numbers, are decimal (base 10).
AT COMMAND PREFIX:
Each modem command line begins with the letters A and T. The modem uses
these characters to determine the data rate and parity from the terminal.
To repeat the commands in the most recent command line, type the letters A and /
instead of A and T.
This character is typed to end a command line. The value of the <CR> character
is stored in S-register S3. The default value is 13 (the ASCII carriage return character).
When the <CR> character is entered, the modem executes the commands in the
command line.
STARTING A SESSION:
• Type ATI3<CR> to the modem command line to check the version of the board
being used. This command returns the following result:
Z02215 Ver: V2.0
Z02202 Ver: 50
01-March-2007.
OK
This procedure is not required to start a session, but it ensures that the setup is
correct before the user continues.
• Type ATI4<CR> to the modem command line to check the country configuration
of the firmware. This command returns the following result:
ZiLOG/Softart V.22bis Modem Control for North America
OK
This step displays the current country profile. This step is not required to start a
session.
• Type the following to the modem command line to start dialing into the BBS (1-
408-292-0522).
ATDT9, 14082920522<CR>
The Embedded Modem Evaluation Board can be used to dial any other remote
modem with ATDT<number>. If a 9 must be dialed before making any outgoing calls,
the command is ATDT9, <number>, as depicted in the previous example.
• Wait for 5-10 seconds for the remote modem to answer. When the connection is
established, the modem answers:
CONNECT 2400
If the remote modem is BUSY, it echoes a BUSY. Try again until a
connection is achieved.
• The modem is now in the ON-LINE mode, connected to the remote modem at a
data rate of 2400bps. At this point, the modem can communicate with the remote
modem and exchange data.
ENDING A SESSION:
The modem may be instructed from the terminal program to disconnect the data
connection, the modem must be brought from DATA mode to COMMAND mode by
typing the Escape Sequence.
A slight delay is needed for the modem to recognize the Escape Sequence.
A result code is a line of text or a number the modem sends to the terminal to
indicate the result of command execution. Some Connect result codes indicate the
telephone line data rate. Table provides a list of the available result codes.
S-REGISTERS:
Modem S-registers contain the values of special purpose ASCII characters, timing
parameters and other modem parameters. The value of an S-register is modified by ATSn
= x, where n is the register number and x is the value to be stored in that particular
register. Each S-register has three values that may be configured for different countries: a
default value, an upper limit, and a lower limit. The values listed in Table are the default
values for North America.
CARRIER DETECTION:
TECHNICAL SPECIFICATIONS:
CONFIGURATIONS AND DATA RATES:
The Z02215 can be configured to any of the V.22bis operation modes. Table
provides the selectable options, the supported data rate, and the baud rate, and frequency
to be modulated.
DATA ENCODING:
The data encoding for the Z02215 meets ITU–T recommendations as well as Bell
standards.
An active hybrid circuit is added to the Analog Front End (AFE) of the Z02215 to
improve the received signal quality level by 20dB and to improve the modem
performance. The on-chip active hybrid reduces system level costs by reducing the
requirement for external components making the designs cost effective and space
efficient. The 2-wire to 4-wire hybrid interfaces to telecom coupling transformers in the
Data Access Arrangement (DAA). The off-hook and shunt relay drivers provide a drive
capability of 30 mA to allow the use of commonly available mechanical telecom relays.
COUNTRY CONFIGURATION:
The Z02215 contains modem controller code that is targeted to operate over a
North America-style telephone network with the DAA configuration illustrated in the
schematics at the end of this product specification. The customer may choose to
configure the modem for use on other telephone networks. This capability is enabled by
the addition of a serial EEPROM to hold various country tables. The EEPROM may be
omitted from the application if the customer chooses to operate with the default North
America-style parameters. If an EEPROM is not desired, the country table can also be
downloaded to the Z02215 from the host and stored in on-board RAM.
he Z02215 provides a means of loading information into the EEPROM for setting
Homologation or country approval tables. One way to set these tables is by choosing the
desired geographic region to be served in a DOS program, supplied by ZILOG, called
Diplomat™. This program interfaces to the modem through theserial port using hidden
AT commands, allowing reprogramming of the EEPROM.
Isolation transformer (T1) couples the primary (line) and secondary (modem)
sides, while providing high voltage isolation. This wet transformer (allowing DC current)
simplifies the circuit and reduces the cost of the DAA. On the Secondary side, the
transmit (TXA+ and TxA–) and receive (RxA+ and RxA–) are combined in the 4-wire to
2-wire hybrid circuit. On the Primary side, the off-hook relay switches the phone line
between a local handset (phone) or the modem.
The ring detect circuit consists of DC blocking capacitor C304, current limiting
resistor R305, zener diodes CR303 and CR304, optocoupler U303, and its reverse
protection diode D304. Protection elementsRV301, F301, C301, and C302 (and
transformer T1’s isolation) provide higher voltage capability for approval in some foreign
markets. C201 and C202, for example, may require replacement by Metal Oxide
Varistors (MOVs) or Gas Discharge Tubes (GDTs). The shunt relay reduces the DAA
impedance during pulse dialing. This relay is required for certain country approvals. The
CID relay provides a signal path (through C4) to receive Caller ID signals without taking
the line off-hook.
Start
Initialize Serial
Communication, Timersand
Read Temperature and
Interrupts.
Humidity From
SHT11
Initialize
Set
Display
Baud (Sensor)
LCD
Project
rateand
toTitle
1200
RTC
Read Date and Time From
HT1380 (RTC)
ot
? rN
o
sy
Bu
NO
Modem is disconnected