Microcontrollers. An embedded microcontroller is a chip which a computer processor with all it’s support functions (clocking and reset), memory, and i/O.

Slides:



Advertisements
Similar presentations
Parul Polytechnic Institute
Advertisements

Autumn 2012C.-S. Shieh, EC, KUAS, Taiwan1 The 8051 Family Microcontroller Chin-Shiuh Shieh Department of Electronic Engineering.
MICROPROCESSORS TWO TYPES OF MODELS ARE USED :  PROGRAMMER’S MODEL :- THIS MODEL SHOWS FEATURES, SUCH AS INTERNAL REGISTERS, ADDRESS,DATA & CONTROL BUSES.
Chapter 2 HARDWARE SUMMARY
8051 Core Specification.
Processor System Architecture
Msc. Ivan A. Escobar Broitman Microprocessors 1 1 The 8051 Instruction Set.
Micro-controller or embedded controller
16.317: Microprocessor System Design I Instructor: Dr. Michael Geiger Spring 2012 Lecture 29: Microcontroller intro.
Architecture of the 8051 INTERNAL DATA BUS Oscillator & Timing Programmable I/O (32 Pins) 80C51 CPU 64K byte Expansion Control Serial I/O 4K Program Memory.
Microcontroller Intel 8051
The 8051 Microcontroller architecture
Micro controllers A self-contained system in which a processor, support, memory, and input/output (I/O) are all contained in a single package.
MICROCONTROLLER INSTRUCTION SET
Hardware Summary ECE473/573 Microprocessor System Design, Dr. Shiue.
Microcontroller Intel 8051 [Architecture]. The Microcontroller Microcontrollers can be considered as self-contained systems with a processor, memory and.
Microcontrollers.
CoE3DJ4 Digital Systems Design Chapter 3: instruction set summary.
CIT 673 Created by Suriyong1 MCS51 ASSEMBLY Language Resources
CoE3DJ4 Digital Systems Design Hardware summary. Microprocessors vs. Microcontrollers Microprocessors are single-chip CPU used in microcomputers Microcontrollers.
MCS51 - part 1.
1 The /27/ Today over fifty companies produce variations of the Several of these companies have over fifty versions of the 8051.
8051 Micro controller. Architecture of 8051 Features of 8051.
8085. Microcomputer Major components of the computer - the processor, the control unit, one or more memory ICs, one or more I/O ICs, and the clock Major.
Microcontrollers Class : 4th Semister E&C and EEE Subject Code: 06ES42
Lecture Set 4 Programming the 8051.
Intel 8051 Another family of microcontroller is the Intel 8051 family. The basic 8051 microcontroller has four parallel input/output ports, port 0, 1,
The 8051 Microcontroller Prepared By, R-THANDAIAH PRABU M.E.,
Presented by Sadhish Prabhu
Computer Architecture Lecture 4 by Engineer A. Lecturer Aymen Hasan AlAwady 17/11/2013 University of Kufa - Informatics Center for Research and Rehabilitation.
Architecture of the 8051 Microcontroller
1 Basic Processor Architecture. 2 Building Blocks of Processor Systems CPU.
8051 Micro Controller. Microcontroller versus general-purpose microprocessor.
8085 INTERNAL ARCHITECTURE.  Upon completing this topic, you should be able to: State all the register available in the 8085 microprocessor and explain.
HJD Institute of Technical Education & Research- Kera(Kutch) The 8051 Microcontroller architecture PREPARED BY: RAYMA SOHIL( )
DEPARTMENT OF ELECTRONICS ENGINEERING V-SEMESTER MICROPROCESSOR & MICROCONTROLLER 1 CHAPTER NO microcontroller & programming.
1 Contents: 3.1 Instruction format and Addressing Modes 3.2 Instruction Introduction Chapter 3 Instruction system.
Embedded Microcontroller Systems
8051 Pin - out PORT 0 PORT 1 PORT 2 PORT 3.
CHAPTER ADDRESSING MODES.
Classification of Instruction Set of 8051
Introduction to Micro Controllers & Embedded System Design Microprocessor/Microcontroller Department of Electrical & Computer Engineering Missouri University.
Microprocessor Systems Design I
UNIT – Microcontroller.
Microprocessor Systems Design I
8086 Microprocessor.
Lecture Set 5 The 8051 Instruction Set.
Introduction to Micro Controllers & Embedded System Design Interrupt
Data Processing Instructions
An Introduction to Microprocessor Architecture using intel 8085 as a classic processor
Data bus CPU General Purpose microprocessor RAM ROM I/O Port Timer
Microcontroller Intel 8051
SCHOOL OF ELECTRONICS ENGINEERING Electronics and Communication
Introduction to Micro Controllers & Embedded System Design Microprocessor/Microcontroller Department of Electrical & Computer Engineering Missouri University.
Timer.
Introduction to Micro Controllers & Embedded System Design Addressing Mode Department of Electrical & Computer Engineering Missouri University of Science.
The 8051 Microcontroller (8 bit )
Unit – Microcontroller Tutorial Class - 2 ANITS College
8051 Microcontroller.
Introduction to Micro Controllers & Embedded System Design Instruction set Department of Electrical & Computer Engineering Missouri University of Science.
Md. Mojahidul Islam Lecturer Dept. of Computer Science & Engineering
First Design Key board R L S.
Md. Mojahidul Islam Lecturer Dept. of Computer Science & Engineering
Important 8051 Features On chip oscillator 4K bytes ROM 128 bytes RAM
UNIT-VIII 8051 Microcontroller Architecture Register set of 8051
INTRODUCTION TO 8051, A 8-BIT MICROCONTROLLER
The 8051 Microcontroller (8 bit )
EECE.3170 Microprocessor Systems Design I
Compiled by Dr. N.Shanmugasundaram, HOD, ECE Dept, SECE.
Computer Operation 6/22/2019.
Presentation transcript:

