SlideShare a Scribd company logo
Timers, CCP Module, ADC
and Serial Communication
Done by,
Ms.K.R.Priyanga
Assistant Professor,
Department of ECE,
Avinashilingam Institute
• To measure the time or generate the accurate
time delay
• To count clock pulses(Internal/External)
TIMERS
Different Timers
• PIC Timer 0
• PIC Timer 1
• PIC Timer 2
Timer Size
Control
Register
Count
Register
Min Delay Max Delay
TIMER0 8-bit
OPTION_RE
G
TMR0 0.2usec 13.107ms
TIMER1 16-bit T1CON
TMR1H,TMR
1L
0.2usec 104.857ms
TIMER2 8-bit T2CON TMR2 0.2usec 819usec
Timer 0
• OPTION_REG - configure the TIMER0
Prescalar, Clock Source
• TMR0 - holds the timer count value which will
be incremented depending on prescalar
configuration
• INTCON - contains the Timer0 overflow
flag(TMR0IF) and corresponding Inetrrupt
Enable flag(TMR0IE).
Option_ Register
RBPU: PORT B Pull up enable Bit
1 - Disabled
0 - connected to pull-resistors
INTEDG: Interrupt Edge Select Bit
1 – Interrupt on rising edge of the INT pin (0-1)
0 - Interrupt on falling edge of the INT pin (1-0)
T0CS: TMR0 Clock Source Select bit
1-Transition on T0CKI pin
0-Internal instruction cycle clock (CLKO)
T0SE: TMR0 Source Edge Select bit
1-Increment on high-to-low transition on T0CKI pin
0-Increment on low-to-high transition on T0CKI pin
PSA: Prescaler Assignment bit
1-Prescaler is assigned to the WDT
0-Prescaler is assigned to the Timer0
PS2:PS0: Prescaler Rate Select bits
Timer 1
• T1CON: Configure the TIMER1 Prescalar, Clock
Source
• TMRIH: Holds the higher 8-bits of timer value
• TMRIL: Holds the lower 8-bits of timer value
• PIR1: Contains the Timer1 overflow
flag(TMR1IF)
• PIE1: Contains the Timer1 Interrupt Enable
flag(TMR1IE)
T1CON
• T1CKPS1:T1CKPS0:Timer1 Input Clock Prescale Select bits
11 = 1:8 prescale value
10 = 1:4 prescale value
01 = 1:2 prescale value
00 = 1:1 prescale value
• T1OSCEN: Timer1 Oscillator Enable Control bit
1-Oscillator is enabled
0-Oscillator is shut-off
• T1SYNC: Timer1 External Clock Input Synchronization Control bit
1-Do not synchronize external clock input
0-Synchronize external clock input
• TMR1CS: Timer1 Clock Source Select bit
1-External clock from pin RC0/T1OSO/T1CKI (on the rising edge)
0-Internal clock (FOSC/4)
• TMR1ON: Timer1 On bit
1-Enables Timer1
0-Stops Timer1
Timer 2
• T2CON: Configure the TIMER2 Prescalar, Clock
Source
• TMR2: holds the timer count value which will
be incremented depending on prescalar
configuration
• PIR1: contains the Timer2 overflow
flag(TMR2IF)
• PIE1: contains the Timer2 Interrupt Enable
flag(TMR2IE)
T2CON
• TOUTPS3:TOUTPS0: Timer2 Output Postscale Select bits
0000 = 1:1 postscale
0001 = 1:2 postscale
0010 = 1:3 postscale
•
•
•
1111 = 1:16 postscale
• TMR2ON: Timer2 On bit
1-Timer2 is on
0-Timer2 is off
• T2CKPS1:T2CKPS0: Timer2 Clock Prescale Select bits
00 = Prescaler is 1
01 = Prescaler is 4
1x = Prescaler is 16
CCP Module
• 16 bit Capture, Compare and 10 bit PWM
ADC
• 8 input ADC pins
• 10 bit digital number
• Registers
• ADCON0 – ADC Control Register 0
• ADCON1 – ADC Control Register 1
• ADRESH – ADC result High Register
• ADRESL – ADC result Low Register
Serial Communication
• TXSTA: Transmit status and control register
• RCSTA: Receive status and control register
• SPBRG: USART Baud rate generator
• TXREG: USART Transmit register.(transmitted
on UART)
• RCREG: USART Transmit register.(received
from UART)
TXSTA – 8 bits
• CSRC: Clock Source select bit
• TX9: 9-bit transmit enable bit
• TXEN: transmit enable bit (1-enabled; 0-disabled)
• SYNC: USART Mode select bit (1 – Syn; 0 - ASyn)
• BRGH: High Baud rate select bit (1- high speed; 0-low speed)
• TRMT: Transmit shift register status bit
• TX9D: 9th bit transmit data
RCSTA – 8 bits
• SPEN: Serial port enable bit (1-enable; 0-disable)
• RX9: 9 bit Receive Enable Bit
• SREN: Single receive enable bit
• CREN: Continuous receive enable bit
• ADDEN: Address detect enable bit
• FERR: Framing error bit
• OERR: Overrun error bit
• RX9D: 9th bit of received data

