Lecture (02) PIC16F84 (I)

Similar documents
Chapter 2 Sections 1 8 Dr. Iyad Jafar

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

Computer Hardware Requirements for ERTSs: Microprocessors & Microcontrollers

Embedded System Design

Introducing Microcontrollers System Design

DERTS Design Requirements (1): Microcontroller Architecture & Programming

Computer Hardware Requirements for Real-Time Applications

Lecture (03) PIC16F84 (2)

Lecture (04) PIC 16F84A programming I

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

8051 Microcontroller

PIC Microcontroller Introduction

PIC 16F84A programming (II)

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

EXAMINATION PAPER EMBEDDED SYSTEMS 6EJ005

MicroProcessor. MicroProcessor. MicroProcessor. MicroProcessor

Laboratory: Introduction to Mechatronics

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

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

PIC16F8X 18-pin Flash/EEPROM 8-Bit Microcontrollers

ME 6405 Introduction to Mechatronics

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

Figure 1.1: Some embedded device. In this course we shall learn microcontroller and FPGA based embedded system.

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

Embedded Systems Design (630470) Lecture 4. Memory Organization. Prof. Kasim M. Al-Aubidy Computer Eng. Dept.

M PIC16F84A. 18-pinEnhanced FLASH/EEPROM 8-Bit Microcontroller. High Performance RISC CPU Features: Pin Diagrams. Peripheral Features:

PIC16F84A. 18-pin Enhanced Flash/EEPROM 8-Bit Microcontroller. Devices Included in this Data Sheet: Pin Diagrams. High Performance RISC CPU Features:

Understanding the basic building blocks of a microcontroller device in general. Knows the terminologies like embedded and external memory devices,

Microcontroller systems Lec 2 PIC18LF8722 Microcontroller s s core

n/a PIC12F629-I/P (RC) n/a PIC12F629-I/SN (RC) n/a PIC12F675-I/P (RC) n/a PIC12F675-I/SN MICROCONTROLLER (RC)

Basic Components of Digital Computer

Lecture (01) Introducing Embedded Systems and the Microcontrollers By: Dr. Ahmed ElShafee

EMBEDDED SYSTEMS COURSE CURRICULUM

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

OPERATIONAL UP TO. 300 c. Microcontrollers Memories Logic

MT2 Introduction Embedded Systems. MT2.1 Mechatronic systems

AVR Microcontrollers Architecture

Specifications PMD-1208FS

Lecture 1. Course Overview and The 8051 Architecture

Specifications

ATmega128. Introduction

Specifications USB-1408FS

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

Microcontroller Overview

Department of Electronics and Instrumentation Engineering Question Bank

This Part-B course discusses design techniques that are used to reduce noise problems in large-scale integration (LSI) devices.

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

SANKALCHAND PATEL COLLEGE OF ENGINEERING, VISNAGAR. ELECTRONICS & COMMUNICATION DEPARTMENT Question Bank- 1

OSC Ring Type Ring or Resonator type (optional) RESET Pin No Yes

Infineon C167CR microcontroller, 256 kb external. RAM and 256 kb external (Flash) EEPROM. - Small single-board computer (SBC) with an

WT6510. USB Keyboard Controller (Mask ROM Type)

TEVATRON TECHNOLOGIES PVT. LTD Embedded! Robotics! IoT! VLSI Design! Projects! Technical Consultancy! Education! STEM! Software!

MC68HC05J1A/D Rev. 1.0 HC 5 MC68HC05J1A MC68HCL05J1A MC68HSC05J1A. HCMOS Microcontroller Units TECHNICAL DATA

ILI2303. ILI2303 Capacitive Touch Sensor Controller. Specification

ENE 334 Microprocessors

CHAPTER 1 MICROCOMPUTER SYSTEMS. 1.1 Introduction. 1.2 Microcontroller Evolution

Network Embedded Systems Sensor Networks Fall Hardware. Marcus Chang,

DEV-1 HamStack Development Board

Robotics Training Module ABLab Solutions