Microcontrollers

An embedded microcontroller is a chip which a computer processor with all it’s support functions (clocking and reset), memory, and i/O built into the device. Power dist Control store Reset control Clock and timing RAM Microcontroller block diagram

types of microcontrollers Embedded – All the hardware required to run the application is provided on the chip. typically: power, reset, clock, memory and IO. External memory – some microcontrollers allow the connection of external memory. Microcontroller primarily differ from a microprocessor in the areas of built-in peripheral features. These features could include memory device selection, timers, interrupt controllers, DMA, and IO devices like serial ports.

Processor Architecture Harvard and Princeton – US govt asked for computer to be used with naval shell distance for varying elevations and environmental conditions. – Princeton provided ‘Von Neumann’ architecture where common memory space are used for storing program and data. Memory unit is responsible for arbitrary access to memory space between reading instructions and passing data back and forth with processor and its internal registers. Advantages: simple memory interfacing and management. – Harvard proposes a design that used separate memory banks for program storage, the processor stack, and variable RAM. Advantage: execute instruction in fewer cycles than Von Neumann.

Princeton architecture block diagram program ROM Variable RAM Stack RAM memory interface unit Processor and built- in registers instruction decode Data Add Ctrl

Harvard architecture block diagram program ROMVariable RAM PC Stack Processor and built-in registers instruction decode Data Add Ctrl Data Add Ctrl

CISC versus RISC – RISC stands for “Reduced Instruction Set Computers”. Instructions are as bare a minimum as possible to allow users to design their own operations. – CISC stands for “Complex Instruction Set Computers”. Large number of instructions, each carrying out a different permutation of the same operation.

Microcontroller memory types control store – program memory or firmware. this memory space is the maximum size of the application that can be loaded into the microcontroller and that the application also includes all the low-level code and device interface necessary to execute an application. – nonvolatile – 8051 has 5 different types of control store : none, mask ROM, PROM, EPROM and EEPROM/Flash

variable area – 4 types variable data storage: bits, registers, variable RAM, PC stack. – in 8051 they are implemented as SRAM. – program counter stack – part of the RAM. – LIFO memory. – must be initialized by the starting address of the stack area.

Hardware interface registers (I/O space) – could be memory mapped or IO mapped. – mostly in variable memory space. program ROM IO registers variable RAM Stack Counter program ROM IO registers variable RAM Stack Counter IO in Princeton architecture memory mapped IO separate IO space

IO in Harvard architecture program ROM registers space IO registers program ROM registers space IO registers program ROM register space IO registers IO registers in program ROM IO registers in register space IO registers in separate space

Microcontroller features clocking IO pins interrupts timers Peripherals ADC inputs DAC outputs PWM outputs Basic features

Reset vector Interrupt 0 8 byte data area Interrupt 1 8 byte data area 8051 has two interrupts B interrupts Upon receipt of an interrupt: 1.Save the context register information 2.Reset the hardware requesting interrupt. 3.Reset the interrupt controller. 4.Process the interrupt. 5.Restore the context information. 6.Return to the previously executing code. Context Registers are the registers used by the interrupt during the operation of the cdoe. Exmple: addc during executing this code, Context registers: ACC, status register, R0 register. These are saved in Stack. Priority Nesting

Timers/counters Event detection, timed control signal generation, counter etc. Reads from or written to by the processor and is given by some constant frequency source. Generates an interrupt at the overflow. Run by µC clock or external clock.

8051 several clock cycle makes an instruction cycle instruction cycle consists of 12 clock cycles. application should be run using slower clock speed to reduce power consumption. Dallas version of 8051 is 87C51 has EPROM as control store and CMOS device: 24Mhz 12 cycle per instruction 4Kbyte of Control stote 128 bytes of RAM 32 I/O lines Two 8/16-bit times Multiple internal and external interrupts sources Programmable serial ports Interface upto 128Kbytes of external memory