More Related Content

What's hot

8051 Microcontroller Timer
8051 Microcontroller Timer8051 Microcontroller Timer
8051 Microcontroller Timer
anishgoel
 
8051 timers
8051 timers8051 timers
8051 Timer
8051 Timer8051 Timer
8051 Timer
Ramasubbu .P
 
Using Timer2 in Microchip MCUs
Using Timer2 in Microchip MCUsUsing Timer2 in Microchip MCUs
Using Timer2 in Microchip MCUs
Corrado Santoro
 
8051 Timers / Counters
8051 Timers / Counters8051 Timers / Counters
8051 Timers / CountersPatricio Lima
 
Timer And Counter in 8051 Microcontroller
Timer And Counter in 8051 MicrocontrollerTimer And Counter in 8051 Microcontroller
Timer And Counter in 8051 Microcontroller
Jay Makwana
 
AVR_Course_Day7 timers counters and interrupt programming
AVR_Course_Day7 timers counters and  interrupt programmingAVR_Course_Day7 timers counters and  interrupt programming
AVR_Course_Day7 timers counters and interrupt programming
Mohamed Ali
 
Chapter 16 timers and counters
Chapter 16 timers and countersChapter 16 timers and counters
Chapter 16 timers and countersforgotteniman
 
Timers
TimersTimers
Timers
afzal pa
 
Timer programming for 8051 using embedded c
Timer programming for 8051 using embedded cTimer programming for 8051 using embedded c
Timer programming for 8051 using embedded c
Vikas Dongre
 
Microprocessor Week 9: Timer and Counter
Microprocessor Week 9: Timer and CounterMicroprocessor Week 9: Timer and Counter
Microprocessor Week 9: Timer and Counter
Arkhom Jodtang
 
Lecture 2 timers, pwm, state machine IN PIC
Lecture 2   timers, pwm, state machine IN PIC Lecture 2   timers, pwm, state machine IN PIC
Lecture 2 timers, pwm, state machine IN PIC
أشرف أمجد الشريف
 
Computer Science Training,IT Training,CS Training,Computer Training Institute,
Computer Science Training,IT Training,CS Training,Computer Training Institute,Computer Science Training,IT Training,CS Training,Computer Training Institute,
Computer Science Training,IT Training,CS Training,Computer Training Institute,
Technogroovy
 
9 timer programming
9 timer programming9 timer programming
9 timer programming
Channabasappa Kudarihal
 
Handling Interrupts in Microchip MCUs
Handling Interrupts in Microchip MCUsHandling Interrupts in Microchip MCUs
Handling Interrupts in Microchip MCUsCorrado Santoro
 
8051 training an interactive tutorial
8051 training an interactive tutorial8051 training an interactive tutorial
8051 training an interactive tutorial
Futura infotech
 

What's hot (20)

8051 ch9
8051 ch98051 ch9
8051 ch9
 
8051 Microcontroller Timer
8051 Microcontroller Timer8051 Microcontroller Timer
8051 Microcontroller Timer
 
8051 timers
8051 timers8051 timers
8051 timers
 
8051 Timer
8051 Timer8051 Timer
8051 Timer
 
Using Timer2 in Microchip MCUs
Using Timer2 in Microchip MCUsUsing Timer2 in Microchip MCUs
Using Timer2 in Microchip MCUs
 
Timers
TimersTimers
Timers
 
8051 Timers / Counters
8051 Timers / Counters8051 Timers / Counters
8051 Timers / Counters
 
Timer And Counter in 8051 Microcontroller
Timer And Counter in 8051 MicrocontrollerTimer And Counter in 8051 Microcontroller
Timer And Counter in 8051 Microcontroller
 
AVR_Course_Day7 timers counters and interrupt programming
AVR_Course_Day7 timers counters and  interrupt programmingAVR_Course_Day7 timers counters and  interrupt programming
AVR_Course_Day7 timers counters and interrupt programming
 