SNC36060 Four Channels Speech Controller

Embedded programming, AVR intro

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

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

Embedded Systems and Software

C and Embedded Systems. So Why Learn Assembly Language? C Compilation. PICC Lite C Compiler. PICC Lite C Optimization Results (Lab #13)

Embedded Systems Lab Lab 8 EEPROM

Ali Karimpour Associate Professor Ferdowsi University of Mashhad

Clock and Fuses. Prof. Prabhat Ranjan Dhirubhai Ambani Institute of Information and Communication Technology, Gandhinagar

Display Real Time Clock (RTC) On LCD. Version 1.2. Aug Cytron Technologies Sdn. Bhd.

Ali Karimpour Associate Professor Ferdowsi University of Mashhad

EasyPIC5 Development System

MICROCONTROLLER UNIT 1

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

Laboratory: Introduction to Mechatronics. Instructor TA: Edgar Martinez Soberanes Lab 1.

Arduino Uno R3 INTRODUCTION

Architecture of Computers and Parallel Systems Part 6: Microcomputers

AVR XMEGA Product Line Introduction AVR XMEGA TM. Product Introduction.

3. Applications. 1. General Description. 4. Pin Assignment. 2. Features M D T10P509ST2611 PB0 1 6 PB3 M D T10P509ST2613 PB0 1 6 /MCLR

ME 515 Mechatronics. A microprocessor

EC4205 Microprocessor and Microcontroller

SNC Four Channels Speech Controller

Z8 Encore! XP F1680 Series 8-Bit Flash Solution with Extended Peripherals

8051 Microcontroller

Model Answer Microcontrollers. MCQ Problems Total Q1 Q2

Hello, and welcome to this presentation of the STM32 Reset and Clock Controller.

AVR MICROCONTROLLER ARCHITECTURTE

Renesas 78K/78K0R/RL78 Family In-Circuit Emulation

Lecture 14. Ali Karimpour Associate Professor Ferdowsi University of Mashhad

Locktronics PICmicro getting started guide

Laboratory: Introduction to Mechatronics. Instructor TA: Edgar Martinez Soberanes Lab 2. PIC and Programming

LED Matrix Scrolling using ATmega32 microcontroller

e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: 8051 Architecture Module No: CS/ES/5 Quadrant 1 e-text

SBC65EC. Ethernet enabled Single Board Computer

Introduction to ARM LPC2148 Microcontroller

Introduction to Microcontrollers

nc. Factors which affect reset are: 1. External components attached to the RESET pin 2. Low-voltage reset (LVR) on chip 3. Power-on reset (POR) detect

UNIVERSITY OF BOLTON SCHOOL OF ENGINEERING MSC SYSTEMS ENGINEERING AND ENGINEERING MANAGEMENT SEMESTER 2 EXAMINATION 2016/2017

Embedded World Television, Radio, CD player, Washing Machine Microwave Oven Card readers, Palm devices

PRODUCT OVERVIEW OVERVIEW DEVELOPMENT SUPPORT0 S MSUNG ELECTRONICS

Sencer Yeralan and Helen Emery Gainesville, Florida January 2000

Transcription:

Lecture (02) PIC16F84 (I) By: Dr. Ahmed ElShafee ١ Review of Memory Technologies The PIC 16 Series PIC 16F84A The PIC 16F84A Memory The Oscillator Instruction Cycle Power up and Reset Parallel ports Technical challenges Connecting to the parallel port The PIC 16F84A parallel ports Power supply Clock oscillator ٢

PIC Microcontrollers Peripheral Interface Controller (PIC) was originally designed by General Instruments In the late 1970s, GI introduced PIC 1650 and 1655 RISC with 30 instructions. PIC was sold to Microchip Features: low cost, self contained, 8 bit, Harvard structure, pipelined, RISC, single accumulator, with fixed reset and interrupt vectors. ٣ PIC Families C implies CMOS technology; Complementary Metal Oxide Semiconductor F insert indicates incorporation of Flash memory technology Example: 16C84 was the first of its kind. It was later reissued as the 16F84, incorporating Flash memory technology. It was then reissued as Dr. 16F84A. Ahmed ElShafee, ACU : Fall 2017, MicroControllers ٤ PIC Family Stack Size Instruction Word Size No of Instructions Interrupt Vectors 12CX/12FX 2 12 or 14 bit 33 None 16C5X/16F5X 2 12 bit 33 None 16CX/16FX 8 14 bit 35 1 17CX 16 16 bit 58 4 18CX/18FX 32 16 bit 75 2

12 Series PIC ٥ ٦

PIC 12F675 Architecture ٧ The PIC 16 Series Device Pins Clock Memory Features 16F84A 18 20 MHz 1 K ROM 68 B RAM 64 B EEPROM 16LF84A 16F84A 04 4 MHz 1 8 bit timer 1 5 bit port 1 8 bit port Extended supply voltage range ٨

Device Pins Clock Memory Features 16F873A 28 20 MHz 4 K ROM 192 B RAM 128 B EEPROM 16F874A 40 20 MHz 4 K ROM 192 B RAM 128 B EEPROM 3 parallel ports, 3 counter/timers, 2 capture/compare/pwm, 2 serial, 5 10 bit ADC, 2 comparators 5 parallel ports, 3 counter/timers, 2 capture/compare/pwm, 2 serial, 8 10 bit ADC, 2 comparators ٩ Device Pins Clock Memory Features 16F876A 28 20 MHz 8 K ROM 368 B RAM 256 B EEPROM 16F877A 40 20 MHz 8 K ROM 368 B RAM 256 B EEPROM 3 parallel ports, 3 counter/timers, 2 capture/compare/pwm, 2 serial, 5 10 bit ADC, 2 comparators 5 parallel ports, 3 counter/timers, 2 capture/compare/pwm, 2 serial, 8 10 bit ADC, 2 comparators ١٠

16F84A ١١ PIC 16F84A Architecture ١٢

The 16F84A Status Register C: Carry/Borrow DC: Digit Carry/Borrow Z: Zero PD : Power Down TO : Time Out RP0: Register Bank Select RP1, IRP: Not implemented ١٣ The 16F84A Memory Memory Technology Size Features Program Flash 1K x 14 bits Data (File Registers) SRAM 68 Bytes Data (EEPROM) EEPROM 64 Bytes Stack SRAM 8 x 13 bits 10,000 erase/write cycles Retains data down to 1.5 V 10,000,000 erase/write cycles ١٤

Program Memory and Stack ١٥ Configuration Word Allows the user to define certain configurable features of the microcontroller, at the time of program download. ١٦

Data memory and Special Function Registers FSR: File Select Register for indirect addressing. EEADR: EEPROM Address EEDATA: EEPROM Data EECON1: Control; RD, WREN, WR, EEIF EECON2: 55 H to AA H ١٧ The Oscillator It is necessary to provide the clock signal. The clock is a continuously running fixed frequency logic square wave. The overall speed of the microcontroller operation is entirely dependent on this clock frequency. Higher frequency > Higher Performance and higher power consumption. ١٨

Instruction Cycle The main oscillator signal is divided by 4 to produce the instruction cycle time. ١٩ Pipelining All PIC microcontrollers implement pipelining. Pipelining fails when one instruction changes the contents of the Program Counter. ٢٠

Power up and Reset At power up, the Program Counter is forced to zero and the SFRs are reset so that peripherals are initially in a safe and disabled state. There is also a master clear input MCLR. ٢١ Summary The PIC 16 Series is a diverse and effective family of microcontrollers. The 16F84A architecture is representative of all 16 Series microcontrollers, with Harvard structure, pipelining and a RISC instruction set. The PIC 16F84A has a limited set of peripherals, chosen for small and low cost applications. It is thus a smaller member of the family, with features that are a subset of any of the larger ones. The 16F84A uses three distinct memory technologies for its different memory areas. A particular type of memory location is the Special Function Register, which acts as the link between the CPU and the peripherals. Reset mechanisms ensure that the CPU starts running when the appropriate operating conditions have been met, and can be used to 22 restart the CPU in case of program failure.

Data Transfer Almost any embedded system needs to transfer digital data between its CPU and the outside world. 23 Direct user interface, including switches, keypads, lightemitting diodes (LEDs) and displays Input measurement information, from external sensors, possibly being acquired through an analog to digital converter Output control information, for example to motors or other actuators Bulk data transfer to or from other systems or subsystems, moving in serial or parallel form, for example sending serial data to an external memory. Output Parallel Ports 24

Input Parallel Ports 25 Bi directional Parallel Ports 26

Port electrical characteristics Modeling a logic gate output. (a) Generalized model. (b) Model of CMOS logic gate output 27 Schmitt trigger inputs Schmitt trigger characteristics. (a) Buffer with Schmitt trigger input. (b) Input/output characteristic 28

In electronics, a Schmitt trigger is a comparator circuit with hysteresis implemented by applying positive feedback to the noninverting input of a comparator or differential amplifier. It is an active circuit which converts an analog input signal to a digital output signal. ٢٩ The Open Drain output (a) An Open Drain output. (b) Open Drain output driving load resistor. (c) The Wired- OR connection 30

Connecting to the parallel port (1) Switches 31 (a) SPDT connection (single pole double throw). (b) SPST with pull-up resistor (single pole single throw). (c) SPST with pull-down resistor Pull-up values in the range 10 100 kω Connecting to the parallel port (2) Light emitting diodes 32

Connecting to the parallel port (2) Light emitting diodes Driving LEDs from logic gates. (a) Gate output sourcing current to LED (b) Gate output sinking current from LED 33 Connecting to the parallel port (2) Light emitting diodes 34

The PIC 16F84A parallel ports Port A 5 Bits RA3:RA0 RA4/T0CKI Port B 8 Bits RB0/INT RB3:RB1 RB7:RB4: Interrupt on change 35 36

37 38

39 Port output characteristics 1 R = 130 Ω VOH vs. IOH (VDD = 3V, 40 to 125 C) 40

Port output characteristics 2 VOL vs. IOL (VDD = 3V, 40 to 125 C) R = 36 Ω 41 The clock oscillator Faster clock gives faster execution, but more power consumption. The clock oscillator must give stable and accurate clock signal. Oscillator types: Resistor capacitor (RC) Not precise Crystal or ceramic Precise frequency, fragile, should be near the MC 42

Oscillator types (a) Resistor capacitor (RC). (b) Crystal or ceramic 43 The 16F84A clock oscillator Types: 1) XT crystal: 1 4 MHz 2) HS high speed: >= 4 MHz, with ceramic resonators. 3) LP low power: <= 200 KHz, e.g., 32.768 khz (i.e. 2 15 ), 4) RC resistor capacitor 44

(a) Crystal or ceramic, HS, XT or LP. (b) Resistor capacitor. (c) Externally supplied clock 45 Data Sheet Information 46

Power Supply 100 nf decoupling capacitor RC Oscillator 47 16F84A operating conditions 48

Summary 1 The parallel port allows ready exchange of digital data between the outside world and the controller CPU. It is important to understand the electrical characteristics of the parallel port and how they interact with external elements. While there is considerable diversity in the logic design of ports, they tend to follow similar patterns. The internal circuitry is worth understanding, as it leads to effective use of ports. The 16F84A has diverse and flexible parallel ports. 49 Summary 2 A microcontroller needs a clock signal in order to operate. The characteristics of the clock oscillator determine speed of operation and timing stability, and strongly influence power consumption. Active elements of the oscillator are usually built in to a microcontroller, but the designer must select the oscillator type, and its frequency and configuration. A microcontroller needs a power supply in order to operate. The requirements need to be understood and must be met by a supply of the appropriate type. 50

Thanks,.. See you next week (ISA), ٥١