8051 architechture second generation MC Basic architecture

8051 memory-register map up to 64 KB of external EPROM/ ROM up to 60 KB of external ROM/ EPROM 4 KB of internal ROM/ EPROM 22 SF registers up to 64 KB of external RAM 128 KB internal RAM or and program memorydata memory 0000 FFFF FFF FFFF FFFF F F8 SF = Special Function

About RAM 128 bytes of internal RAM (00H to 7FH)is general R/W storage. Part of this RAM is used as general purpose registers. 21 Special-Function Registers (SFR) which are not part of 128 bytes of RAM at 80H to F8H locations of the RAM space. 64 KB External RAM can be used fully in addition to 128 internal RAM. Although 8051 normally operates with separate program and data memory space, there are applications where it can be used as one 64 KB of memory. When this is done, 8051 can input a block of data through its serial communcation port load it into memory, and then execute that data as a program.

About Program memory if more program memory is needed, internal 4 KB memory can be expanded by an additional 60 KB, giving a full 64 KB of program memory space. if EA (active low) is asserted, the 8051 does not use the internal 4K ROM. The external memory must start from location 0000H.

128 bytes internal RAM (80) scratch pad (16) bit/byte addressable (8) 8-bit registers bank 3 (8) 8-bit registers bank 2 (8) 8-bit registers bank 1 (8) 8-bit registers bank 0 4 register banks F 17 1F 2F 7F F7F0 F0H E7E0 D7D0 BFB8 B7B0 AFA8 A7A0 9F E0H D0H B8H B0H A8H A0H 99H 98H 90H 8DH 8CH 8BH 8AH 89H 8F88 88H 87H 83H 82H 81H H B ACC PSW IP P3 IE P2 SBUF SCON P1 TH1 TH0 TL1 TL0 TMOD TCON PCON DPH DPL SP P0 CYACF0 RS1RS0 OVP PSW CY – carry flag AC – auxiliary carry F0 – general purpose indicator RS1 – register bank selector bit 1 RS0 – register bank selector bit 0

SFRs are accessed as if they were normal Internal RAM. The only difference is that Internal RAM is from address 00h through 7Fh whereas SFR registers exist in the address range of 80h through F8h. B register is used during multiply and divide operations as to hold higher 8-bit source. Otherwise it can used as a simple scratch-pad register. ACC and PSW are like microprocessor’s accumulator and flag. PSW does not have a zero flag. RS1 and RS0 indicates the current register bank. DPH and DPL is used as 2-byte data pointer DTPR when addressing external memory. Can be used as 8-bit or 16 bit memory pointers. SP incremented just before data is stored by using push or call instruction or the interrupt SP initialized to 07H on reset. This means first data put on the stack is loaded into memory location 08H. The 8051 has four I/O ports of 8 bits, for a total of 32 I/O lines. P0,P1,P2 and P3. PCON is power control register. Can put mp into hibernation and conserve power.

IO ports

All four 8 bit ports are bidirectional. Port latch allows u to store data going out of the port of coming into the port. The latch can be set by data on the data bus or at the port pin. Also the latch can place data on the mc bus or send it to the port pin. Port 0 and 2 can be used to address the external memory. Port 0 can also be used to exchange data from the external port. Port 3 has alternative function. It’s pin 6 and 7 are used as WR/RD control for external data memory. External program memory is read using PSEN control signal.

8051 addressing modes 111 instructions – 49 single bytes, 45 two bytes, and 17 three-bytes. 4 different types of instructions. – data transfer instructions. General purpose: MOV, PUSH, POP Accumulator specific: MOVX, MOVC, XCH Address-object transfer: to load 16 bit address data into data pointer, e.g. MOV #data 16 – Mathematical operations. Add, subtract, multi, divi, rotate, swap, and, or etc. – Control operations. Call, jump, ret etc. – Bit operations. CLR, SETB, CPL, ANL

8 addressing mode – Bank addressing, MOV A, Rn Rn is R0 to R7 of the currently selected bank. – Direct addressing, MOV A, direct “direct” is an internal data memory location pointed by 8 bit – Register indirect addressing, MOV Ri is either R0 or R1 of the currently selected bank – Immediate addressing 8 bit addressing, MOV A, #data – 16-bit absolute addressing, LCALL addr 16 Addr 16 is a 16 bit absolute address in 64K locations – 11 bit relative addressing, ACALL addr 11 Addr 11 is a 11 bit address relative to current PC value – 8 bit offset addressing, JZ rel rel is an 8 bit offset added to current PC value. – Bit addressing, SETB bit Addressing modes

examples MOV direct, direct MOV DPTR, #data16 MOVC ; get content from SRAM pointed to by address A+DPTR MOVC ; get content from control store pointed to by address A+PC MOVX ; get content from external RAM pointed to by Ri MOVX ; get content from external RAM pointed to by DPTR