Lesson-3: Counters and Timers

Similar documents
Chapter 6 PROGRAMMING THE TIMERS

Chapter 2. Overview of Architecture and Microcontroller-Resources

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

Chapter 09. Programming in Assembly

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

Chapter 09. Programming in Assembly

Chapter 6 PROGRAMMING THE TIMERS

80C51 Block Diagram. CSE Overview 1

Department of EIE / Pondicherry Engineering College. Timer/Counters. Department of EIE / Pondicherry Engineering College 1

CHAPTER TIMER PROGRAMMING

ENE 334 Microprocessors

Interrupts, timers and counters

Timer Counter and Interrupt. Equation (16 bits counter, Mode 1, 16MHz):

Timer programming

By the end of Class. Outline. Homework 5. C8051F020 Block Diagram (pg 18) Pseudo-code for Lab 1-2 due as part of prelab

8051 Microcontroller

8051 Microcontroller memory Organization and its Applications

CPEG300 Embedded System Design. Lecture 8 Timer

ELEG3923 Microprocessor Ch.9 Timer Programming

General Purpose Programmable Peripheral Devices. Assistant Professor, EC Dept., Sankalchand Patel College of Engg.,Visnagar

8051 Microcontroller

Lecture 9. Timer Operations and Programming

UNIT IV MICROCONTROLLER

Rev. No. History Issue Date Remark

8051 microcontrollers

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

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

Lecture 1. Course Overview and The 8051 Architecture

Using Timers of Microchip PIC18F Microcontrollers

MODEL ANSWER SUBJECT- MICROCONTROLLER(12187) CLASS-EJ5E CLASS TEST-02 Q1.)Attempt any THREE of the following.

The Microcontroller. Lecture Set 3. Major Microcontroller Families. Example Microcontroller Families Cont. Example Microcontroller Families


UBC104 Embedded Systems. Review: Introduction to Microcontrollers

C8051 Legacy-Speed 8-Bit Processor Core

1. Attempt any three of the following: 15

16-BIT TIMER AND EVENT COUNTER

Measuring Duty Cycles with an Intel MCS-51 Microcontroller

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

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

Mod-3: Interrupts,Timer operation,serial communication 1

PGT302 Embedded Software Technology. PGT302 Embedded Software Technology

Timers and interrupts

SYLLABUS UNIT - I 8086/8088 ARCHITECTURE AND INSTRUCTION SET

8-bit Microcontroller with 8K Bytes In-System Programmable Flash AT89S52

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

ISSI. IS89C51 CMOS SINGLE CHIP 8-BIT MICROCONTROLLER with 4-Kbytes of FLASH ISSI IS89C51 NOVEMBER 1998 FEATURES GENERAL DESCRIPTION

8051 Microcontroller Interrupts

The Timers/Counters The Serial Interface The Interrupt System Reset P0.0-P0.7 P2.0-P2.7. Port 2 Drivers. Port 2 Latch

8051 Microcontrollers


Three criteria in Choosing a Microcontroller


Interrupt/Timer/DMA 1

EE 354 September 16, 2016 C Sample Programs

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

CONSUMER ELECTRONICS Microwave Ovens

Handshake Solutions. HT80C51 User Manual

INTEGRATED CIRCUITS DATA SHEET. P89C738; P89C739 8-bit microcontrollers Dec 15. Product specification File under Integrated Circuits, IC20

MICROPROCESSORS AND MICROCONTROLLERS MATERIAL. Features of 8051:

Lecture-55 System Interface:

THE 8051 MICROCONTROLLER Simple comparison: Pentium vs. 8051

FACULTY OF ENGINEERING LAB SHEET

8051 Core Specification

Question Bank Microprocessor and Microcontroller

8XC51RA RB RC Hardware Description

Topic 11: Timer ISMAIL ARIFFIN FKE UTM SKUDAI JOHOR

PIC32&Overview& E155&

Introduction to Embedded Systems

Course Introduction. 2009, Renesas Technology America, Inc., All Rights Reserved

EE6502- MICROPROCESSOR AND MICROCONTROLLER

UNIT 5. Microcontrollers. Syllabus

Program Modeling Concepts:

CS 320. Computer Architecture Core Architecture

MCU: Interrupts and Timers. Ganesh Pitchiah

Module I. Microcontroller can be classified on the basis of their bits processed like 8bit MC, 16bit MC.

UNIT V MICRO CONTROLLER PROGRAMMING & APPLICATIONS TWO MARKS. 3.Give any two differences between microprocessor and micro controller.

Serial I-O for Dinesh K. Sharma Electrical Engineering Department I.I.T. Bombay Mumbai (version 14/10/07)

Section 13. Timer0 HIGHLIGHTS. Timer0. This section of the manual contains the following major topics:

CoE3DJ4 Digital Systems Design. Chapter 6: Interrupts

VRS550-8kB Flash, 256B RAM, 25~40MHz, 8-Bit MCU VRS560-16kB Flash, 256B RAM, 40MHz, 8-Bit MCU

8051 MICROCONTROLLER

R bit Microcontroller Megafunction

CHAPTER 1 GENERAL INFORMATION

The Final Word on 8051 Microcontroller

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

EE6008-Microcontroller Based System Design Department Of EEE/ DCE

