Midrange 8b PIC Microcontrollers. ECE Senior Design 14 February 2017

Similar documents
Microcontrollers. Introduction to the PIC 8-bit Midrange Family. ECE Senior Design 15 February 2017

Computer Hardware Requirements for ERTSs: Microprocessors & Microcontrollers

DERTS Design Requirements (1): Microcontroller Architecture & Programming

Embedded Systems. PIC16F84A Internal Architecture. Eng. Anis Nazer First Semester

MICROCONTROLLERS 8051

ME 515 Mechatronics. A microprocessor

Lesson 14. Title of the Experiment: Introduction to Microcontroller (Activity number of the GCE Advanced Level practical Guide 27)

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING. EE6008 Microcontroller based system design

Microcontroller systems Lec 2 PIC18LF8722 Microcontroller s s core

Introduction to Microcontrollers

EEE111A/B Microprocessors

AVR Microcontrollers Architecture

ME 475 Lab2 Introduction of PIC and Programming. Instructor: Zhen Wang

Microprocessors and Microcontrollers. Assignment 1:

The University of Texas at Arlington Lecture 3

EE 3170 Microcontroller Applications

PIC Architecture & Assembly Language Programming. Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan

Professor E. Ambikairajah UNSW Sydney

Chapter 2 Sections 1 8 Dr. Iyad Jafar

ME 6405 Introduction to Mechatronics

Outline. Micriprocessor vs Microcontroller Introduction to PIC MCU PIC16F877 Hardware:

MicroProcessor. MicroProcessor. MicroProcessor. MicroProcessor

NH-67, TRICHY MAIN ROAD, PULIYUR, C.F , KARUR DT. DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING COURSE MATERIAL

Fig 1. Block diagram of a microcomputer

Assembly Language Instructions

ECE 354 Introduction to Lab 2. February 23 rd, 2003

Computer Hardware Requirements for Real-Time Applications

TKT-3500 Microcontroller systems

Micro II and Embedded Systems

THE UNIVERSITY OF THE WEST INDIES

16.317: Microprocessor-Based Systems I Spring 2012

Design and Implementation of a FPGA-based Pipelined Microcontroller

ELCT 912: Advanced Embedded Systems

ELC4438: Embedded System Design Embedded Processor

Embedded Systems Design (630414) Lecture 1 Introduction to Embedded Systems Prof. Kasim M. Al-Aubidy Computer Eng. Dept.

Architectures & instruction sets R_B_T_C_. von Neumann architecture. Computer architecture taxonomy. Assembly language.

The von Neumann Architecture. IT 3123 Hardware and Software Concepts. The Instruction Cycle. Registers. LMC Executes a Store.

COMPUTER STRUCTURE AND ORGANIZATION

ECE 354 Computer Systems Lab II. Interrupts, Strings, and Busses

ELCT708 MicroLab Session #1 Introduction to Embedded Systems and Microcontrollers. Eng. Salma Hesham

PIC16F87X. 28/40-pin 8-Bit CMOS FLASH Microcontrollers. Devices Included in this Data Sheet: Pin Diagram PDIP. Microcontroller Core Features:

PIC 16F84A programming (II)

Lecture (02) PIC16F84 (I)

Embedded Systems Lab Lab 1 Introduction to Microcontrollers Eng. Dalia A. Awad

Basic Computer Architecture

1 Introduction to Microcontrollers

PIC16F8X. 8-Bit CMOS Flash/EEPROM Microcontrollers PIC16F8X PIC16CR8X. Pin Diagram. Devices Included in this Data Sheet:

Introduction to general architectures of 8 and 16 bit micro-processor and micro-controllers

INTEL Architectures GOPALAKRISHNAN IYER FALL 2009 ELEC : Computer Architecture and Design

Section 4. Architecture

MICROPROCESSOR B.Tech. th ECE

CENG 336 INT. TO EMBEDDED SYSTEMS DEVELOPMENT. Spring 2006

Mechatronics and Measurement. Lecturer:Dung-An Wang Lecture 6

Lecture 1. Course Overview and The 8051 Architecture

Microprocessors/Microcontrollers

PIC10F200/202/204/206 Data Sheet

Input/Output Ports and Interfacing

/ 40 Q3: Writing PIC / 40 assembly language TOTAL SCORE / 100 EXTRA CREDIT / 10

Module 2: Introduction to AVR ATmega 32 Architecture

PIC16C84. 8-bit CMOS EEPROM Microcontroller PIC16C84. Pin Diagram. High Performance RISC CPU Features: CMOS Technology: Peripheral Features:

