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

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

Computer Hardware Requirements for ERTSs: Microprocessors & Microcontrollers

DERTS Design Requirements (1): Microcontroller Architecture & Programming

Microcontroller systems Lec 2 PIC18LF8722 Microcontroller s s core

ME 515 Mechatronics. A microprocessor

Input/Output Ports and Interfacing

AVR Microcontrollers Architecture

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

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

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

Assembly Language Instructions

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

The University of Texas at Arlington Lecture 3

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

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

ELC4438: Embedded System Design Embedded Processor

TKT-3500 Microcontroller systems

1 Introduction to Microcontrollers

Design and Implementation of a FPGA-based Pipelined Microcontroller

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

EEE111A/B Microprocessors

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

Microcontroller: CPU and Memory

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

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

Professor E. Ambikairajah UNSW Sydney

Model Answer Microcontrollers. MCQ Problems Total Q1 Q2

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

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

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

PIC 16F84A programming (II)

The University of Texas at Arlington Lecture 5

PIC10F200/202/204/206 Data Sheet

Chapter 2 Sections 1 8 Dr. Iyad Jafar

ECE 471 Embedded Systems Lecture 2

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

8051 Microcontroller

Distributed Real- Time Control Systems

PIC16F8X 18-pin Flash/EEPROM 8-Bit Microcontrollers

PIC10F200/202/204/206

VLSI Design Lab., Konkuk Univ. Yong Beom Cho LSI Design Lab

Network Embedded Systems Sensor Networks Fall Hardware. Marcus Chang,

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

Lecture 1. Course Overview and The 8051 Architecture

Micro II and Embedded Systems

Introduction to Microcontroller Apps for Amateur Radio Projects Using the HamStack Platform.

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

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

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

Typical applications where a CPLD may be the best design approach:

Lecture (04) PIC16F84A (3)

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

APPLICATION NOTE Wire Communication with a Microchip PICmicro Microcontroller

MICROCONTROLLERS 8051

Embedded System Design

MicroProcessor. MicroProcessor. MicroProcessor. MicroProcessor

STM32 MICROCONTROLLER

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

PIC-P28-USB development board Users Manual

Mod-5: PIC 18 Introduction 1. Module 5

AVR Training Board-I. VLSI Design Lab., Konkuk Univ. LSI Design Lab

Lecture (02) PIC16F84 (I)

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

Section 4. Architecture

EE6008-Microcontroller Based System Design Department Of EEE/ DCE

MT2 Introduction Embedded Systems. MT2.1 Mechatronic systems

Fig 1. Block diagram of a microcomputer

Introduction to Microcontrollers

Embedded Systems. PIC16F84A Sample Programs. Eng. Anis Nazer First Semester

ME 6405 Introduction to Mechatronics

EE 354 Fall 2015 Lecture 1 Architecture and Introduction

Microprocessors/Microcontrollers

OUTLINE. STM32F0 Architecture Overview STM32F0 Core Motivation for RISC and Pipelining Cortex-M0 Programming Model Toolchain and Project Structure

Pic24f Family Reference Manual Section 14. Timers

Ali Karimpour Associate Professor Ferdowsi University of Mashhad

ATmega128. Introduction

EE 367 Introduction to Microprocessors Homework 6

Microcontroller Basics

MICROCONTROLLER S PROGRAMMER

Laboratory: Introduction to Mechatronics

Microcomputer Architecture and Programming

Section 30. In-Circuit Serial Programming (ICSP )

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

SOLUTIONS!! DO NOT DISTRIBUTE!!

EE4144: ARM Cortex-M Processor

EECE.3170: Microprocessor Systems Design I Summer 2017 Homework 5 Solution

ATA I/O Adapter 8255a

PIC16C Pin, 8-Bit CMOS Microcontroller. Device included in this Data Sheet: Special Microcontroller Features: High-Performance RISC CPU:

Physics 335 Intro to MicroControllers and the PIC Microcontroller

CHAPTER 6 CONCLUSION AND SCOPE FOR FUTURE WORK

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

Basic Components of Digital Computer

V8-uRISC 8-bit RISC Microprocessor AllianceCORE Facts Core Specifics VAutomation, Inc. Supported Devices/Resources Remaining I/O CLBs

MICROPROCESSOR B.Tech. th ECE

16.317: Microprocessor-Based Systems I Summer 2012

3. The MC6802 MICROPROCESSOR

PIC16F87X 13.0 INSTRUCTION SET SUMMARY INSTRUCTIONS DESCRIPTIONS

Chapter 5 Sections 1 6 Dr. Iyad Jafar

ECE 471 Embedded Systems Lecture 2

PIC Discussion. By Eng. Tamar Jomaa

Transcription:

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

Popular Microcontrollers 8051 Intel then Everyone (8-bit old) PIC Microchip (8, 16 & 32bit) AVR Atmel (8 & 32bit) MSP430 TI (low power 16-bit) ARM Cortex ARM Limited (32 bit) 68HCSxx Motorola/freescale-NXP (old) PSoC Cypress (M8C, 8051,ARM) Nios II / MicroBlaze Altera / Xilinx (sc) Blue = commonly used in Senior Design

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