Interrupts Microprocessor and Interfacing 261313.

Slides:



Advertisements
Similar presentations
MICROPROCESSORS AND MICROCONTROLLERS
Advertisements

Accessing I/O Devices Processor Memory BUS I/O Device 1 I/O Device 2.
1 ECE 372 – Microcontroller Design Parallel IO Ports - Outputs Parallel IO Ports E.g. Port T, Port AD Used to interface with many devices Switches LEDs.
I/O Unit.
Loops, and sub-routines Interrupts Can be very useful in control applications particularly when the microprocessor must perform two tasks apparently.
 CPU: Central Processing Unit  I/O: Input /Output  Bus: Address bus & Data bus  Memory: RAM & ROM  Timer  Interrupt  Serial Port  Parallel Port.
FIU Chapter 7: Input/Output Jerome Crooks Panyawat Chiamprasert
Oscilloscope Watch Teardown. Agenda History and General overview Hardware design: – Block diagram and general overview – Choice of the microcontroller.
6-1 I/O Methods I/O – Transfer of data between memory of the system and the I/O device Most devices operate asynchronously from the CPU Most methods involve.
ECE200 – Computer Organization Chapter 8 – Interfacing Processors and Peripherals.
Programming I/O for Embedded System. Page 2 Overview Basis: A DE2 Computer Architecture Parallel I/O 7-Segment Display Basic Manipulating 7-Segment Display.
Timers and Interrupts Shivendu Bhushan Summer Camp ‘13.
Railway Foundation Electronic, Electrical and Processor Engineering.
1 COSC 3P92 Cosc 3P92 Week 11 Lecture slides Violence is the last refuge of the incompetent. Isaac Asimov, Salvor Hardin in "Foundation"
Microcontroller: Introduction
Khaled A. Al-Utaibi  Microprocessors  Microcontrollers  Embedded Systems.
Timers and Interrupts Shivendu Bhushan Sonu Agarwal.
INPUT/OUTPUT ARCHITECTURE By Truc Truong. Input Devices Keyboard Keyboard Mouse Mouse Scanner Scanner CD-Rom CD-Rom Game Controller Game Controller.
Input/Output. Input/Output Problems Wide variety of peripherals —Delivering different amounts of data —At different speeds —In different formats All slower.
MICROCONTROLLERS. What is a microcontroller? A microcontroller is a nifty little gadget that houses a microprocessor, ROM (Read Only Memory), RAM (Random.
CHAPTER 5 I/O PRINCIPLE Understand the principles of System Bus
Input/Output mechanisms
MICROPROCESSOR INPUT/OUTPUT
Introduction to PIC-C. Required Software PIC-C Compiler Firmware Downloader Driver for the USB->Serial Adapter.
CHAPTER 3 TOP LEVEL VIEW OF COMPUTER FUNCTION AND INTERCONNECTION
2007 Oct 18SYSC2001* - Dept. Systems and Computer Engineering, Carleton University Fall SYSC2001-Ch7.ppt 1 Chapter 7 Input/Output 7.1 External Devices.
Microprocessors 2 lesson Subjects lesson 7 Planning Interrupts Serial communication /USART Questions.
(More) Interfacing concepts. Introduction Overview of I/O operations Programmed I/O – Standard I/O – Memory Mapped I/O Device synchronization Readings:
ECE Lecture 1 Microcontroller Concepts. Basic Computer System CPU Memory Program + Data I/O Interface Parallel I/O Device Serial I/O Device Data.
2009 Sep 10SYSC Dept. Systems and Computer Engineering, Carleton University F09. SYSC2001-Ch7.ppt 1 Chapter 7 Input/Output 7.1 External Devices 7.2.
I/O Interfacing A lot of handshaking is required between the CPU and most I/O devices. All I/O devices operate asynchronously with respect to the CPU.
Interrupts Useful in dealing with: The interface: Random processes;
Accessing I/O Devices Processor Memory BUS I/O Device 1 I/O Device 2.
1 ECE 372 – Microcontroller Design Parallel IO Ports - Inputs.
Timers and Interrupts Anurag Dwivedi. Let Us Revise.
1 © Unitec New Zealand Interrupt Lecture 6 Date: - 20 Sept, 2011 Embedded Hardware ETEC 6416.
Teachers Name : Suman Sarker Telecommunication Technology Subject Name : Microcontroller & Embedded System Subject Code : 6871 Semester : 7th Department.
Saxion University of Applied Sciences Advanced Microcontrollers A practical approach.
Interrupts Microprocessor and Interfacing
Microprocessor and Interfacing Example: Writing a Game Need to Check Keyboard Input.
This course is designed by Dr. Khaled A. Al-Utaibi.
S4525A Peripherals & Enhanced FLASH 1 © 1999 Microchip Technology Incorporated. All Rights Reserved. S4525A Peripherals & Enhanced FLASH 1 Peripherals.
TIMERS AND INTERRUPTS AVI SINGH KEVIN JOSE PIYUSH AWASTHI.
IT3002 Computer Architecture
KEYBOARD INTERFACING Keyboards are organized in a matrix of rows and columns The CPU accesses both rows and columns through ports. ƒTherefore, with two.
System Hardware FPU – Floating Point Unit –Handles floating point and extended integer calculations 8284/82C284 Clock Generator (clock) –Synchronizes the.
Features of the PIC18 microcontroller - 8-bit CPU - 2 MB program memory space (internal 32KB to 128KB) bytes to 1KB of data EEPROM - Up to 4096 bytes.
RFID Access Control System Lucius Knight. General System Design  Microcontroller  PSoC CY8C29466  24MHz Bus Frequency  Memory Available  32kB FLASH.
Input Output Techniques Programmed Interrupt driven Direct Memory Access (DMA)
I/O Organization Competency – C6. Important facts to remember when I/O devices are to be connected to CPU There is a vast variety of I/O devices. Some.
بسم الله الرحمن الرحيم MEMORY AND I/O.
Interrupt-Driven I/O There are different types of interrupts –Hardware Generated by the 8259 PIC – signals the CPU to suspend execution of the current.
Department of Electronic & Electrical Engineering Introduction to microcontrollers A microcontroller is a small computer on a single integrated circuit.
Interrupts ELEC 330 Digital Systems Engineering Dr. Ron Hayne Images Courtesy of Ramesh Gaonkar and Delmar Learning.
Interrupts and Exception Handling. Execution We are quite aware of the Fetch, Execute process of the control unit of the CPU –Fetch and instruction as.
MICROCONTROLLER INTERFACING WITH STEPPER MOTOR MADE BY: Pruthvirajsinh Jadeja ( ) COLLEGE:DIET BRANCH:EC.
CEng3361/18 CENG 336 INT. TO EMBEDDED SYSTEMS DEVELOPMENT Spring 2007 Recitation 01.
DEPARTMENT OF ELECTRONICS ENGINEERING V-SEMESTER MICROPROCESSOR & MICROCONTROLLER 1 CHAPTER NO microcontroller & programming.
Digital Sound Projection ECE 477 Group 6 Software Narrative Steve Anderson Mike Goldfarb Shao-Fu Shih Josh Smith.
1. PIC ADC  PIC18F877 has 8 analog input channels i.e. port A pins(RA0 to RA5) and port E pins(RE1 and RE2). These pins are used as Analog input pins.
Case Study #1 Microcontroller System. What is a microcontroller? A microcontroller can be considered a self-contained system with a processor, memory.
I/O Memory Interface Topics:
Hardware Source: ttp:// under
BVM Engineering College Electrical Engineering Department : Microprocessor and Microcontroller Interfacing Interrupts of 8051 Prepared by:
PRA-SYARAT SISTEM MIKROPROSESOR
CS703 - Advanced Operating Systems
BIC 10503: COMPUTER ARCHITECTURE
Presentation transcript:

Interrupts Microprocessor and Interfacing

Example: Writing a Game Need to Check Keyboard Input

Method 1: Using a Loop Do If GetKeyState(vbKeyRight) Then moveRight ElseIf GetKeyState(vbKeyLeft) Then moveLeft End If Loop

Mothod II: Use KeyPress Event KeyPressEvent(KeyAscii As Integer) If KeyAscii = LeftKey Then MoveLeft ElseIf KeyAscii = RightKey Then MoveRight End If End Sub

WHAT’S THE DIFFERENCE BETWEEN METHOD I - METHOD II ?

Method I : Software Polling Method II : Event or Interrupt Driven

I/O Handling Techniques Software Polling Interrupts Direct Memory Access (DMA)

Benefits of Using Interrupts Consumes much less CPU  Especially when interrupt generated by hardware Cleaner & Simpler Code Allows Basic Parallel Processing

Exercise: Program a PIC Microcontroller Blink an LED every 0.5 sec Also receives serial data from the computer Available Commands  Getchar() – wait and return serial data  Output_high(LED), Output_low(LED)  Time() – returns current time (in ms)  Kbhit() – returns true if serial data is available

Solution Int currentTime; Char data; startTime = time(); While (1) { if (time() – startTime > 500) { blink_LED(); startTime = time(); } if (kbhit()) { data = getchar(); }

Same Program with Timer Interrupt timerISR() { blinkLED(); } Main() { setTimer(); data = getchar(); }

Interrupt Handling

Multi-Interrupt Handling

Interrupt on the PIC

Available Interrupts Include INT Pin Interrupt (external interrupt) TMR0 Overflow Interrupt PORTB Change Interrupt (pins RB7:RB4) Comparator Change Interrupt Parallel Slave Port Interrupt USART Interrupts Receive Interrupt Transmit Interrupt A/D Conversion Complete Interrupt LCD Interrupt. Data EEPROM Write Complete Interrupt Timer1 Overflow Interrupt Timer2 Overflow Interrupt CCP Interrupt SSP Interrupt

DMA (Direct Memory Access) CPU I/O (e.g. Disk) RAM DMA Can send data directly to and from memory