AVOP-ELEKTRO-VLC-001
Download
Report
Transcript AVOP-ELEKTRO-VLC-001
Training program: Mechanic - elektrotechnician
Program name:
Digital processing - microprocessors
III. class
Microcontrollers
Elaborated by: Vlastimil Vlček
Projekt Anglicky v odborných předmětech, CZ.1.07/1.3.09/04.0002
je spolufinancován Evropským sociálním fondem a státním rozpočtem České republiky.
Microcontroller – what is it really?
• A microcotroller is a one-chip computer.
• It belongs to the group of programmable logical circuits. It is,
therefore, a circuit the activity of which is not outwardly firmly
determined by its inner structure, but is controlled, step by step, by a
program which is saved in its internal memory.
• The entire activity which a microcontroller exhibits towards its
environment is therefore determined by the activity of this program.
• The program is a sequence of instructions forming a definite
functional unit and performing a particular activity.
• A microcontroller (and also any other computer) “inside” can do what
it was “taught” by its producer, outwardly it can do what we,
programmers, teach it. Therefore, “a common language” understood
by both the computer and the programmer must exist. This common
language is called a programming language.
• The basic programming language of microcontrollers is
ASSEMBLER.
What does it look like?
Where do we find them?
•
•
•
•
•
•
•
•
Consumer electronics: TV sets, videotape recorders, tape recorders, cameras,
telephones, electronic musical instruments and accessories, cine cameras, music
players, microwave ovens, fridges, washing machines, remote controls, digital clocks,
electronic cash registers, timers …
Automobile technology: board computers, burning control, brake system, alarm
devices, immobilizers, remote control, communication systems, navigation. Battery
chargers, diagnostic devices…
Industry: security systems, data collection and evaluation, guarding of premises,
alarms, fire-protection systems, chip-card readers, optical readers, automatic door
systems.
Robotics, mechatronics: control of robots and manipulators in industry, control of
pneumatic a hydraulic systems, control of direct-current and stepper motors…
Computer and measurement technology: remote reading of electric and nonelectric quantities, transcoders, replacement for classic digital circuits…
Civil and military aeronautical engineering, astronautics: navigational, positional
and meteorological systems, communicational systems, navigation and control of
weapon systems…
Entertainment elektronics: electronic games, toys, lights, bike flashlights …
Stage technology: control of lighting and acoustic equipment, automated audio
mixers, effect devices …
A giant and a dwarf …
Comparison of a classic computer with a
microcontroller
From the comparison it is obvious that
where a PC needs many other circuits
and busbars for its activity, a
microcontroller needs only a power
source because all necessary circuits,
such as a clock frequency source,
busbars and ports are already placed
on the chip.
“Classic” computer (PC):
• First and foremost requirement – universality and expandability. This results in a large
number of processor pins, complicated motherboard, etc.
• The consequences of the requirement for a maximum computer performance include
high power consumption, the necessity for effective cooling and, therefore,
considerable dimensions of the whole computer.
• The producer offers just a few processor types for the prices reaching up to
thousands of CZK (only for a processor!).
Microcontroller (one-chip computer):
• Relatively closely specialized in a particular task type, therefore a small number of
ports is required.
• Program in a machine code – low memory of the program and data will do.
• Mostly only a few ports suffice. Almost all port pins have more functions which are
changeable with the help of software while the program is running.
• Power consumption is in mA, in a sleep mode in uA.
• Producers offer hundreds of types of microcontrollers which differ in the number of
I/O ports, in the size of the internal memory and in the quantity of the internal HW
devices (timers, A/D converters, etc.) A cosumer has, therefore, a possibility to
choose a type that meets his/ her requirements exactly, which lowers the final price of
a device significantly.
• The price ranges from tens of CZK to hundreds of CZK at most.
What are the main differences in the solution of the
same device with standard logic and with a
microcontroller?
Solution with standard logic circuits:
The function of a device is firmly determined by circuitry.
Every change of a function results in a complex modification of hardware.
The same is true of error corrections in the design.
Solution with microcontrollers:
The function of a device is determined by the program.
The change of a function is carried out through changing the program,
mostly without any intervention into hardware.
If an error occurs in the design of a device, it can be mostly corrected by the
modification of the particular part of the program, without any necessity of
intervening into the printed circuit board.
Program replacement can result in a functional change of the whole device
while preserving the existing hardware (digital clock/ timer/ stop watch).
Advantages of designs with microcontrollers
•
Circuit simplicity: Fewer parts, simpler printed circuit, considerably smaller
dimensions.
•
Lower fault rate: Fault rate is directly proportional to the number of parts, to the
number of bonds, and to the number of drilled holes. Simpler board = lower fault rate.
•
Prize: Wide production assortment enables us to find easily the most appropriate
type for a given application. Fewer packages = lower price.
Low current consumption: Sleep mode – long-term battery supply.
•
•
Universality and variability: Easy modification or change of the function without any
necessity of intervening into HW, easy troubleshooting, possibility of further
development and adding other functions.
•
Quick design and prototype implemantation: With the use of complete libraries of
program routines, it is possible to shorten considerably the time needed for the
development of a device. Most of the time needed for development is shifted to the
area of programming.
Summary of subject matter
• What are the main advantages of the designs with microcontrollers?
• Do the designs with microcontrollers have any disadvantages?
• Compare a microcontroller with a PC (differences in the design and
in the use)
Summary of subject matter
•Give a few examples of electronic devices from your environment in
which microcontrollers are used.
•Give an example of an electronic device in which microcontrollers are
not used yet.
•Do you have any device with a microcontroller with you at the
moment?
Literature used
Datasheet Microchip PIC16F882/883/884/886/887 DS41291E
(http://www.microchip.com)
Jiří Hrbáček: Mikrořadiče PIC16CXX a vývojový kit PICSTART (BEN – technická literatura,
Praha 2001 3. dotisk 4. vydání)