You are on page 1of 29

7/8/2009

INTRODUCTION OF MICROCONTROLLER

pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller

INTRODUCTION OF MICROCONTROLLER 68HC11 MICROCONTROLLER ARCHITECTURE OF 68HC11 INSTRUCTIONS CYCLE

pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller

7/8/2009

pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller

Definition of microcontroller :
A microcontroller (also MCU or C) is a functional computer system-on-a-chip. It contains a processor core, memory, and programmable input/output peripherals (http://en.wikipedia.org/wiki/Microcontroller) Microcontrollers include an integrated CPU, memory (a small amount of RAM, program memory, or both) and peripherals capable of input and output. (Embedded Systems Dictionary" by Jack Ganssle and Mike Barr, p.173)

pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller

7/8/2009

Microcontroller - put a limited amount of most commonly used resources inside one chip
pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller 5

pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller

7/8/2009

pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller

The first computer system on a chip optimized for control applications microcontroller was the Intel 8048 released in 1975, with both RAM and ROM on the same chip. This chip went on to be found in over a billion PC keyboards, and numerous applications. Most microcontrollers at this time had two variants. One had an erasable EEPROM program memory, which was significantly more expensive than the PROM variant which was only programmable once.
pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller 8

7/8/2009

In 1993, the introduction of EEPROM memory allowed microcontrollers (beginning with the Microchip PIC16x84)to be electrically erased quickly without an expensive package as required for EPROM, allowing both rapid prototyping, and In System Programming. The same year, Atmel introduced the first microcontroller using Flash memory. Other companies rapidly followed suit, with both memory types.
pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller 9

8-Bit Motorola Controllers (6805,68705,68HC11,68HC12) Microchip PIC-www.microchip.com Atmel AVR Hitachi H8 Zilog Z8, Hitachi 64180 (Z80) Texas Instruments TMS370

pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller

10

7/8/2009

The integrated circuit from an Intel 8742, an 8-bit microcontroller that includes a CPU running at 12 MHz, 128 bytes of RAM, 2048 bytes of EPROM, and I/O in the same chip.
pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller 11

A PIC 18F8720 microcontroller in an 80-pin TQFP package.

pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller

12

7/8/2009

MH68HC11-Microcontroller
pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller 13

Automotive Home applications (remote control, TV, telephones, pager, laser printer & etc) Motor control (stepper motor) Mechatronic Medical solution Utility metering

pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller

14

7/8/2009

pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller

15

pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller

16

7/8/2009

pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller

17

pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller

18

7/8/2009

pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller

19

pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller

20

10

7/8/2009

The 68HC11 (6811 or HC11 for short) is a 8bit microcontroller (C) family originally from Motorola, now produced by Freescale Semiconductor, descended from the Motorola 6800 microprocessor. It is a CISC microcontroller. The 68HC11 devices are more powerful.

pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller

21

pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller

22

11

7/8/2009

pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller

23

8K bytes of ROM 512 bytes of EEPROM 256 bytes of RAM (all saved during standby) An enhanced 16-bit Timer system, including
A four-stage programmable Three Input Capture functions Five Output Compare functions An 8 bit Pulse Accumulator circuit
pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller

24

12

7/8/2009

An enhanced NRZ Serial Communications Interface (SCI) A Serial Peripheral Interface (SPI) An eight-channel, 8-bit Analog-to-Digital Converter (ADC) A real-time interrupt circuit A Computer Operating Properly (COP) watchdog system Availability of the IC in dual in-line or Leaded Chip Carrier Packages (DIP or LCCP)

pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller

25

An enhanced 6800/6801 instruction set 8-bit multiplication and 16-bit division instructions Bit manipulation instructions A WAIT mode A STOP mode

pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller

26

13

7/8/2009

pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller

27

pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller

28

14

7/8/2009

M68HC11 consists of four (4) basic parts:


Central processor unit (CPU) Internal Memory registers I/O subsystem

pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller

29

pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller

30

15

7/8/2009

- These parts are connected internally by an internal bus. - I/o subsystem allows the MPU to exchange information with the outside world. - The I/O subsystem is grouped into units called I/O ports. - Each I/O port has I/O lines (usually eight lines) to transfer information between the external devices and the ports. These lines can be input only, output only, or programmable to be either. - Each port also has its own I/O register.

pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller

31

CPU The CPU consists of three main sections Arithmetic Logic Unit (ALU) Registers and Accumulators Control Unit

pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller

32

16

7/8/2009

ALU
performs arithmetic and logic operations on operands. The operands are held temporarily in accumulators/ registers. Inputs to the ALU may come from accumulators or register , and the results are placed back in accumulators. The type of operation is determined by the control unit.

pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller

33

Registers & accumulator


Registers and accumulators are high-speed temporary memory locations during CPU operations. They exchange information through one or more internal buses. Registers are divided into;
PC IR SP SR AR

pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller

34

17

7/8/2009

Program Counter,PC
At the beginning of a program execution, the PC is loaded with the starting address of that program it always points to the location of the next instruction

Instruction Register,IR
The IR extracts the operation code (opcode) from an instruction. The control unit decodes the contents of the IR and generates the necessary control signals

Stack pointer,SP
specially reserved area in memory Stacks are used mainly during subroutines or interrupt.
pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller 35

Flag @ Status register,SP


status register consists of flag bits and control bits Flags are set automatically during arithmetic and logic operations. Such flags include N, Z, V, C and so on.

Address register, AR
The PC register sends the pointed to address to the AR register The AR register then sends this address to the address bus to select this address in memory.

pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller

36

18

7/8/2009

Control units
The control unit includes the instruction decoding, timing, and control circuitry. The control unit generates two groups of signals:
Internal control signals for activation of the ALU and the opening and closing of the data paths between registers. External control signals concerning the memory and I/O. These signals are sent either for activation of data transfer or as a response to an interrupt.

pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller

37

Memory

The memory unit stores the program to be executed and data that are to be operated on by the program. The memory unit operation is controlled by CPU signals (read and write). When the CPU sends data to the memory, it is called a write program, and when the CPU receives data from the memory, it is called a read operation.
pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller

38

19

7/8/2009

Memory is divided into internal and external memory. Internal memory usually means memory within the chip. Examples of memory include RAM, ROM, PROM, EPROM and EEPROM. External memory generally means memory outside the chip. This type of memory includes the semiconductor type and serial memory such as magnetic disks, magnetic tapes and bubble memory.
pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller 39

Types of IC memory
Memory ICs may be volatile or nonvolatile. Volatile memory loses its data after the power is removed (Exp:RAM) nonvolatile memory, these ICs store data permanently even when power is removed from the chip (Exp: PROM,EPROM,EEPROM)

pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller

40

20

7/8/2009

Random access memory, RAM


There are two types of RAM; SRAM
Static RAM (SRAM) Dynamic RAM (DRAM)

DRAM

uses an integrated flip-flop SRAMs are fast, need no refresh circuitry, and are ideal for small programs (less than 16K). DRAMs are usually organized for storing a single bit for location which is referred to as x1 organization. A DRAM storage cell consists of one MOSFET and a capacitor.
pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller 41

SRAM uses an integrated flip-flop


pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller 42

21

7/8/2009

input lines (A0 An). row address strobe (RAS) column address strobe (CAS) write enable (WE) line indicates whether this access is for reading or writing. A logic 1 indicates a read operation, while a logic 0 indicates a write operation. The advantages of DRAMs over SRAMs include their high density, lower power dissipation, and greater cost-effectiveness in large programs (more than 16K).

pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller 43

Block diagram & pin configuration of DRAM


pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller 44

22

7/8/2009

Read only memory, ROM


consists of a MOSFET or a bipolar transistor. Types of ROM:
PROM programmable ROM (one-shot programmable) EPROM erasable programmable ROM (In an erasing operation, this windows is exposed to ultraviolet (UV) light for between 30 to 50 minutes) EEPROM Electrically erasable PROMs (EEPROMs) use a floating-gate technology that allows them to be erased electrically.

pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller

45

Memory characteristic

Speed Memory speed is defined in terms of access time and cycle time. Access time is defined as the time elapsing from the moment we present a stable address until memory responds with stable data. The cycle time determines how fast we can access memory. Density - Density is defined as the number of bits per memory chip. Power Dissipation - Power Dissipation is specified in terms of operating power and standby power. Low standby power represents a very important advantage. Cost The price of memory devices affects the cost of the overall memory subsystem.
pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller 46

23

7/8/2009

Memory characteristic

pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller

47

Registers
ACCUMULATORS (A, B and D) INDEX REGISTERS (X and Y) STACK POINTER (SP) PROGRAM COUNTER (PC) CONDITION CODE REGISTER (CCR)

pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller

48

24

7/8/2009

Registers set
pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller 49

ACCUMULATORS (A, B and D) Accumulator A & B is used for 8-bit arithmetic and data manipulation operations. Accumulator D is used for 16-bit arithmetic and data manipulation operations.

pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller

50

25

7/8/2009

INDEX REGISTERS (X and Y)

The 16-bit index registers X and Y are used for the indexed addressing mode. The stack is an area of RAM used for temporary storage of data. The program counter is a 16-bit register that holds the address of the next instruction to be executed.

STACK POINTER (SP)

PROGRAM COUNTER (PC)

pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller

51

CONDITION CODE REGISTER (CCR) The CCR contains 8 bits: 5 status bits (called flags), 2 interrupt mask bits, and a stop disable bit. The 5 status flags are as follows: carry/borrow (C), overflow (V), zero (Z), negative (N), and half-carry (H). The two interrupt flags are I and X bits. The S bit is the stop bit.

pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller

52

26

7/8/2009

pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller

53

The sequence of steps involved in fetching and executing an instruction from the memory is known as an instruction cycle. An instruction cycle consists of a few machine cycles. Types of machine
Read memory Write memory Interrupt operation Interrupt acknowledge

The machine cycle are synchronized by the internal clock cycles. A machine cycle consists of three to four clock cycles.
pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller 54

27

7/8/2009

pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller

55

In machine cycle 1, the CPU reads the first word of the instruction using the contents of the Program Counter (PC). This is accomplished by the end of clock cycle T3. This machine cycle is extended by one additional clock cycle (T4), to give the CPU a chance to decode the op-code and the address mode fields of the instruction. At the end of T4, the CPU knows that the instruction includes one more word and also known what type of operation is required.

pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller

56

28

7/8/2009

In machine cycle 2, the CPU reads the address of the memory. In machine cycle 3, knowing the address, the CPU fetches the operand from memory. In machine cycle 4, the CPU adds 1 to the operand In machine cycle 5. the CPU stores the results back into memory.

pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller 57

What is microcontroller? Explain the basic structure of microcontroller. What is the main components in microprocessor microcontroller? State the different between microprocessor & microcontroller. Give a example of microcontroller chip.

pjb/jke/maisarah/e4160-chapter 2: Introduction of microcontroller

58

29

You might also like