Chapter 16 timers and counters
Chapter 16 timers and countersChapter 16 timers and counters
Chapter 16 timers and counters
 
8051e
8051e8051e
8051e
 
Timers
TimersTimers
Timers
 
Timer programming for 8051 using embedded c
Timer programming for 8051 using embedded cTimer programming for 8051 using embedded c
Timer programming for 8051 using embedded c
 
Microprocessor Week 9: Timer and Counter
Microprocessor Week 9: Timer and CounterMicroprocessor Week 9: Timer and Counter
Microprocessor Week 9: Timer and Counter
 
Lecture 2 timers, pwm, state machine IN PIC
Lecture 2   timers, pwm, state machine IN PIC Lecture 2   timers, pwm, state machine IN PIC
Lecture 2 timers, pwm, state machine IN PIC
 
Avr timers
Avr timersAvr timers
Avr timers
 
Computer Science Training,IT Training,CS Training,Computer Training Institute,
Computer Science Training,IT Training,CS Training,Computer Training Institute,Computer Science Training,IT Training,CS Training,Computer Training Institute,
Computer Science Training,IT Training,CS Training,Computer Training Institute,
 
9 timer programming
9 timer programming9 timer programming
9 timer programming
 
Handling Interrupts in Microchip MCUs
Handling Interrupts in Microchip MCUsHandling Interrupts in Microchip MCUs
Handling Interrupts in Microchip MCUs
 
8051 training an interactive tutorial
8051 training an interactive tutorial8051 training an interactive tutorial
8051 training an interactive tutorial
 

Similar to Timers done by Priyanga KR

AVRTIMER.pptx
AVRTIMER.pptxAVRTIMER.pptx
AVRTIMER.pptx
Pratik Gohel
 
Timer counter in arm7(lpc2148)
Timer counter in arm7(lpc2148)Timer counter in arm7(lpc2148)
Timer counter in arm7(lpc2148)
Aarav Soni
 
timer counter (1).pptx
timer counter (1).pptxtimer counter (1).pptx
timer counter (1).pptx
SujalKumar73
 
Using Timers in PIC18F Microcontrollers
Using Timers in PIC18F MicrocontrollersUsing Timers in PIC18F Microcontrollers
Using Timers in PIC18F MicrocontrollersCorrado Santoro
 
5-Timer Mode 2 Programming-18-03-2024.pptx
5-Timer Mode 2 Programming-18-03-2024.pptx5-Timer Mode 2 Programming-18-03-2024.pptx
5-Timer Mode 2 Programming-18-03-2024.pptx
Rahultater4
 
Microcontrollers-MODULE4.pptx
Microcontrollers-MODULE4.pptxMicrocontrollers-MODULE4.pptx
Microcontrollers-MODULE4.pptx
AmoghR3
 
Programmable Logic Controller | Ladder Logic diagrams| Block diagram | I/O Mo...
Programmable Logic Controller | Ladder Logic diagrams| Block diagram | I/O Mo...Programmable Logic Controller | Ladder Logic diagrams| Block diagram | I/O Mo...
Programmable Logic Controller | Ladder Logic diagrams| Block diagram | I/O Mo...
Waqas Afzal
 
6-Interrupts Programming-27-03-2024.pptx
6-Interrupts Programming-27-03-2024.pptx6-Interrupts Programming-27-03-2024.pptx
6-Interrupts Programming-27-03-2024.pptx
Rahultater4
 
lecture 12 counter_microcontroller2.ppt
lecture 12 counter_microcontroller2.pptlecture 12 counter_microcontroller2.ppt
lecture 12 counter_microcontroller2.ppt
HebaEng
 
moving message display of lcd
 moving message display of lcd moving message display of lcd
moving message display of lcd
abhishek upadhyay
 
Assembly programming II
Assembly programming IIAssembly programming II
Assembly programming II
Omar Sanchez
 
Assembly programming II
Assembly programming IIAssembly programming II
Assembly programming II
Omar Sanchez
 
Assembly programming II
Assembly programming IIAssembly programming II
Assembly programming II
Omar Sanchez
 
Timer 2 concept
Timer 2 conceptTimer 2 concept
Timer 2 concept
v Kalairajan
 
Interrupts for PIC18
Interrupts for PIC18Interrupts for PIC18
Interrupts for PIC18
raosandy11
 
