Jump, Loop, and Call Instructions

Slides:



Advertisements
Similar presentations
The 8051 Microcontroller and Embedded Systems
Advertisements

Autumn 2012C.-S. Shieh, EC, KUAS, Taiwan1 The 8051 Family Microcontroller Chin-Shiuh Shieh Department of Electronic Engineering.
4-1 Timers Timers can be used for  timing  event counting  pulse width measurement  pulse generation  frequency multiplication There are 8 Timers.
8051 I/O Interfacing Need for more ports PPI 8255
8051 Core Specification.
CSC Timers Since this is a microcontroller it mainly finds itself in embedded devices Quite often embedded devices need to synchronize events The.
Embedded Systems UNIT 3. Pin Details of 8051 Pins 1-8: Port 1 Each of these pins can be configured as an input or an output. Pin 9: The positive voltage.
1.  8051 Timers “count up,” incrementing the Timer’s respective “count register” each time there is a triggering clock pulse. 2  When the “count register”
Lecture 9 Timer Operations and Programming. 2  Introduction  Summary of timers  Timer programming sequence  Summary of timer SFRs  Timer 0: 8-bit.
The 8051 Microcontroller architecture
UNIT V INTERFACING MICROCONTROLLER
Chapter Timer Programming in Assembly and C
Today’s Lecture List the Timers of PIC18 and their associated registers Describe the various modes of the PIC18 timers Program the PIC18 timers in Assembly.
The 8051 Microcontroller and Embedded Systems
NATIONAL TAIWAN OCEAN UNIVERSITY 國立台灣海洋大學 2002/4/8 Microcomputers and Microprocessors Chapter 9 COUNTER/TIMER PROGRAMMING IN THE 8051.
CHAPTER TIMER PROGRAMMING Timers The 8051 has two timers/counters, they can be used as ◦ Timers to generate a time delay ◦ Event counters.
8051 timer/counter.
8051 timer/counter.
Lecture 9. - Synchronous Devices require a timing signal. Clock generated Interval Timer Microprocessor Interval Timer Clk PCLK = MHz PCLK (for.
8254 Programmable Interval Timer
1 Chapter 4 Timer Operation (I. Scott MacKenzie).
Chapter 9 Counter/Timer Programming in the 8051
8253 TIMER. Engr 4862 Microprocessors 8253 / 8254 Timer A.k.a. PIT (programmable Interval Timer), used to bring down the frequency to the desired level.
8254 Counter/Timer Counter Each of the three counter has 3 pins associated CLK: input clock frequency- 8 MHz OUT GATE: Enable (high) or disable.
Timer/counter Chapter 12
8254 SOFTWARE PROGRAMMABLE TIMER/COUNTER
Chapter 4 TIMER OPERATION
CoE3DJ4 Digital Systems Design Chapter 4: Timer operation.
Timers /Counters Programming  The 8051 has 2 timers/counters: ○ timer/counter 0 ○ timer/counter 1 They can be used as 1. The timer is used as a time.
1. Registers Used in Timer/Counter  TH0, TL0, TH1, TL1  TMOD (Timer mode register)  TCON (Timer control register) 2.
8051 Timer/Counter Lec note 7.
Intel 8051 Another family of microcontroller is the Intel 8051 family. The basic 8051 microcontroller has four parallel input/output ports, port 0, 1,
The 8051 Microcontroller Prepared By, R-THANDAIAH PRABU M.E.,
The Silicon Laboratories C8051F020
8051 Aula 02 Prof Afonso Ferreira Miguel. Microcontrolador 8051 (MCS-51)  Timers do MCS51 Two 16-bit Counter/Timers: Two 16-bit Counter/Timers: Up counters,
Lecture 41 CSE 341 – Microprocessors Lecture 4 Md. Omar Faruqe UB 1228
Timer Programming in Assembly and C Prepared By:
HJD Institute of Technical Education & Research- Kera(Kutch) The 8051 Microcontroller architecture PREPARED BY: RAYMA SOHIL( )
DEPARTMENT OF ELECTRONICS ENGINEERING V-SEMESTER MICROPROCESSOR & MICROCONTROLLER 1 CHAPTER NO microcontroller & programming.
Serial I/O Port.
Chapter 11 INTERRUPTS PROGRAMMING
Assembly Language * * * * * * * 8051 Timer
Source: Serial Port Source:
UNIT – Microcontroller.
8051 Timers Timers are the peripherals of the 8051 Microcontroller.
Timer Source: under
Programmable Interval Timer
SERIAL PORT PROGRAMMING
BVM Engineering College Electrical Engineering Department : Microprocessor and Microcontroller Interfacing Interrupts of 8051 Prepared by:
Interrupt Source: under
UNIT 5 TIMRERS/COUNTERS
Introduction to Micro Controllers & Embedded System Design I/O Processing and Serial Port Operation Department of Electrical & Computer Engineering Missouri.
Timer Operations and Programming
EMT 348: Microcontroller Timer/counter
Source: Serial Port Source:
8051 Timers Prof. Rajiv R Bhandari.
Introduction to Micro Controllers & Embedded System Design Timer Operation Department of Electrical & Computer Engineering Missouri University of Science.
Timer.
8051 Timers / Counters It has two timers Timer 0 and Timer 1.
8051 Microcontroller.
Timer Source: under
Interrupt Source: under
PIC18 Timer Programming “Explain the assembly language programming for the timer and counter module”
Interrupt Source: under
Source: Serial Port Source:
Timer Source: under
Source: Serial Port Source:
8253.
PROCESSORS & CONTROLLERS
Presentation transcript:

Jump, Loop, and Call Instructions WEEK 2 Jump, Loop, and Call Instructions ET2640 Microprocessors and Microcontrollers

ET2640 Microprocessors and Microcontrollers

ET2640 Microprocessors and Microcontrollers

ET2640 Microprocessors and Microcontrollers

ET2640 Microprocessors and Microcontrollers

ET2640 Microprocessors and Microcontrollers

ET2640 Microprocessors and Microcontrollers I/O Port Programming ET2640 Microprocessors and Microcontrollers

ET2640 Microprocessors and Microcontrollers Peripherals Know the device peripheral parameters Resolution of data Frequency of measurement Understand the interface issues ET2640 Microprocessors and Microcontrollers

ET2640 Microprocessors and Microcontrollers

ET2640 Microprocessors and Microcontrollers

ET2640 Microprocessors and Microcontrollers

ET2640 Microprocessors and Microcontrollers

ET2640 Microprocessors and Microcontrollers

ET2640 Microprocessors and Microcontrollers

ET2640 Microprocessors and Microcontrollers

ET2640 Microprocessors and Microcontrollers

ET2640 Microprocessors and Microcontrollers

ET2640 Microprocessors and Microcontrollers

ET2640 Microprocessors and Microcontrollers

ET2640 Microprocessors and Microcontrollers

COUNTER/TIMER PROGRAMMING IN THE 8051 ET2460 Microcomputers and Microprocessors

Outlines List the timers of the 8051 and their associated registers Describe the various modes of the 8051 timers Program the 8051 timers to generate time delays Program the 8051 counters as event counters

PROGRAMMING 8051 TIMERS Timer 0 registers TL0 ( timer 0 low byte ) TH0 ( timer 0 high byte )

Timer 1 registers TL1 ( timer 1 low byte ) TH1 ( timer 1 high byte )

TMOD (timer mode) register

Find the timer’s clock frequency and its period for various 8051-based systems, with the following crystal frequencies: 12 mHz 16 mHz 11..592 mhz

ET2640 Microprocessors and Microcontrollers Oscillator/Clock ET2640 Microprocessors and Microcontrollers

Example: Find the value for TMOD if we want to program timer 0 IN MODE 2 USE THE 8051 XTAL for the clock source, and use instructions to start and stop the timer TMOD-0000 0010 ;Timer 0, mode 2 C/T=0 to use XTAL clock source, and Gate-0 to use internal software Start and atop method.

Mode 1 programming 1.Loaded value into TL and TH 2.”SETB TR0” for timer 0 ;”SETB TR1” for timer 1 3.If TF (timer flag) = high “CLR TR0” or “CLR TR1” 4.Reloaded TH and TL value, TF reset to 0

Steps to program in mode 1 1.Load the TMOD value 2.Load registers TL and TH 3.Start the timer (SETB TR0 or SETB TR1) 4.Keep monitoring the timer flag (TF) 5.Stop the timer (CLR TR0 or CLR TR1) 6.Clear the TF flag 7.Go back to step 2

Calculate Timer Delay

Finding values to be loaded into the timer Assuming XTAL =11.0592MHz from Example 9-10 1.Divide the desired time delay by 1.085μs 2.Perform 65536-n, where n is the decimal value we got in Step 1 3.Convert the result of Step 2 to hex, where yyxx is the initial hex value to be loaded into the timer’s registers 4.Set TL = xx and TH = yy

Mode 0 Mode 2 Programming Like mode 1 except that it is a 13-bit timer 1.Loaded value into TH (8-bit timer) 2.”SETB TR0” for timer 0 ;”SETB TR1” for timer 1 3.If TF (timer flag) = high “CLR TR0” or “CLR TR1” 4.Reloaded TL value kept by TH

Steps to program in Mode 2 1.Load the TMOD value 2.Load the TH registers 3.Start the timer 4.Keep monitoring the timer flag (TF) 5.Clear the TF flag 7.Go back to step 4

C/T bit in TMOD register

The case of GATE =1 in TMOD