Lect1 - Intro Microcomputer
Lect1 - Intro Microcomputer
(ECEg4161)
Lecture I
2
Microprocessor(1/2)
• The microprocessor (MPU) is a computing and logic device
that executes binary instructions in a sequence stored in
memory.
7
…cont’d
• The majority of microcontrollers in use today are embedded in
other machinery, such as automobiles, telephones, appliances,
and peripherals for computer systems. These are called
embedded system.
• E.g. DVD player, hi-fi, TV, air-conditioner, washing machine,
ECG (electrocardiogram), blood pump, blood pressure meter,
Alarm, remote sueveilance, smart card + reader , Motor speed
control, robot, Keyboard, printer, automotive ignition control,
Missile, torpedo, ejection seat, cell phones, modem, radio,
radar, satelite etc.
8
Illustrative Design Example(1/3)
• µP vs µC based system
– Assume we want to designing a temperature
monitoring system consisting LCD, temp. sensor,
fan, heater and flash memory to save temperature
readings in a constant interval generated by timer.
– Design the system
a) As a µP based system
b) As a µC based system
9
Illustrative …(2/3)
• µP Temperature System
10
Illustrative …(3/3)
• µC Temperature System
11
Types of Microcontroller
• Parallax Propeller
• Freescale 68HC11 (8-bit)
• Intel 8051
• Silicon Laboratories Pipelined 8051 Microcontrollers
• ARM processors (from many vendors) using ARM7 or
Cortex-M3 cores are generally microcontrollers
• STMicroelectronics STM8 (8-bit), ST10 (16-bit) and STM32
(32-bit)
• Atmel AVR (8-bit), AVR32 (32-bit), and AT91SAM (32-bit)
• Freescale ColdFire (32-bit) and S08 (8-bit)
• Hitachi H8, Hitachi SuperH (32-bit)
• Hyperstone E1/E2 (32-bit, First full integration of RISC and
DSP on one processor core [1996])
• Infineon Microcontroller: 8, 16, 32 Bit microcontrollers for
automotive and industrial applications.
12
… cont’d
• MIPS (32-bit PIC32)
• NEC V850 (32-bit)
• Microchip PIC (8-bit PIC16, PIC18, 16-bit dsPIC33/PIC24)
• PowerPC ISE
• PSoC (Programmable System-on-Chip)
• Rabbit 2000 (8-bit)
• Texas Instruments Microcontroller MSP 430 (16-bit), C2000
(32-bit), and Stellaris (32-bit)
• Toshiba TLCS-870 (8-bit/16-bit)
• Zilog eZ8 (16-bit), eZ80 (8-bit)
• etc
13
Choosing microcontroller
• Three major criterion to choose
microcontroller for your project or product are:
1. Meeting the computing needs of the task at hand
efficiently and effectively
2. Availability of software and hardware
development tools such as compiler, assembler,
debugger and emulator.
3. Wide availability and reliable source of the
microcontroller
14
Microchip PIC
• PIC is a family of Harvard architecture microcontroller
made by Microchip Technology. The name PIC initially
referred to "Peripheral Interface Controller“ . PIC
microcontrollers were the first RISC microcontroller.
15
PIC Microcontroller product family
• 8-bit microcontrollers • 32-bit microcontrollers
– PIC10 – PIC32
– PIC12
• 16-bit digital signal
– PIC14
controllers
– PIC16
– dsPIC30
– PIC17
– PIC18 – dsPIC33F
• 16-bit microcontrollers
– PIC24F
– PIC24H
16
PIC18F features(1/3)
• Common PIC18 features: High current (25mA) sink/source
– 77 instructions capability
Up to five capture/compare/PWM
– PIC16 source code compatible modules
– Program memory addressing up Master synchronous serial port
to 2Mbytes module (SPI and I2C modes)
– Data memory addressing up to Up to two USART modules
Parallel slave port (PSP)
4Kbytes
Fast 10-bit analog-to-digital
– DC to 40MHz operation
converter
– 8X8 hardware multiplier Programmable low-voltage
– Interrupt priority levels detection (LVD) module
– 16-bit-wide instructions, 8-bit- Power-on reset (POR), power-up
wide data path timer (PWRT), and oscillator start-
up timer (OST)
– Up to two 8-bit timers/counters Watchdog timer (WDT) with on-
– Up to three 16-bit chip RC oscillator
timers/counters In-circuit programming
– Up to four external interrupts 17
PIC18F features(2/3)
• In addition, some microcontrollers in the PIC18F
family offer the following special features:
– Direct CAN 2.0 bus interface
– Direct USB 2.0 bus interface
– Direct LCD control interface
– TCP/IP interface
– ZigBee interface
– Direct motor control interface
18
PIC18F features(3/3)
•Address bus
– 21-bit address bus for program memory addressing capacity: 2 MB of
memory
– 12-bit address bus for data memory addressing capacity: 4 KB of memory
•Data bus
– 16-bit instruction/data bus for program memory
– 8-bit data bus for data memory
•Control signals
– Read and Write
19
Program Memory
The RESET vector
address is at 0000h and A 21-bit program counter is
the interrupt vector capable of addressing the 2-
addresses are at 0008h Mbyte program memory space.
and 0018h.
22
Registers
– Bank Select Register (BSR)
• 4-bit register used in direct addressing the data memory
– File Select Registers (FSRs)
• 16-bit registers used as memory pointers in indirect addressing data memory
– Program Counter (PC)
• 21-bit register that holds the program memory address while executing programs
23
Example: PIC 18FXX2 Architecture
• Consists four devices: PIC18F242, PIC18252, PIC18442,
PIC18452
24
.
25
Block diagram of the PIC18F452 microcontroller
26
PIC18F452 I/O Ports
• Five I/O ports
– PORT A through PORT E
– Most I/O pins are multiplexed
– Generally have eight I/O pins with a few exceptions
– Addresses already assigned to these ports in the design stage
– Each port is identified by its assigned SFR
27
Parallel I/O ports Main Features
• Simple memory mapped access
• Can be configured through software as either
input or output
• Ability to set or reset individual bits
• Can have internal pull-ups
• Can drive small loads like LEDs
• Can be multifunction
• Different capability for pins (i.e. larger
current)
28
PIC Architecture
• Two architectures of microcomputer exists
– Harvard Architecture (-PIC uses this architecture)
– Von Neumann (Princeton) Architecture(-8086 µP and
other large percentage of µC use this architecture)
29
RISC vs CISC
Reduced Instruction Set Computer- Complex Instruction Set Computer-
RISC CISC
31