PIC16F8X 18-pin Flash/EEPROM 8-Bit Microcontrollers

Learning Objectives:

Pipeline Processors David Rye :: MTRX3700 Pipelining :: Slide 1 of 15

PIC10F200/202/204/206

LAB WORK 2. 1) Debugger-Select Tool-MPLAB SIM View-Program Memory Trace the program by F7 button. Lab Work

Micro computer Organization

Lecture (04) PIC16F84A (3)

Embedded System Design

Typical Processor Execution Cycle

EMBEDDED Systems. Functions. MODULE- 1 C programming with data Structure Introduction to C. Array and String. Control Flow Statements In C

Introducing Microcontrollers System Design

SOLUTIONS!! DO NOT DISTRIBUTE!!

PIC Discussion. By Eng. Tamar Jomaa

UNIT IV MICROCONTROLLER

Microcontrollers. Microcontroller

Dept. of Computer Engineering Final Exam, First Semester: 2016/2017

Model Answer Microcontrollers. MCQ Problems Total Q1 Q2

MPLAB SIM. MPLAB IDE Software Simulation Engine Microchip Technology Incorporated MPLAB SIM Software Simulation Engine

The University of Texas at Arlington Lecture 5

16.317: Microprocessor-Based Systems I Summer 2012

PIC16C52. EPROM-Based 8-Bit CMOS Microcontroller PIC16C52. Pin Diagrams. Feature Highlights. High-Performance RISC CPU. Peripheral Features

8051 microcontrollers

Laboratory: Introduction to Mechatronics

Von Neumann architecture. The first computers used a single fixed program (like a numeric calculator).

Computer and Hardware Architecture I. Benny Thörnberg Associate Professor in Electronics

CHAPTER 1. Introduction to Microcontrollers. Introduction

Chapter 5 Sections 1 6 Dr. Iyad Jafar

EE 8217 *Reconfigurable Computing Systems Engineering* Sample of Final Examination

EXPERIMENT 4: Parallel Input/Output. Objectives Introduction to the Parallel Input/Output (I/O) Familiarization to Interfacing

CHAPTER 6 CONCLUSION AND SCOPE FOR FUTURE WORK

Microcomputer Architecture and Programming

CN310 Microprocessor Systems Design

EE 367 Introduction to Microprocessors Homework 6

Mod-5: PIC 18 Introduction 1. Module 5

ARM ARCHITECTURE. Contents at a glance:

In this tutorial, we will discuss the architecture, pin diagram and other key concepts of microprocessors.

University of Jordan Faculty of Engineering and Technology Department of Computer Engineering Embedded Systems Laboratory

Ali Karimpour Associate Professor Ferdowsi University of Mashhad

Introduction to Microprocessor

What Are The Main Differences Between Program Counter Pc And Instruction Register Ir

Transcription:

Midrange 8b PIC Microcontrollers ECE Senior Design 14 February 2017

Harvard vs. Von Neumann Harvard Architecture Program Memory 14-bit Bus CPU 8-bit Bus Data Memory Harvard architecture Separate busses for program memory and data memory Improved operating bandwidth Allows for different bus widths Used in many microcontrollers Von Neumann Architecture CPU 8-bit Bus Program & Data Memory Von Neumann architecture Program and data stored in same memory Used in many microprocessors

RISC vs. CISC generalizations RISC Reduced Instruction Set Computer Emphasis on Software Most instructions execute in a single clock cycle Larger code sizes CISC Complex Instruction Set Computer Emphasis on Hardware Instructions require multiple clock cycles Smaller code size

What the does PIC stand for anyway? PIC Peripheral Interface Controller The original PIC was designed to be a Peripheral Interface Controller for 6502 microcontroller from Rockwell late 70's.

Why did we choose Microchip PIC Family of Microcontrollers? Free development software MPLAB IDE (Includes a Simulator) Low cost development hardware (Boards starting at $10) Devices are easy to obtain through distributors and can be sampled A wide range of devices are available with varying feature sets Microchip is in continuous development of new PIC devices Has a large online support community Wide acceptance in industry over 15 Billion units shipped (1B/yr)

Datasheet Feature Page 16F18324 Datasheet PIC16F18324 Processor Structure of the PIC16F18324 Device Pins for the PIC16F18324

Microcontroller Block Diagram

GPIO PIC16F18324 Port A (RA0, RA1, RA2, RA3, RA4, RA5) Port C (RC0, RC1, RC2, RC3, RC4, RC5)

