Chapter 6 PROGRAMMING THE TIMERS

Similar documents
Chapter 6 PROGRAMMING THE TIMERS

Chapter 2. Overview of Architecture and Microcontroller-Resources

Chapter 09. Programming in Assembly

AVR Timers TIMER0. Based on:

Chapter 09. Programming in Assembly

Lesson-3: Counters and Timers

Lab 9: On-Board Time Generation and Interrupts

Capstone Design Course. Lecture-2: The Timer

Programmed I/O (busy( wait) ) method for ports and devices, and the need for interrupt driven IOs

ECE3120: Computer Systems Chapter 8: Timer Module

DEVICE DRIVERS AND INTERRUPTS SERVICE MECHANISM

Hello and welcome to this Renesas Interactive course that covers the Watchdog timer found on RX MCUs.

TIMSK=0b ; /* enables the T/C0 overflow interrupt in the T/C interrupt mask register for */

EE4390 Microprocessors

EE 3170 Microcontroller Applications

e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: Interrupt Handling Module No: CS/ES/13 Quadrant 1 e-text

16-BIT TIMER AND EVENT COUNTER

ECE 271 Microcomputer Architecture and Applications University of Maine

HC12 Built-In Hardware

timer 1 Fri Oct 13 13:00:

Interrupt and Timer ISRs. Student's name & ID: Partner's name(s) & ID(s): Your Section number & TA's name

AVR134: Real Time Clock (RTC) Using the Asynchronous Timer. Features. Introduction. AVR 8-bit Microcontrollers APPLICATION NOTE

EE Embedded Systems Design. Lessons Exceptions - Resets and Interrupts

Chapter 05: Basic Processing Units Control Unit Design. Lesson 15: Microinstructions

INTERRUPT, TIMER/COUNTER. KONKUK UNIV. VLSI Design Lab. LSI Design Lab

The MC9S12 Timer Output Compare Function Making an event happen at specific time on the HC12 The MC9S12 Output Compare Function

In Class Assignment 2

Timer 32. Last updated 8/7/18

8-bit Microcontroller. Application Note. AVR134: Real-Time Clock (RTC) using the Asynchronous Timer. Features. Theory of Operation.

ECE 372 Microcontroller Design Parallel IO Ports - Interrupts. ECE 372 Microcontroller Design Parallel IO Ports - Interrupts

SECTION 5 RESETS AND INTERRUPTS

Interrupt vectors for the 68HC912B32. The interrupt vectors for the MC9S12DP256 are located in memory from 0xFF80 to 0xFFFF.

Microprocessors & Interfacing

INTERRUPTS in microprocessor systems

Interrupts (I) Lecturer: Sri Notes by Annie Guo. Week8 1

Interrupts. How can we synchronize with a peripheral? Polling

Introduction to Mechatronics. Fall Instructor: Professor Charles Ume. Interrupts and Resets

Interrupts Peter Rounce - room 6.18

Interrupt/Timer/DMA 1

Introduction to Embedded Systems

Using Input Capture on the 9S12

Fundamental concept in computation Interrupt execution of a program to handle an event

Embedded Systems and Software

Course Introduction. Purpose: Objectives: Content: 27 pages 4 questions. Learning Time: 20 minutes

Module Introduction. PURPOSE: The intent of this module is to explain MCU processing of reset and interrupt exception events.

The 8051 microcontroller has two 16-bit timers/counters called T0 and T1.

ELCT 912: Advanced Embedded Systems

Types of Interrupts:

PPG Function of F2MC-16LX MCU Series as PWM

Capturing the Time of an External Event Input Capture Subsystem

Mark Redekopp, All rights reserved. EE 357 Unit 10b. Interrupts Timers

3. The MC6802 MICROPROCESSOR

What happens when an HC12 gets in unmasked interrupt:

The MC9S12 Input Capture Function

Introduction to the MC9S12 Hardware Subsystems

EE 308 Spring Exam 1 Feb. 27

Menu. XMEGA 16-bit Timer/Counter Type 0 and Type 1 EEL 3744 EEL 3744

Product Update. Errata to Z8 Encore! 8K Series Silicon. Z8 Encore! 8K Series Silicon with Date Codes 0402 and Later

ARM Advanced Interrupt Controller

An Interrupt is either a Hardware generated CALL (externally derived from a hardware signal)

DEVICE DRIVERS AND TERRUPTS SERVICE MECHANISM Lesson-15: Writing Device Driving ISRs in a System

original M68K requests/priorities Interrupts to execute important code interrupts (n will always be I) I-bits bits in SR accomplish this

8051 Timers. Class 7 EE4380 Fall Pari vallal Kannan. Center for Integrated Circuits and Systems University of Texas at Dallas

8-bit Microcontroller with 1K Byte of In-System Programmable Flash AT90S1200

Grundlagen Microcontroller Interrupts. Günther Gridling Bettina Weiss

Mobile Operating Systems Lesson 01 Operating System

2008 Chapter-8 L1: "Embedded Systems - Architecture, Programming and Design", Raj Kamal, Publs.: McGraw-Hill, Inc.

These three counters can be programmed for either binary or BCD count.

2. (2 pts) If an external clock is used, which pin of the 8051 should it be connected to?

C Language Programming, Interrupts and Timer Hardware

Chapter 7 Central Processor Unit (S08CPUV2)

Chapter 14. Motorola MC68HC11 Family MCU Architecture