Timing & Control.pptx
Timing & Control.pptxTiming & Control.pptx
Microchip NANOWatt Technology
Microchip NANOWatt TechnologyMicrochip NANOWatt Technology
Microchip NANOWatt Technology
Emanuele Bonanni
 
Timers in Arduino
Timers in ArduinoTimers in Arduino
Timers in Arduino
VEDANSH SHARMA
 

Similar to Timers done by Priyanga KR (20)

UNIT-5.ppt
UNIT-5.pptUNIT-5.ppt
UNIT-5.ppt
 
AVRTIMER.pptx
AVRTIMER.pptxAVRTIMER.pptx
AVRTIMER.pptx
 
Timer counter in arm7(lpc2148)
Timer counter in arm7(lpc2148)Timer counter in arm7(lpc2148)
Timer counter in arm7(lpc2148)
 
timer counter (1).pptx
timer counter (1).pptxtimer counter (1).pptx
timer counter (1).pptx
 
Using Timers in PIC18F Microcontrollers
Using Timers in PIC18F MicrocontrollersUsing Timers in PIC18F Microcontrollers
Using Timers in PIC18F Microcontrollers
 
5-Timer Mode 2 Programming-18-03-2024.pptx
5-Timer Mode 2 Programming-18-03-2024.pptx5-Timer Mode 2 Programming-18-03-2024.pptx
5-Timer Mode 2 Programming-18-03-2024.pptx
 
Microcontrollers-MODULE4.pptx
Microcontrollers-MODULE4.pptxMicrocontrollers-MODULE4.pptx
Microcontrollers-MODULE4.pptx
 
12 mt06ped007
12 mt06ped007 12 mt06ped007
12 mt06ped007
 
Programmable Logic Controller | Ladder Logic diagrams| Block diagram | I/O Mo...
Programmable Logic Controller | Ladder Logic diagrams| Block diagram | I/O Mo...Programmable Logic Controller | Ladder Logic diagrams| Block diagram | I/O Mo...
Programmable Logic Controller | Ladder Logic diagrams| Block diagram | I/O Mo...
 
6-Interrupts Programming-27-03-2024.pptx
6-Interrupts Programming-27-03-2024.pptx6-Interrupts Programming-27-03-2024.pptx
6-Interrupts Programming-27-03-2024.pptx
 
lecture 12 counter_microcontroller2.ppt
lecture 12 counter_microcontroller2.pptlecture 12 counter_microcontroller2.ppt
lecture 12 counter_microcontroller2.ppt
 
moving message display of lcd
 moving message display of lcd moving message display of lcd
moving message display of lcd
 
Assembly programming II
Assembly programming IIAssembly programming II
Assembly programming II
 
Assembly programming II
Assembly programming IIAssembly programming II
Assembly programming II
 
Assembly programming II
Assembly programming IIAssembly programming II
Assembly programming II
 
Timer 2 concept
Timer 2 conceptTimer 2 concept
Timer 2 concept
 
Interrupts for PIC18
Interrupts for PIC18Interrupts for PIC18
Interrupts for PIC18
 
Timing & Control.pptx
Timing & Control.pptxTiming & Control.pptx
Timing & Control.pptx
 
Microchip NANOWatt Technology
Microchip NANOWatt TechnologyMicrochip NANOWatt Technology
Microchip NANOWatt Technology
 
Timers in Arduino
Timers in ArduinoTimers in Arduino
Timers in Arduino
 

More from PriyangaKR1

Lpc 17xx adc
Lpc 17xx adcLpc 17xx adc
Lpc 17xx adc
PriyangaKR1
 
Lpc 1768 timers
Lpc 1768 timersLpc 1768 timers
Lpc 1768 timers
PriyangaKR1
 
CCTV
CCTVCCTV
Washing machine
Washing machineWashing machine
Washing machine
PriyangaKR1
 
Rice cooker
Rice cookerRice cooker
Rice cooker
PriyangaKR1
 
Refrigerators
RefrigeratorsRefrigerators
Refrigerators
PriyangaKR1
 
Air conditioners
Air conditionersAir conditioners
Air conditioners
PriyangaKR1
 
Microwave oven
Microwave ovenMicrowave oven
Microwave oven
PriyangaKR1
 
Ups and burglar alarm
Ups and burglar alarmUps and burglar alarm
Ups and burglar alarm
PriyangaKR1
 
Supervisor call and pendable service call
Supervisor call and pendable service callSupervisor call and pendable service call
Supervisor call and pendable service call
PriyangaKR1
 
