ECNG3006 MICROPROCESSOR APPLICATIONS Course Instructor: Mr. Kevon Andrews Office: Rm. 239 Phone: 1-868-662-2002 ext.3156 address:

Slides:



Advertisements
Similar presentations
Interrupts Chapter 8 – pp Chapter 10 – pp Appendix A – pp 537 &
Advertisements

8051 Core Specification.
I/O Unit.
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.
Introduction To The ARM Microprocessor
OS Spring’03 Introduction Operating Systems Spring 2003.
1 Process Description and Control Chapter 3 = Why process? = What is a process? = How to represent processes? = How to control processes?
16.317: Microprocessor System Design I Instructor: Dr. Michael Geiger Spring 2012 Lecture 29: Microcontroller intro.
Operating Systems (CSCI2413) Lecture 3 Processes phones off (please)
TCSS 372A Computer Architecture. Getting Started Get acquainted (take pictures) Purpose, scope, and expectations of the course Expectations & strategy.
Part II: Addressing Modes
INTERRUPTS PROGRAMMING
Chapter 2 The OS, the Computer, and User Programs Copyright © 2008.
9/20/6Lecture 21 -PIC Architecture1 PIC Architecture Programmers Model and Instruction Set.
Introduction to Embedded Systems
MICROPROCESSOR INPUT/OUTPUT
Implementing Processes and Process Management Brian Bershad.
Directives, Memory, and Stack. Directives Special commands to the assembler May or may not generate machine code Categories by their function Programming.
Lecture 2 Process Concepts, Performance Measures and Evaluation Techniques.
PIC16F877 ISR Points to note Interrupt Triggers –Individual interrupt flag bits are set, regardless of the status of their corresponding mask bit, PEIE.
Chapter 2: Computer-System Structures 2.1 Computer System Operation 2.5 Hardware Protection 2.6 Network Structure.
The Functions of Operating Systems Interrupts. Learning Objectives Explain how interrupts are used to obtain processor time. Explain how processing of.
Interrupt.
Microprocessors 1 MCS-51 Interrupts.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction Purpose  This training course provides an overview of the CPU architecture.
Execution of an instruction
13-Nov-15 (1) CSC Computer Organization Lecture 7: Input/Output Organization.
Chapter 2 Processes and Threads Introduction 2.2 Processes A Process is the execution of a Program More specifically… – A process is a program.
1 © Unitec New Zealand Interrupt Lecture 6 Date: - 20 Sept, 2011 Embedded Hardware ETEC 6416.
We will focus on operating system concepts What does it do? How is it implemented? Apply to Windows, Linux, Unix, Solaris, Mac OS X. Will discuss differences.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
Operating Systems 1 K. Salah Module 1.2: Fundamental Concepts Interrupts System Calls.
1 Computer Systems II Introduction to Processes. 2 First Two Major Computer System Evolution Steps Led to the idea of multiprogramming (multiple concurrent.
6-1 Infineon 167 Interrupts The C167CS provides 56 separate interrupt sources that may be assigned to 16 priority levels. The C167CS uses a vectored interrupt.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
Embedded Systems Design 1 Lecture Set 8 MCS-51 Interrupts.
Interrupt driven I/O Computer Organization and Assembly Language: Module 12.
بسم الله الرحمن الرحيم MEMORY AND I/O.
Lecture 3 CSE 341 – Microprocessors Lecture 3 Md. Omar Faruqe UB 1228
Slides created by: Professor Ian G. Harris Operating Systems  Allow the processor to perform several tasks at virtually the same time Ex. Web Controlled.
CS-280 Dr. Mark L. Hornick 1 Sequential Execution Normally, CPU sequentially executes instructions in a program Subroutine calls are synchronous to the.
Interrupts ELEC 330 Digital Systems Engineering Dr. Ron Hayne
Interrupts ELEC 330 Digital Systems Engineering Dr. Ron Hayne Images Courtesy of Ramesh Gaonkar and Delmar Learning.
The 8051 Microcontroller Chapter 6 INTERRUPTS. 2/29 Interrupt is the occurrence of a condition an event that causes a temporary suspension of a program.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
Lecture – 8 Interrupt 1. Outline Introduction Handling interrupt Interrupt sources Switching interrupt Peripheral interrupts Using two interrupts Conclusions.
DEPARTMENT OF ELECTRONICS ENGINEERING V-SEMESTER MICROPROCESSOR & MICROCONTROLLER 1 CHAPTER NO microcontroller & programming.
Dr. Iyad Jafar Introducing the PIC 16 Series and the 16F84A.
Advanced Operating Systems CS6025 Spring 2016 Processes and Threads (Chapter 2)
Embedded Real-Time Systems
Chapter 10 Interrupts. Basic Concepts in Interrupts  An interrupt is a communication process set up in a microprocessor or microcontroller in which:
Processes and threads.
ECE 3430 – Intro to Microcomputer Systems
Operating Systems CMPSC 473
Process Management Process Concept Why only the global variables?
Microprocessor Systems Design I
Timer and Interrupts.
Microprocessor Systems Design I
UNIT – Microcontroller.
Computer Architecture
Computer System Overview
More examples How many processes does this piece of code create?
Processor Fundamentals
BIC 10503: COMPUTER ARCHITECTURE
Lecture Topics: 11/1 General Operating System Concepts Processes
Chapter 4 Instruction Set.
Processes Hank Levy 1.
Processes and Process Management
EECE.3170 Microprocessor Systems Design I
Processes Hank Levy 1.
Presentation transcript:

ECNG3006 MICROPROCESSOR APPLICATIONS Course Instructor: Mr. Kevon Andrews Office: Rm. 239 Phone: ext address: Office Hours: Mon: 2-3pm, Tue: 2-3pm, Fri:10- 12pm

COURSE OUTLINE Differences between PIC18F452 and PIC16F877 Processes RTOS design FreeRTOS Overview FreeRTOS ISR Example RTOS application & design issues Real-time system Scheduling Theory Scheduling Approaches and Performance Issues

Unit Objectives Recall differences between PIC18F452 and PIC16F877. Apply knowledge of states of processes in applications examples. Design real-time system application using the FreeRTOS implementation. Outline the design of an RTOS. Analyse design issues of real-time systems using FreeRTOS..

Unit Objectives (cont’d) Reconstruct real-time systems using knowledge of design issues. Define and classify different classifications of real- time systems according to their timing attributes. Give examples of real-time systems as related to classification of real-time systems. Explain concepts within scheduling theory. Describe scheduling algorithms. Analyse some issues and performance of schedules.

ASSESSMENT End of semester examination [50%] 50% Coursework [50%] – Laboratory exercises [30% ] Laboratory exercise 1 – Introduction to MPLAB and C18 compiler [10%] Laboratory exercise 2 – C18 compiler and LCD [10%] Laboratory exercise 3 – FreeRTOS and LCD [10%] – Mini-project [20% ]

Differences between PIC18F452 and PIC16F877 Show general differences. Architectural differences. Changes in registers used for direct addressing and indirect addressing. Interrupt priority levels.

General Differences 16F prg instructions 368 bytes RAM 3 timers 5 A/D channels 14 interrupt sources 35 instructions private stack 1-level interrupt priority 18F prg instructions 1536 bytes RAM 4 timers 8 A/D channels 18 interrupt sources 75 instructions user addressable stack 2-level interrupt priority

Program Memory Map and Stack 16F87718F542

Architectural Differences The PC contains 21 bits, which means that it is capable of addressing 2MB memory. Only 32K of memory is actually on-chip, so a read outside of the physical memory will return 0's (NOP). There is now a separate Bank Select Register (BSR) instead of two bits in the Status register, but only the lower 4 bits are used.

Direct Addressing The BSR is used to switch the banks and can be loaded directly via the MOVLB instruction. We need 12 bits to address all the possible data memory locations, i.e. there are 4096 possible memory locations.

Direct Addressing

Indirect Addressing The indirect addressing mode using the FSR and INDF registers of the 16Fxxx has been retained except that there are now three sets, –INDF0, INDF1, INDF2 –FSR0 (FSR0H, FSR0L) –FSR1 (FSR1H, FSR1L) –FSR2 (FSR2H, FSR2L) Why are there H and L versions of the FSR?

Indirect Addressing

There is a special instruction LFSR to load the FSR registers. As usual access to the INDFn registers actually references the memory location referred to by the FSRn register. In addition to the INDFn registers, there are an additional four registers associated with each of INDF0..INDF2.

Indirect Addressing All the indirect registers are –INDFn – no change after indirect access –POSTDECn – auto-decrement after indirect access –POSTINCn – auto-increment after indirect access –PREINCn – auto-increment before indirect access –PLUSWn – use value in W as offset to FSR, don't change either W or FSR

Interrupt Priority Each interrupt source, except INT0, has three bits to control its operation. The functions of these bits are: –Flag bit to indicate that an interrupt event has occurred –Enable bit that allows program execution to branch to the interrupt vector address when the flag bit is set –Priority bit to select high priority or low priority

Interrupt Priority The interrupt priority feature is enabled by setting the IPEN bit (RCON ). When interrupt priority is enabled, there are two bits which enable interrupts globally. –Setting the GIEH bit (INTCON ) enables all interrupts that have the priority bit set. –Setting the GIEL bit (INTCON ) enables all interrupts that have the priority bit cleared.

Interrupt Priority When the interrupt flag, enable bit and appropriate global interrupt enable bit are set, the interrupt will vector immediately to address h or h, depending on the priority level. Individual interrupts can be disabled through their corresponding enable bits.

C differences Pentium char – 8 bits int – 32 bits short – 16 bits long – 32 bits float – 32 bits double – 64 bits 18 series char – 8 bits int – 16 bits short – 16 bits long – 32 bits float - 32 bits double – 64 bits

Summary Differences between PIC18F452 and 18F877. Differences in PC(21 bits vs. 13bits) and selection of banks(BSR vs 2 bits in Status Register). Registers used in direct(BSR & 8-bit opcode) and indirect addressing(FSRn & INDFn / POSTDECn / POSTINCn / PREINCn / PLUSWn. Introduction of different priority levels.

Processes Define a process Describe the states of a process Define a context and context switch

Process Suppose instead of doing only one thing we have the computer do several jobs at the same time. These jobs are kept in memory and the CPU time is shared between them. Each job is called a process. Each process behaves as if the CPU belonged to it alone.

Processes

States of Process

Processes When a process moves from the running to either the waiting or ready state, it does not have access to the CPU as it has given it to another process. If it is to gain access to the CPU again, we must store all what it was doing so that we can restore it as if it never stopped! That information that we must store is called the context of the process.

Context A context is literally everything about the process, some things are –Program Counter –State of the stack –CPU registers –I/O state –Process state –... etc

Context Switch When the CPU switches to another process, the old context must be saved and the new context loaded for the new process. This save/load is called a context switch.

SUMMARY Process is a job, which the CPU seems to execute at the same time. 5 states which can describe the status of a process: new; ready; waiting; running and terminated. Context includes everything about a process. Context switch is the saving of the old context and loading of the new context.