31-07-2012, 01:31 PM
Microcontroller-based Temperature Monitoring and Control
Microcontroller Based Temperature.pdf (Size: 7.42 MB / Downloads: 684)
Introduction
The term microcomputer is used to describe a system that includes a minimum of
a microprocessor, program memory, data memory, and input/output (I/O). Some
microcomputer systems include additional components such as timers, counters,
analogue-to-digital converters and so on. Thus, a microcomputer system can be
anything from a large computer having hard disks, floppy disks and printers, to
a single chip computer system.
In this book we are going to consider only the type of microcomputers that
consist of a single silicon chip. Such microcomputer systems are also called
microcontrollers.
Microcontroller systems
Microcontrollers are general purpose microprocessors which have additional parts
that allow them to control external devices. Basically, a microcontroller executes
a user program which is loaded in its program memory. Under the control of this
program, data is received from external devices (inputs), manipulated and then
data is sent to external output devices. A microcontroller is a very powerful tool
that allows a designer to create sophisticated I/O data manipulation algorithms.
Microcontrollers are classified by the number of bits in a data word. 8-bit microcontrollers
are the most popular ones and are used in many applications. 16-bit
and 32-bit microcontrollers are much more powerful, but usually more expensive
and not required in many small to medium general purpose applications where
microcontrollers are used.
Microcontroller features
Microcontrollers from different manufacturers have different architectures and
different capabilities. Some may suit to a particular application while some others
may be totally unsuitable. The hardware features of microcontrollers in general
are described in this section.
Supply voltage
Most microcontrollers operate with the standard +5 V supply. Some microcontrollers
can operate at as low as +2.7 V and some will tolerate +6 V without any
problems. You should check the manufacturers' data sheets about the allowed
limits of the supply voltage.
The clock
All microcontrollers require an oscillator (known as a clock) to operate. Mo~
microcontrollers will operate with a crystal and two capacitors. Some will operat with resonators or with external resistor-capacitor pair. Some microcontrollers
have built-in resistor-capacitor type oscillators and they do not require any external
timing components (e.g. PIC12C672). Resonators are not as stable as the
crystals but they are more stable than the resistor-capacitor networks.
Crystal
oscillators should be chosen for applications which require very accurate
timing. For applications where the timing stability requirements are very modest,
resonators should be chosen. If the application is not time sensitive you
should consider using external or internal (if available) resistor-capacitor timing
components for simplicity and low cost.
Timers
Timers are an important part of any microcontroller. A timer is basically a counter
which is driven from an accurate clock (or a division of this clock). Timers can be
8-bits or 16-bits long. Data can be loaded into the timers and they can be started
and stopped under software control. Most timers can be configured to generate
an interrupt when they reach a certain count (usually when they overflow). Some
microcontrollers offer capture and compare facilities where a timer value can be
read when an external event occurs, or the timer value can be compared to a
preset value and interrupts can be generated when this value is reached. Timers
can also be used to generate time delays in programs. It is typical to have at least
one timer on every microcontroller. Some microcontrollers may have three or
more while some others may have only two timers. The timer accuracy depends
upon the type of clock device used and a crystal device should be chosen for
very accurate timing applications.
Watchdog
Many microcontrollers have at least one watchdog facility, also known as the
Watchdog Timer (or WDT). A WDT is usually an 8-bit timer with a prescaler
option and is clocked from a free running on-chip oscillator. The watchdog is
usually refreshed by the user program at regular intervals and a reset occurs if the
program fails to refresh the watchdog. Watchdog facilities are commonly used
in real-time systems where it is required to check the proper termination of one
or more activities. All PIC microcontrollers are equipped with a WDT.
Reset input
This input resets the microcomputer. The reset logic is used to place the microcontroller
into a known state. The source of the reset can usually be selected by
the user and Power-on Reset (POR) is the most common form of reset in microcontrollers.
Most microcontrollers have resistors connected to the supply voltage
and this ensures that the microcontroller starts properly after the application
of power (POR). Microcontroller manufacturers specify the state of the various
registers after a reset signal is applied to a microcontroller. Some microcontrollers
have internal reset circuitry which do not require any external components.