EE 308: Microcontrollers

This application note describes the time measurement function of Timer S with the gate function.

Microcontroller and Embedded Systems:

Section 11. Timer0. Timer0 HIGHLIGHTS. This section of the manual contains the following major topics:

AVR Timers TIMER0. Based on:

VRS540-4kB Flash, 128B RAM, 25~40MHz, 8-Bit MCU

MAHALAKSHMI ENGINEERING COLLEGE TIRUCHIRAPALLI

8-bit Microcontroller with 2/4-Kbyte Flash AT89LP2052 AT89LP4052

P89V52X2. 1. General description. 2. Features. 8-bit 80C51 low power 8 kb flash microcontroller with 256 B RAM, 192 B data EEPROM

8-Bit CMOS Microcontorller

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

Laboratory 4 Usage of timers

PART - B (Answer all five units, 5 X 10 = 50 Marks)

SECTION 1: INTRODUCTION 5 SECTION 2: ORDERING INFORMATION 5 SECTION 3: ARCHITECTURE 5

Transcription:

8051 AND ADVANCED PROCESSOR ARCHITECTURES Lesson-3: Counters and Timers 1

Timing and counting devices Two T0 and T1 in classic 8051 family and three T0, T1 and T2 in 8052 family (an extension of 8051). 2

Counting/timing device as timer A device for timing when the inputs to counting are given by a clock. The clock pulses are internally given at the specific time intervals in case of functioning as timer. 3

Counting/timing device as counter A device for counting when the inputs to count are given externally. Counter is given the input to count from external input pin. 4

Counting/timing device External controls for activation or deactivation of running When timing or counting devices is externally controlled by the gate input, when GT0 or GT1 is externally activated the device can function else it deactivates in gate input mode. GT0 or GT1 signals are given at P3.2 and P3.3. 5

Counting/timing device External count inputs in counter mode T0 counts the T0 is given the input to count from external input pin T0 at P3.4. T1 counts when T1 is given the input to count from external input pin T1 at P3.5. 6

Four Port P3 Pin functions P3.2, P3.3, P3.4 and P3.5 When TMOD SFR bits 3, 7, 2 and 6 set = 1, function as GT0 (gate for starting/stopping T1), GT1 (gate for starting/stopping T1), T0 (count input to T0) and T1 (count input to T1) inputs, respectively. 7

Two SFRs TH1-TL1 TL1 For accessing the counts or time higher and lower 8 bits of T1 device The SFRs hold the T1-device 16-bits. 8

Two SFRs TH0-TL0 TL0 For accessing the count or time higher and lower 8 bits The SFRs hold the T0 device 16-bits 9

SFR TMOD Controls the T1 and T0 modes using the upper and lower 4 bits each, which program the counting/timing of T1 and T0. A bit in each controls the function that external gate input controls or not. A bit controls the function that counter or timer mode is used. Two bits controls the functional mode of timer/counter as mode 0 or 1 or 2 or some other action 10

SFR TCON T1 and T0 control and status bits Upper four 4 bits program the modes of counting/timing devices T1 and T0. TCON.7 and TCON.5 show the timer/counter overflow status for T1 and T0 respectively. TCON.6 and TCON.4 control the start and stop of the timer/counter Lower bits of TCON are for the interrupt control for INT0 and INT1(Refer Lesson 5) 11

Timer/Counter T0 8-bit SFRs TMOD (lower 4 bits), TCON (bit 5 and 4), TL0 (count/time bits), TH0 (count/time bits) Counter with inputs at P3.4 when bit 2 TMOD =1, timer with internal clock timed inputs when bit 2 TMOD = 0 When mode set = 0, 8-bit timer/counter mode and TH0 is used and TL0 is used for prescaling (dividing) inputs by 32 When mode set = 1, 16-bit timer/counter mode with TH0-TL0 is used for timing or counting 12

Timer/Counter T0 When mode set = 2, 8-bit timer/counter TH0 is used and TL0 is used for autoreloading the TH0 after timeout using a preset value at TL0 When mode set = 3, two 8-bit timer/counters mode TH0 and TL0 are independent 8-bit timer/counter and T1 does not function. 13

Timer/Counter T1 8-bit SFRs used TMOD (upper 4 bits), TCON (bit 7 and 6), TL1 (count/time bits), TH1 (count/time bits) Counter with inputs at P3.5 when bit 6 TMOD =1, timer with internal clock timed inputs when bit 6 TMOD = 0 When mode set = 0, 8-bit timer/counter mode and TH1 is used and TL1 is used for prescaling (dividing) inputs by 32 When mode set = 1, 16-bit timer/counter mode with TH1-TL1 is used for timing or counting 14

Timer/Counter T1 When mode set = 2, 8-bit timer/counter TH1 is used and TL1 is used for autoreloading the TH1 after timeout using a preset value at TL1 When mode set = 3, T1 stops as TH0 now functions in place of T1. 15

Summary 16

We learnt Timer-Counter T0 and T1 TMOD SFR TCON SFR upper Four bits External four P3 pins for external control and external count inputs Modes 0, 1, 2, 3 of T0 Mode 0, 1 and 2 of T1 17

End of Lesson 3 of Chapter 2 18