Arm Development Tools
Arm Development ToolsArm Development Tools
Arm Development Tools
PriyangaKR1
 
Arm instruction set
Arm instruction setArm instruction set
Arm instruction set
PriyangaKR1
 
Multimedia compression networks
Multimedia compression networksMultimedia compression networks
Multimedia compression networks
PriyangaKR1
 
Trends and satellite
Trends and satelliteTrends and satellite
Trends and satellite
PriyangaKR1
 
Mobile around the world and wireless communication examples
Mobile around the world and wireless communication examplesMobile around the world and wireless communication examples
Mobile around the world and wireless communication examples
PriyangaKR1
 
Mobile communication - Introduction
Mobile communication - IntroductionMobile communication - Introduction
Mobile communication - Introduction
PriyangaKR1
 
Root locus tech
Root locus techRoot locus tech
Root locus tech
PriyangaKR1
 
Real time operating systems
Real time operating systemsReal time operating systems
Real time operating systems
PriyangaKR1
 
Instruction sets picc done by Priyanga KR
Instruction sets   picc done by Priyanga KRInstruction sets   picc done by Priyanga KR
Instruction sets picc done by Priyanga KR
PriyangaKR1
 
Pic architecture done by Priyanga KR
Pic architecture done by Priyanga KRPic architecture done by Priyanga KR
Pic architecture done by Priyanga KR
PriyangaKR1
 

More from PriyangaKR1 (20)

Lpc 17xx adc
Lpc 17xx adcLpc 17xx adc
Lpc 17xx adc
 
Lpc 1768 timers
Lpc 1768 timersLpc 1768 timers
Lpc 1768 timers
 
CCTV
CCTVCCTV
CCTV
 
Washing machine
Washing machineWashing machine
Washing machine
 
Rice cooker
Rice cookerRice cooker
Rice cooker
 
Refrigerators
RefrigeratorsRefrigerators
Refrigerators
 
Air conditioners
Air conditionersAir conditioners
Air conditioners
 
Microwave oven
Microwave ovenMicrowave oven
Microwave oven
 
Ups and burglar alarm
Ups and burglar alarmUps and burglar alarm
Ups and burglar alarm
 
Supervisor call and pendable service call
Supervisor call and pendable service callSupervisor call and pendable service call
Supervisor call and pendable service call
 
Arm Development Tools
Arm Development ToolsArm Development Tools
Arm Development Tools
 
Arm instruction set
Arm instruction setArm instruction set
Arm instruction set
 
Multimedia compression networks
Multimedia compression networksMultimedia compression networks
Multimedia compression networks
 
Trends and satellite
Trends and satelliteTrends and satellite
Trends and satellite
 
Mobile around the world and wireless communication examples
Mobile around the world and wireless communication examplesMobile around the world and wireless communication examples
Mobile around the world and wireless communication examples
 
Mobile communication - Introduction
Mobile communication - IntroductionMobile communication - Introduction
Mobile communication - Introduction
 
Root locus tech
Root locus techRoot locus tech
Root locus tech
 
Real time operating systems
Real time operating systemsReal time operating systems
Real time operating systems
 
Instruction sets picc done by Priyanga KR
Instruction sets   picc done by Priyanga KRInstruction sets   picc done by Priyanga KR
Instruction sets picc done by Priyanga KR
 
Pic architecture done by Priyanga KR
Pic architecture done by Priyanga KRPic architecture done by Priyanga KR
Pic architecture done by Priyanga KR
 

Recently uploaded

Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
zwunae
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
WENKENLI1
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Dr.Costas Sachpazis
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
R&R Consult
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
ydteq
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
BrazilAccount1
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
gerogepatton
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
FluxPrime1
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
SupreethSP4
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
karthi keyan
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
seandesed
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
ViniHema
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
Vijay Dialani, PhD
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 

Recently uploaded (20)

Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 

