2015 course SPPU SEIT syllabus of subject Processor Architecture and Interfacing (PAI) This covers Mode 1 and Mode 2 programming of timers, Counters and Counter Programming
SE PAI Unit 5_Serial Port Programming in 8051 micro controller_Part 3KanchanPatil34
2015 course SPPU SEIT syllabus of subject Processor Architecture and Interfacing (PAI) This covers importance of RI Flag, Importance of TI flag, examples on Serial Port programming
SE PAI Unit 5_Serial Port Programming in 8051 micro controller_Part 3KanchanPatil34
2015 course SPPU SEIT syllabus of subject Processor Architecture and Interfacing (PAI) This covers importance of RI Flag, Importance of TI flag, examples on Serial Port programming
This PPT is about the ARM processors, family of processors,significance,applications and architectural features and Instruction Set Architecture useful for beginners
this ppt only for beginner who want to understand concept of Timer counter operation of LPC2148 step by step.
hope it may help u.
always welcoming ur suggestion.
SE PAI Unit 5_Timer Programming in 8051 microcontroller_Part 1KanchanPatil34
2015 course SPPU SEIT syllabus of subject Processor Architecture and Interfacing (PAI) This covers Introduction to Timers, Special Function Registers as Timer 1 Register, Timer 0 Register, TMOD register, TCON register, Operating modes of Timer
This PPT is about the ARM processors, family of processors,significance,applications and architectural features and Instruction Set Architecture useful for beginners
this ppt only for beginner who want to understand concept of Timer counter operation of LPC2148 step by step.
hope it may help u.
always welcoming ur suggestion.
SE PAI Unit 5_Timer Programming in 8051 microcontroller_Part 1KanchanPatil34
2015 course SPPU SEIT syllabus of subject Processor Architecture and Interfacing (PAI) This covers Introduction to Timers, Special Function Registers as Timer 1 Register, Timer 0 Register, TMOD register, TCON register, Operating modes of Timer
Difference between linear and non-linear data structure, Tree Data Structure - Introduction, Terminology, Tree Representation, Binary Tree, Properties of Binary Tree
Depth First Search Traversal of Binary Tree - Recursive and Non-recursive In-order, preorder, post-order traversal, Breath First Traversal of Binary Tree
2015 course SPPU SEIT syllabus of subject Processor Architecture and Interfacing (PAI) This covers introduction to paging in 80386, Address Translation (Linear to physical), Page Level Protection,
2015 course SPPU SEIT syllabus of subject Processor Architecture and Interfacing (PAI) This covers Introduction to multitasking, Support Registers and Data Structures, Task State Segment (TSS), TSS Descriptor, Task Register, Task Switching via TSS and Task Gate, Task Gate Descriptor,
PAI Unit 2 Segmentation in 80386 microprocessorKanchanPatil34
2015 course SPPU SEIT syllabus of subject Processor Architecture and Interfacing (PAI) This covers types of address spaces : Logical, linear, Physical, Address Translation in 80386, Segment Descriptor Format, Types of Segment Descriptors,
PAI Unit 2 Protection in 80386 segmentationKanchanPatil34
2015 course SPPU SEIT syllabus of subject Processor Architecture and Interfacing (PAI) This covers protection mechanism in 80386 microprocessor through conforming code segment and call gate
SE PAI Unit 2_Data Structures in 80386 segmentationKanchanPatil34
2015 course SPPU SEIT syllabus of subject Processor Architecture and Interfacing (PAI) This covers Descriptor Tables in 80386 as Global Descriptor Table, Local Descriptor Table, Types of Interrupts/Exception : Traps, faults, Aborts, Real mode Interrupt Structure (IVT), Protected mode interrupt Structure (IDT)
SE PAI Unit 5_Serial Port Programming in 8051 microcontroller_Part 2KanchanPatil34
2015 course SPPU SEIT syllabus of subject Processor Architecture and Interfacing (PAI) This covers special function registers used for serial communication in 8051, Operating modes of serial communication, doubling baud rate in 8051
SE PAI Unit 5_Serial Port Programming in 8051 microcontroller_Part 1KanchanPatil34
2015 course SPPU SEIT syllabus of subject Processor Architecture and Interfacing (PAI) This covers the basics of serial communication, Data framing and Baud Rate in 8051 microcontroller.
2015 course SPPU SEIT syllabus of subject Processor Architecture and Interfacing (PAI) This covers ports of 8051 microcontroller, Description and How to configure those ports with examples
Unit 5_Interrupt programming in 8051 micro controller - part 2KanchanPatil34
2015 course SPPU SEIT syllabus of subject Processor Architecture and Interfacing (PAI) This covers Special Function Registers of Interrupt programming of 8051 (IE, IP registers), example on interrupt programming
2015 course SPPU SEIT syllabus of subject Processor Architecture and Interfacing (PAI) This covers Introduction to Interrupts in 8051, Interrupt Handler, Types of Interrupts etc.
Embracing GenAI - A Strategic ImperativePeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdfTechSoup
In this webinar you will learn how your organization can access TechSoup's wide variety of product discount and donation programs. From hardware to software, we'll give you a tour of the tools available to help your nonprofit with productivity, collaboration, financial management, donor tracking, security, and more.
Macroeconomics- Movie Location
This will be used as part of your Personal Professional Portfolio once graded.
Objective:
Prepare a presentation or a paper using research, basic comparative analysis, data organization and application of economic information. You will make an informed assessment of an economic climate outside of the United States to accomplish an entertainment industry objective.
The French Revolution, which began in 1789, was a period of radical social and political upheaval in France. It marked the decline of absolute monarchies, the rise of secular and democratic republics, and the eventual rise of Napoleon Bonaparte. This revolutionary period is crucial in understanding the transition from feudalism to modernity in Europe.
For more information, visit-www.vavaclasses.com
Model Attribute Check Company Auto PropertyCeline George
In Odoo, the multi-company feature allows you to manage multiple companies within a single Odoo database instance. Each company can have its own configurations while still sharing common resources such as products, customers, and suppliers.
Introduction to AI for Nonprofits with Tapp NetworkTechSoup
Dive into the world of AI! Experts Jon Hill and Tareq Monaur will guide you through AI's role in enhancing nonprofit websites and basic marketing strategies, making it easy to understand and apply.
A Survey of Techniques for Maximizing LLM Performance.pptx
SE PAI Unit 5_Timer Programming in 8051 microcontroller_Part 2
1. 1
Unit 5: 8051 Timers/Counters Programming
Part 2
Subject: Processor Architecture & Interfacing
(SPPU, Pune 2015 Course of Information Technology)
Class: SEIT Semester: II
Prepared By,
Ms. K. D. Patil, Assistant Professor
Department of Information Technology
(NBA accredited)
Sanjivani College of Engineering, Kopargaon-423603.
Maharashtra, India.
(An Autonomous Institute, Affiliated with SPPU, Pune.)
NAAC ‘A’ Grade Accredited, ISO 9001:2015 certified
2. Contents
Prepared By: Ms. K. D. Patil, Dept. of Information
Technology, Sanjivani COE, Kopargaon2
Part 1
Introduction
Special Function Registers
Timer 0 Register
Timer 1 Register
TMOD Register
TCON Register
How to UseTimer
Operating Modes ofTimer
Part 2
Timer Programming
Mode 1 Programming
Mode 2 Programming
Introduction to Counters
Counter Programming
3. Steps in Mode 1 Programming
Prepared By: Ms. K. D. Patil, Dept. of Information
Technology, Sanjivani COE, Kopargaon3
1. Load theTMOD value register indicating which timer (timer 0
or timer 1) is to be used and which timer mode (0 or 1) is
selected
2. Load registersTL andTH with initial count value
3. Start the timer (SETBTRx)
4. Keep monitoring the timer flag (TF) with JNBTFx, target
instruction to see if it is raised. Get out of the loop whenTF
becomes high
5. Stop the timer (CLRTRx)
6. Clear theTF flag for the next round (CLRTFx)
7. Go back to Step 2 to loadTH andTL again
4. Steps in Mode 2 Programming
Prepared By: Ms. K. D. Patil, Dept. of Information
Technology, Sanjivani COE, Kopargaon4
1. Load theTMOD value register indicating which timer
(timer 0 or timer 1) is to be used and which timer mode
(2) is selected
2. Load registers TH with initial count value
3. Start the timer (SETBTRx)
4. Keep monitoring the timer flag (TF) with JNBTFx, target
instruction to see if it is raised. Get out of the loop when
TF becomes high
5. Clear theTF flag for the next round (CLRTFx)
6. Go back to Step 4, since mode 2 is auto reloaded
5. Clock Source for Timer
Prepared By: Ms. K. D. Patil, Dept. of Information
Technology, Sanjivani COE, Kopargaon5
Timer needs a clock pulse to ticks
if C/T = 0, the crystal frequency attached to the 8051 is the source
of the clock for the timer
Size of Crystal frequency also decides the speed at which 8051
timer ticks
8051 based systems have XTAL frequency of 10MHz to 40MHz
XTAL = 11.0592 MHz allows 8051 system to communicate with
IBM PC with no errors
The frequency for the timer is always 1/12th the frequency of the
crystal attached to the 8051
6. Clock Source for Timer
Prepared By: Ms. K. D. Patil, Dept. of Information
Technology, Sanjivani COE, Kopargaon6
When , XTAL =11.0592MHz
1 Machine cycle of 8051 consists of 12 OSC periods (see fig.)
Timer Frequency
= (11.0592/12) = 921.6 KHz
Time period of each machine cycle
= 1/921.6 KHz= 1.085 us
1 instruction takes 1.085 us for execution
7. Finding Values to be loaded in TH-TL
Prepared By: Ms. K. D. Patil, Dept. of Information
Technology, Sanjivani COE, Kopargaon7
If XTAL = 11.0592 MHz
Timer Frequency = (11.0592/12) = 921.6 KHz
We know that each clock hasTime period of each machine
cycle = 1/921.6 KHz= 1.085 us
1. To get the number of counts, Divide the desired time delay
by 1.085 us, we will get n
2. Perform 65536 – n, where n is the decimal value we got in
step 1
3. Convert the result of Step2 to hex, whereYYXX is the
initial hex value to be loaded into the timer’s register
4. SetTL = XX andTH =YY
8. Calculate the amount of Time Delay
Prepared By: Ms. K. D. Patil, Dept. of Information
Technology, Sanjivani COE, Kopargaon8
If XTAL = 11.0592 MHz
Timer Frequency = (11.0592/12) = 921.6 KHz
We know that each clock hasTime period of each machine cycle
= 1/921.6 KHz= 1.085 uSec
Means,Timer 0 counts up each 1.085 us resulting in
delay = number of counts × 1.085us.
The number of counts for the roll over is
FFFF H –YYXX H = Result
However, we add one to Result because of the extra clock needed
when it rolls over from FFFF to 0 and raise theTF flag
This gives (Result + 1) × 1.085us = ___us for half the pulse
For the entire period it isT = 2 × ___us = ___us as the time delay
generated by the timer
9. Calculate the amount of Time Delay
Prepared By: Ms. K. D. Patil, Dept. of Information
Technology, Sanjivani COE, Kopargaon9
In Hex
(FFFF –YYXX + 1) × 1.085 us,
whereYYXX areTH,TL initial
values respectively.
Notice that value YYXX are in
hex.
will give you delay for half
pulse
In Decimal
ConvertYYXX values of
theTH,TL register to
decimal to get a NNNN
decimal, then
(65536 - NNNN) × 1.085 us
will give you delay for half
pulse
10. Example No.1 (Mode 1 Programming)
Prepared By: Ms. K. D. Patil, Dept. of Information
Technology, Sanjivani COE, Kopargaon10
Assume that XTAL = 11.0592 MHz.What value do we need to
load the timer’s register if we want to have a time delay of 5 ms
(milliseconds)? Show the program for timer 0 to create a pulse
width of 5 ms on P2.3.
Solution:
XTAL = 11.0592 MHz
Timer Frequency = (11.0592/12) = 921.6 KHz
Each clock hasTime period = 1/921.6 KHz= 1.085 uSec
No. of clocks = 5000 us /1.085us = 4608
To achieve that we need to load the values inTH-TL
= 65536 – 4608 = 60928 in decimal
60928 D = EE00 H so, TH = EEH and TL = 00H
11. Example No.1 (Mode 1 Programming)
Prepared By: Ms. K. D. Patil, Dept. of Information
Technology, Sanjivani COE, Kopargaon11
Program:
ORG 00H
CLR P2.3 ;Clear P2.3
MOV TMOD,#01 ;Timer 0, 16-bitmode
HERE: MOV TL0,#00H ;TL0=00, the low byte
MOVTH0,#0EEH ;TH0=EE, the high byte
SETB P2.3 ;SET high P2.3
SETBTR0 ;Start timer 0
AGAIN: JNBTF0,AGAIN ;Monitor timer flag 0
CLRTR0 ;Stop the timer 0
CLRTF0 ;Clear timer 0 flag
RET
END
12. Example No.2 (Mode 1 Programming)
Prepared By: Ms. K. D. Patil, Dept. of Information
Technology, Sanjivani COE, Kopargaon12
Assume that XTAL = 11.0592 MHz, write a program to
generate a square wave of 2 kHz frequency on pin P1.5.
Solution:
T = 1 / f = 1 / 2 kHz = 500 us the period of square wave.
1 / 2 of it for the high and low portion of the pulse is 250
us.
250 us / 1.085 us = 230 and 65536 – 230 = 65306 which
in hex is FF1AH.
TL = 1A andTH = FF, all in hex.
13. Example No.2 (Mode 1 Programming)
Prepared By: Ms. K. D. Patil, Dept. of Information
Technology, Sanjivani COE, Kopargaon13
Program:
ORG 00H
MOV P1, # 0000 0000 B
MOV TMOD,#0000 0001 B ;Timer 0, 16-bitmode
MAIN:
SETB P1.5 ; make P1.5 as high
ACALL DELAY
CLR P1.5 ; make P1.5 as low
ACALL DELAY
SJMP MAIN ;Reload timer
DELAY: MOV TL1,#1AH ;TL1=1A,low byte of timer
MOV TH1,#0FFH ;TH1=FF, the high byte
SETB TR0 ;Start timer 0
BACK: JNB TF0, BACK ;until timer rolls over
CLR TR0 ;Stop the timer 0
CLR TF0 ;Clear timer 0 flag
SETB P1.5
RET
END
14. Example No.3 (Mode 2 Programming)
Prepared By: Ms. K. D. Patil, Dept. of Information
Technology, Sanjivani COE, Kopargaon14
Assume XTAL = 11.0592 MHz, find the
frequency of the square wave generated on
pin P1.0 in the following program
MOVTMOD,#20H ;T1/8-bit/auto reload
MOVTH1,#5 ;TH1 = 5
SETBTR1 ;start the timer 1
BACK: JNB TF1,BACK ;till timer rolls over
CPL P1.0 ;P1.0 to high, low
CLRTF1 ;clearTimer 1 flag
SJMP BACK ;mode 2 is auto-reload
Solution:
In mode 2 we do not need to
reloadTH since it is auto-reload.
Delay
= (256 - 05) × 1.085 us
= 251 × 1.085 us = 272.33 us is the
high portion of the pulse. Since
it is a 50% duty cycle square wave,
the periodT is twice that
T = 2 × 272.33 us = 544.67 us
frequency = 1.83597 kHz
15. Example No.4 (Mode 2 Programming)
Prepared By: Ms. K. D. Patil, Dept. of Information
Technology, Sanjivani COE, Kopargaon15
Assume that XTAL = 22 MHz, write a program to generate a
square wave of 1 kHz frequency on pin P1.2.
Solution:
XTAL = 22MHz
Timer Frequency = 22/12 = 1.83 us
Clock Period = 1 / 1.83us = 0.546 us
T = 1 / f = 1 / 1 kHz = 1000 us the period of square wave.
1 / 2 of it for the high and low portion of the pulse is 500 us.
No. of Cycles in 5 ms = 500 us / 0.546 us = 915
No. of Cycles in 1 ms = 915/5 = 183 cycles
Value loaded toTH = FF H – B7H = 48 H
16. Example No.4 (Mode 2 Programming)
Prepared By: Ms. K. D. Patil, Dept. of Information
Technology, Sanjivani COE, Kopargaon16
Program:
ORG 00H
MOV TMOD, #02 H ;Timer 0, mode 2
MAIN: CPL P1.2 ; complement P1.2
MOV R6, #05 ; ; count for multiple delay
DELAY: MOV TH0, #48H ;TH0=48 H
SETB TR0 ;Start timer 0
BACK: JNB TF0, BACK ;until timer rolls over
CLR TR0 ;Stop the timer 0
CLR TF0 ;Clear timer 0 flag
DJNZ R0, DELAY ; repeat until R0= 0
SJMP MAIN ; repeat to get train of pulses
END
17. Counter Programming
Prepared By: Ms. K. D. Patil, Dept. of Information
Technology, Sanjivani COE, Kopargaon17
Timers can also be used as counters counting events
happening outside the 8051
When it is used as a counter, it is a pulse outside of the 8051
that increments theTH,TL registers
TMOD andTH,TL registers are the same as for the timer
discussed previously
Programming the timer in the last section also applies to
programming it as a counter Except the source of the
frequency
18. Counter Programming
Prepared By: Ms. K. D. Patil, Dept. of Information
Technology, Sanjivani COE, Kopargaon18
The C/T bit in theTMOD registers decides the source of
the clock for the timer
When C/T = 1, the timer is used as a counter and gets its pulses
from outside the 8051
The counter counts up as pulses are fed from pins 14 and 15,
these pins are calledT0 (timer 0 input) andT1 (timer 1 input)
19. Counter Programming
Prepared By: Ms. K. D. Patil, Dept. of Information
Technology, Sanjivani COE, Kopargaon19
GATE Bit inTMOD
If GATE = 1, the start and stop of the timer are done externally
through pins P3.2 and P3.3 for timers 0 and 1, respectively
This hardware way allows to start or stop the timer externally at
any time via a simple switch
20. Example No. 5 (Counter Programming)
Prepared By: Ms. K. D. Patil, Dept. of Information
Technology, Sanjivani COE, Kopargaon20
Assuming that clock pulses are fed into pinT1, write a program for counter 1 in
mode 2 to count the pulses and display the state of theTL1 count on P2, which
connects to 8 LEDs.
Solution:
MOVTM0D,#01100000B ;counter 1, mode 2, ;C/T=1 external pulses
MOVTH1,#0 ;clearTH1
SETB P3.5 ;makeT1 input
AGAIN: SETBTR1 ;start the counter
BACK: MOV A,TL1 ;get copy ofTL
MOV P2,A ;display it on port 2
JNBTF1,Back ;keep doing, ifTF = 0
CLRTR1 ;stop the counter 1
CLRTF1 ;makeTF=0
SJMPAGAIN ;keep doing it
21. Reference
Prepared By: Ms. K. D. Patil, Dept. of Information
Technology, Sanjivani COE, Kopargaon21
“The 8051 Microcontroller and Embedded Systems using
Assembly and C” , Muhammad Ali Mazidi, Janice Gillispie
Mazidi, Rolin D. McKinlay, Second Edition, Pearson
publication
22. Prepared By: Ms. K. D. Patil, Dept. of Information
Technology, Sanjivani COE, Kopargaon22