This resource describes how to program the myrio in C to perform timer interrupts.

Chapter Family Microcontrollers Instruction Set

68HC11 Opera,ng Modes

UNIVERSITY OF CONNECTICUT. ECE 3411 Microprocessor Application Lab: Fall Quiz IV

8051 Serial Communication

School of Electrical, Computer and Telecommunications Engineering University of Wollongong Australia

Chapter 09. Programming in Assembly

C Language Programming, Interrupts and Timer Hardware

Program Modeling Concepts:

A 3-SPEED STEPPER MOTOR

Programming Embedded Systems

Module 3. Embedded Systems I/O. Version 2 EE IIT, Kharagpur 1

M68HC08 Microcontroller The MC68HC908GP32. General Description. MCU Block Diagram CPU08 1

ECE 367 -Experiment #1 Fall 2012

538 Lecture Notes Week 5

EE 308 Spring A software delay

Interrupts. EE4380 Fall 2001 Class 9. Pari vallal Kannan. Center for Integrated Circuits and Systems University of Texas at Dallas

However, if an event comes in when the new value is being written to the pulse accumulator counter, that event could be missed. One solution to this p

AGH University of Science and Technology Cracow Department of Electronics

EMCH 367 Fundamentals of Microcontrollers Example_RPM_1 EXAMPLE RPM_1

Design and development of embedded systems for the Internet of Things (IoT) Fabio Angeletti Fabrizio Gattuso

538 Lecture Notes Week 5

Physics 120B: Lecture 11. Timers and Scheduled Interrupts

ME 4447 / ME 6405: Introduction to Mechatronics

8-bit Microcontroller. Application Note. AVR134: Real-Time Clock (RTC) using the Asynchronous Timer. Features. Theory of Operation.

Engineering Bulletin. Introduction and Background. Definition of Early TOF EB389/D 11/2001

8051 Peripherals. On-Chip Memory Timers Serial Port Interrupts. Computer Engineering Timers

Pulse Accumulator on the HCS12

Transcription:

Chapter 6 PROGRAMMING THE TIMERS

Lesson 3 Real Time Clocked Interrupts and Software Timers 2

Real Time Clock Interrupt 3

Real Time interrupts Prescaling Pre-scaling by RT1-RT0 bits for 4 or 8 or 16 2 13 0.5 µs = 1, 2, 4, or 8 4.096 ms rate interrupts Counts 2 13 clock inputs, each of period 0.5µs for 8MHz XTAL 4

68HC11 Real Time Interrupts programmability 13-bit counter Internal clock input rate 1 or 4 or 8 or 16 factor programmable by RT1-RT0 bits Count Inputs from internal clock E Clock Interrupt service on 13-bits count overflow programmable by mask bit 5

Feature of Real Time interrupts 68HC11 Real Time Overflow interrupts programmable for r 4.096 ms rate only within 64 clock cycles of start up of 68HC11 MCU [r= 1 or 2 or 4 or 8] Interrupts are programmable at 4 or 8 or 16 or 32.768 ms rates for 8MHz XTAL at any instance of the program 6

Feature of Real Time interrupts RT Interrupt flag bit distinct from that for TCNT OV RT Interrupt enabling/disabling bit distinct from that for TCNT OV RT Interrupt ISR_Vect_Addr is distinct from that for TCNT overflow interrupt 7

Applications Performing periodic tasks at 1, 2, 4, or 8 4.096 ms intervals Multi-tasking with tasks scheduled to switch context from one to another at periodic intervals Programming switching periodically to supervisory mode at periodic intervals 8

Software Timer SWT (software timer) value is programmed with bits,which are compared with counts x of a running timer (free running or programmable) When x reaches the programmed bits, an interrupt called software timer activates. 9

8096 Software Timers The ISR corresponding to SWT activates executes in case previously enabled Four SWTs, SWT0, SWT1,SWT2,SWT3: a common ISR_Vect_Addr addresses but distinct interrupt pending flags in 80x96 10

Feature of 8096 SWT interrupts 68HC11 Overflow interrupts are programmable for r 4.096 ms rate only within 64 clock cycles of start up of 68HC11 MCU Each 80x96 SWT Interrupt programmable at any time for a given 16-bit timer instance 11

SWT Interrupts-80x96 Select an SWTn; n = 0, 1, 3 or 4 No Pre-scaling Select either Free running counter T1 or programmable timer T2 for SWT Clock inputs Compare SWTn bits with selected T1 or T2 timer counts = x 12

SWT Interrupts-80x96 Common SWTs Interrupt Vector 4 SWTn Interrupt Enable bits 4 SWTn Interrupt Pending flags 4 SWT Interrupt ISRs called as per SWTn from instruction at the common vector address 13

Applications Performing tasks at specified instances Multi-tasking with tasks scheduled to switch context from one to another at the prefixed instances No output pin like out compare, only SWT ISR executes on comparison successful for equality. 14

Summary 15

We learnt Real Time interrupts - Programmable at any instance unlike TCNT overflow Programmable to 4,8,16 and 32 ms for 8Mz clock by rate-bits RT1-RT0 A flag on real time interrupts A service routine executes Maskable Interrupt 16

We learnt Software Times devices - Programmable bits at any instance like OC register bits Maskable Interrupt occurrence instance programmable with respect to to free running counter-timer T1 or programmable counter-timer T2 Sets an interrupt pending flag 17