Timers done by Priyanga KR

  • 1. Timers, CCP Module, ADC and Serial Communication Done by, Ms.K.R.Priyanga Assistant Professor, Department of ECE, Avinashilingam Institute
  • 2. • To measure the time or generate the accurate time delay • To count clock pulses(Internal/External) TIMERS
  • 3. Different Timers • PIC Timer 0 • PIC Timer 1 • PIC Timer 2 Timer Size Control Register Count Register Min Delay Max Delay TIMER0 8-bit OPTION_RE G TMR0 0.2usec 13.107ms TIMER1 16-bit T1CON TMR1H,TMR 1L 0.2usec 104.857ms TIMER2 8-bit T2CON TMR2 0.2usec 819usec
  • 4. Timer 0 • OPTION_REG - configure the TIMER0 Prescalar, Clock Source • TMR0 - holds the timer count value which will be incremented depending on prescalar configuration • INTCON - contains the Timer0 overflow flag(TMR0IF) and corresponding Inetrrupt Enable flag(TMR0IE).
  • 5. Option_ Register RBPU: PORT B Pull up enable Bit 1 - Disabled 0 - connected to pull-resistors INTEDG: Interrupt Edge Select Bit 1 – Interrupt on rising edge of the INT pin (0-1) 0 - Interrupt on falling edge of the INT pin (1-0) T0CS: TMR0 Clock Source Select bit 1-Transition on T0CKI pin 0-Internal instruction cycle clock (CLKO) T0SE: TMR0 Source Edge Select bit 1-Increment on high-to-low transition on T0CKI pin 0-Increment on low-to-high transition on T0CKI pin PSA: Prescaler Assignment bit 1-Prescaler is assigned to the WDT 0-Prescaler is assigned to the Timer0 PS2:PS0: Prescaler Rate Select bits
  • 6.
  • 7. Timer 1 • T1CON: Configure the TIMER1 Prescalar, Clock Source • TMRIH: Holds the higher 8-bits of timer value • TMRIL: Holds the lower 8-bits of timer value • PIR1: Contains the Timer1 overflow flag(TMR1IF) • PIE1: Contains the Timer1 Interrupt Enable flag(TMR1IE)
  • 8. T1CON • T1CKPS1:T1CKPS0:Timer1 Input Clock Prescale Select bits 11 = 1:8 prescale value 10 = 1:4 prescale value 01 = 1:2 prescale value 00 = 1:1 prescale value • T1OSCEN: Timer1 Oscillator Enable Control bit 1-Oscillator is enabled 0-Oscillator is shut-off • T1SYNC: Timer1 External Clock Input Synchronization Control bit 1-Do not synchronize external clock input 0-Synchronize external clock input • TMR1CS: Timer1 Clock Source Select bit 1-External clock from pin RC0/T1OSO/T1CKI (on the rising edge) 0-Internal clock (FOSC/4) • TMR1ON: Timer1 On bit 1-Enables Timer1 0-Stops Timer1
  • 9. Timer 2 • T2CON: Configure the TIMER2 Prescalar, Clock Source • TMR2: holds the timer count value which will be incremented depending on prescalar configuration • PIR1: contains the Timer2 overflow flag(TMR2IF) • PIE1: contains the Timer2 Interrupt Enable flag(TMR2IE)
  • 10. T2CON • TOUTPS3:TOUTPS0: Timer2 Output Postscale Select bits 0000 = 1:1 postscale 0001 = 1:2 postscale 0010 = 1:3 postscale • • • 1111 = 1:16 postscale • TMR2ON: Timer2 On bit 1-Timer2 is on 0-Timer2 is off • T2CKPS1:T2CKPS0: Timer2 Clock Prescale Select bits 00 = Prescaler is 1 01 = Prescaler is 4 1x = Prescaler is 16
  • 11. CCP Module • 16 bit Capture, Compare and 10 bit PWM
  • 12. ADC • 8 input ADC pins • 10 bit digital number • Registers • ADCON0 – ADC Control Register 0 • ADCON1 – ADC Control Register 1 • ADRESH – ADC result High Register • ADRESL – ADC result Low Register
  • 13. Serial Communication • TXSTA: Transmit status and control register • RCSTA: Receive status and control register • SPBRG: USART Baud rate generator • TXREG: USART Transmit register.(transmitted on UART) • RCREG: USART Transmit register.(received from UART)
  • 14. TXSTA – 8 bits • CSRC: Clock Source select bit • TX9: 9-bit transmit enable bit • TXEN: transmit enable bit (1-enabled; 0-disabled) • SYNC: USART Mode select bit (1 – Syn; 0 - ASyn) • BRGH: High Baud rate select bit (1- high speed; 0-low speed) • TRMT: Transmit shift register status bit • TX9D: 9th bit transmit data
  • 15. RCSTA – 8 bits • SPEN: Serial port enable bit (1-enable; 0-disable) • RX9: 9 bit Receive Enable Bit • SREN: Single receive enable bit • CREN: Continuous receive enable bit • ADDEN: Address detect enable bit • FERR: Framing error bit • OERR: Overrun error bit • RX9D: 9th bit of received data