Generic Port Structure

PORTA Register

TRISIA Register

LATA Register

ANSELA Register

Lighting an LED

Program Memory Map and Stack Reset Vector - 0000h Interrupt Vector - 0004h Program Memory - 4096 Stack Depth - 16

Data Memory (32 Banks total)

The W Register (working register) reg1, w ; Move a file registers contents into the W register addwf reg2, w ; Place result in W register Program Memory Program Address 13 Program Counter 14 Instruction Instruction Register Direct Addr. 7 File Registers Data Bus 8 Instruction Decode and Control ALU 8 W Register

The Status Register Program Memory Program Address 13 Program Counter 14 Instruction Instruction Register Direct Addr. 7 File Registers Data Bus 8 Instruction Decode and Control Status Register result 3 ALU 8 W Register

The Status bits Arithmetic Status of the ALU Reset Status WDT and PD

Pipelining of Instructions Most instructions Execute in a single Processor Cycle A Processor Cycle is 4 Clock Cycles Using a 4MHz oscillator each processor cycle is 1MHz This results in a 1us execution time

Non-Sequential Address Read Exception to the one processor cycle per instruction is for Branching operations The Pipeline will be broken on a non-sequential address read Branching instructions require two processor cycles to execute

Instruction Pipelining Pre-ed Instruction Executing Instruction movlw 0x05 - Instruction Cycles 1 2 3 4 Example Program MAIN movlw 0x05 movwf REG1 call SUB1 addwf REG2 T0 51 52 53 54 SUB1 SUB2 PORTB,w PORTC,w

Instruction Pipelining Pre-ed Instruction Executing Instruction movwf REG1 movlw 0x05 Instruction Cycles 1 2 3 4 Example Program MAIN movlw 0x05 movwf REG1 call SUB1 addwf REG2 T0 T1 Execute 51 52 53 54 SUB1 SUB2 PORTB,w PORTC,w

Instruction Pipelining Pre-ed Instruction Executing Instruction call SUB1 movwf REG1 Instruction Cycles 1 2 3 4 Example Program MAIN movlw 0x05 movwf REG1 call SUB1 addwf REG2 T0 T1 T2 Execute Execute Time to execute normal instruction 51 52 53 54 SUB1 SUB2 PORTB,w PORTC,w

Instruction Pipelining Pre-ed Instruction Executing Instruction addwf REG2 call SUB1 Instruction Cycles 1 2 3 4 Example Program MAIN movlw 0x05 movwf REG1 call SUB1 addwf REG2 T0 T1 T2 T3 Execute Execute Execute 51 52 53 54 SUB1 SUB2 PORTB,w PORTC,w

Instruction Pipelining Pre-ed Instruction Executing Instruction PORTB,w call SUB1 Instruction Cycles 1 2 3 4 Example Program MAIN movlw 0x05 movwf REG1 call SUB1 addwf REG2 T0 T1 T2 T3 T4 Execute Execute Execute Flush Time to execute call instruction includes pipeline flush 51 52 53 54 SUB1 SUB2 PORTB,w PORTC,w

Instruction Pipelining Pre-ed Instruction Executing Instruction PORTB,w Instruction Cycles 1 2 3 4 Example Program MAIN movlw 0x05 movwf REG1 call SUB1 addwf REG2 T0 T1 T2 T3 T4 T5 Execute Execute Execute Flush 51 52 53 54 SUB1 SUB2 PORTB,w PORTC,w Execute

Instruction Pipelining Pre-ed Instruction Executing Instruction PORTC,w Instruction Cycles 1 2 3 4 Example Program MAIN movlw 0x05 movwf REG1 call SUB1 addwf REG2 T0 T1 T2 T3 T4 T5 Execute Execute Execute Flush T6 51 52 53 54 SUB1 SUB2 PORTB,w PORTC,w Execute Execute

Instruction Pipelining Pre-ed Instruction Executing Instruction addwf REG2 Instruction Cycles 1 2 3 4 Example Program MAIN movlw 0x05 movwf REG1 call SUB1 addwf REG2 T0 T1 T2 T3 T4 T5 Execute Execute Execute Flush T6 T7 51 52 53 54 SUB1 SUB2 PORTB,w PORTC,w Execute Execute Flush

Blinking an LED time wasting loop bad Initialize Main Call Count_Time Call Toggle_LED Goto Main Count_Time ToggleLED Kill some time Looping in here Change state of LED