Microcontrollers - CE 141: Microprocessor Systems

Download Report

Transcript Microcontrollers - CE 141: Microprocessor Systems

MICROCONTROLLERS
What is a microcontroller?

A microcontroller is a nifty little gadget
that houses a microprocessor, ROM (Read
Only Memory), RAM (Random Access
Memory), I/O (Input Output functions),
and various other specialized circuits all in
one package.
Zilog Z-80
What is the Z-80 family of components?

significant advancement in the state-of-the-art of microcomputers. It
can be configured with any type of standard semiconductor memory
to generate computer systems with an extremely wide range of
capabilities. With additional memory and I/O devices a computer can
be constructed with capabilities that only a minicomputer could
previously deliver.
Advantages…




fully software compatible with the popular 8080A CPU
superior in both software and hardware capabilities (less cost and
more features)
offers the user significant speed advantages (up to 16 MHz clock rate)
including full software support
Z-80 CPU

Z80 microprocessor is an 8 bit CPU with a
16 bit address bus capable of direct access
of 64k of memory space. It has a language
of 252 root instructions and with the
reserved 4 bytes as prefixes, accesses an
additional 308 instructions. The Z80 was
modeled after the 8080 and contains the 78
- 8080 opcodes as a subset to it's language.

Programming features include an accumulator
and six eight bit registers that can be paired as 316 bit registers. In addition to the general
registers, a stack-pointer, program-counter, and
two index (memory pointers) registers are
provided. While not in the same league as the
80486 or 68000 series, the Z80 is extremely
useful for low cost control applications. One of
the more useful features of the Z80 is the built-in
refresh circuitry for ease of design with DRAMs.

It comes in a 40 pin DIP package. And
recently also in a 44 pin SMD and QFP. It
has been manufactured in A, B, and C
models, differing only in maximum clock
speed. It also has been manufactured as a
stand-alone microcontroller with various
configurations of on-chip RAM and
EPROM.
Peripheral Interface Controller (PIC)
What is a PIC?

PIC stands for Peripheral Interface
Controller, which is Microchip, Inc.'s
trademark for their line of 8-16 bit
microcontrollers. Actually, Microchip's
official name for the lineup is PICMicro.
More about PICs…

Various models are available with different
peripherals built in such as; multiple timers, A/D
conversion, serial interfacing, LCD control, etc.
They are also available in SMT packaging or
standard DIP packaging with as many as 68 pins
or as few as 8 pins. Some of the latest versions
(and many future versions) have flash memory,
making for simple erasures and reuse. Most of the
current versions employ EPROM which requires
erasure with a special UV lamp.

If you want to develop firmware for a PIC, you will need
an erasable version. The erasable types available are of
the EPROM, EEPROM, and flash memory varieties.
EEPROM and flash memory devices are great because
they don't need that UV eraser and are less expensive.
Unfortunately the flash and EEPROM (EEPROM is being
phased out in favor of flash) versions are not available in
all configurations, but it seems Microchip is expanding
their horizons. One of the most popular versions of the
PIC for beginners is the PIC16F84. It uses flash memory
(hence the F in its part number), and has 18 pins. Thirteen
of these pins can be used for input or output purposes.
What can one use a PIC for?

PICs are very versatile and can be used in
practical projects such as burglar alarms,
caller ID boxes, remote controls, clocks,
and just about anything you can think of
that could use a single chip self contained
computer.
Why choose PICs?

Because getting into them wasn't a big
investment They have a lot of bang for the
buck. There are only about 35 simple
RISC-type (Reduced Instruction Set
Computer) commands to learn. There is a
lot of help available for beginners.
Developing the PIC…






First choose the PIC.
Learn a language.
Choose the programmer.
Wire the circuit on the
target board.
Write the code.
Program.
Sample Program: Blinking Lights

list p=16f84
porta equ 0x05
portb equ 0x06

org 0x000








start movlw 0x00
tris porta
movlw 0x00
tris portb
clrf porta
clrf portb

hi bsf porta, 0
bcf porta, 0
goto hi

end

