SlideShare a Scribd company logo
Code:
#include "LPC1768_Includes.h"
#define PRESCALE 12000 //12000 PCLK clock cycles to increment TC by 1
void initTimer0(void);
void DelayMs(unsigned int Ms)
{
T0TCR = 0x02; //Reset TImer
T0TCR = 0x01; //Enable Timer
while(T0TC<Ms); // wait until timer counter reaches the desired delay
T0TCR =0x00; //Disable timer
}
void main()
{
PINSEL4=0x00;
//initClocks(); //Initalize CPU & Peripheral Clocks @12MHz
//VPBDIV = 0x01; //Initalize CPU & Peripheral Clocks @12MHz
initTimer0(); //Initalize Timer0
FIO2DIR=0x000000FF;
while(1)
{
FIO2SET=0x000000FF;
DelayMs(500); //0.5 secs delay
FIO2CLR=0x000000FF;
DelayMs(500);
}
}
void initTimer0(void)
{
T0CTCR = 0x0;
T0PR =PRESCALE-1; //value in Decimal - Increment T0TC at every 12000 clock cycles
//Count begins from 0 hence subtracting 1. 12000 clock cycles @12MHz = 1 ms
T0TCR = 0x02; //Reset Timer
}
Adding timer register address to header file:
Output:

More Related Content

What's hot

Introduction to pic microcontroller
Introduction to pic microcontrollerIntroduction to pic microcontroller
Introduction to pic microcontroller
RAMPRAKASHT1
 
Embedded C - Lecture 1
Embedded C - Lecture 1Embedded C - Lecture 1
Embedded C - Lecture 1
Mohamed Abdallah
 
8051 Microcontroller Timer
8051 Microcontroller Timer8051 Microcontroller Timer
8051 Microcontroller Timer
anishgoel
 
PWM based motor speed control using LPC 1768
PWM based motor speed control using LPC 1768PWM based motor speed control using LPC 1768
PWM based motor speed control using LPC 1768
Omkar Rane
 
8051 assembly programming
8051 assembly programming8051 assembly programming
8051 assembly programming
sergeiseq
 
Programming 8051 Timers
Programming 8051 Timers Programming 8051 Timers
Programming 8051 Timers ViVek Patel
 
UART(universal asynchronous receiver transmitter ) PPT
UART(universal asynchronous receiver transmitter ) PPTUART(universal asynchronous receiver transmitter ) PPT
UART(universal asynchronous receiver transmitter ) PPT
Sai_praneeth
 
Using Timers in PIC18F Microcontrollers
Using Timers in PIC18F MicrocontrollersUsing Timers in PIC18F Microcontrollers
Using Timers in PIC18F MicrocontrollersCorrado Santoro
 
EE6602 Embedded System
EE6602 Embedded SystemEE6602 Embedded System
EE6602 Embedded System
rmkceteee
 
Timer & Interrupt Atmega16
Timer & Interrupt Atmega16Timer & Interrupt Atmega16
Timer & Interrupt Atmega16
Ramadan Ramadan
 
Micro controller 8051 Interrupts
Micro controller 8051 InterruptsMicro controller 8051 Interrupts
Micro controller 8051 Interrupts
dharmesh nakum
 
Arm architecture chapter2_steve_furber
Arm architecture chapter2_steve_furberArm architecture chapter2_steve_furber
Arm architecture chapter2_steve_furber
asodariyabhavesh
 
Embedded Systems : introduction
Embedded Systems : introductionEmbedded Systems : introduction
Embedded Systems : introduction
Anant Shrivastava
 
CAN interfacing on LPC1768 (ARM Cortex M3 based Micro controller)
CAN interfacing on LPC1768 (ARM Cortex M3 based Micro controller)CAN interfacing on LPC1768 (ARM Cortex M3 based Micro controller)
CAN interfacing on LPC1768 (ARM Cortex M3 based Micro controller)
Omkar Rane
 
PIC timer programming
PIC timer programmingPIC timer programming
PIC timer programming
Akash Puri
 
Vxworks
VxworksVxworks
Plc and scada theory ppt
Plc and scada theory pptPlc and scada theory ppt
Plc and scada theory ppt
Priya Hada
 
Programming ARM Cortex-M4 STM32 Nucleo
Programming ARM Cortex-M4  STM32 NucleoProgramming ARM Cortex-M4  STM32 Nucleo
Programming ARM Cortex-M4 STM32 Nucleo
Sanjay Adhikari
 

What's hot (20)

Introduction to pic microcontroller
Introduction to pic microcontrollerIntroduction to pic microcontroller
Introduction to pic microcontroller
 
Embedded C - Lecture 1
Embedded C - Lecture 1Embedded C - Lecture 1
Embedded C - Lecture 1
 
8051 Microcontroller Timer
8051 Microcontroller Timer8051 Microcontroller Timer
8051 Microcontroller Timer
 
E.s unit 4 and 5
E.s unit 4 and 5E.s unit 4 and 5
E.s unit 4 and 5
 
PWM based motor speed control using LPC 1768
PWM based motor speed control using LPC 1768PWM based motor speed control using LPC 1768
PWM based motor speed control using LPC 1768
 
8051 assembly programming
8051 assembly programming8051 assembly programming
8051 assembly programming
 
Programming 8051 Timers
Programming 8051 Timers Programming 8051 Timers
Programming 8051 Timers
 
UART(universal asynchronous receiver transmitter ) PPT
UART(universal asynchronous receiver transmitter ) PPTUART(universal asynchronous receiver transmitter ) PPT
UART(universal asynchronous receiver transmitter ) PPT
 
Using Timers in PIC18F Microcontrollers
Using Timers in PIC18F MicrocontrollersUsing Timers in PIC18F Microcontrollers
Using Timers in PIC18F Microcontrollers
 
EE6602 Embedded System
EE6602 Embedded SystemEE6602 Embedded System
EE6602 Embedded System
 
Timer & Interrupt Atmega16
Timer & Interrupt Atmega16Timer & Interrupt Atmega16
Timer & Interrupt Atmega16
 
Micro controller 8051 Interrupts
Micro controller 8051 InterruptsMicro controller 8051 Interrupts
Micro controller 8051 Interrupts
 
Arm architecture chapter2_steve_furber
Arm architecture chapter2_steve_furberArm architecture chapter2_steve_furber
Arm architecture chapter2_steve_furber
 
Embedded Systems : introduction
Embedded Systems : introductionEmbedded Systems : introduction
Embedded Systems : introduction
 
CAN interfacing on LPC1768 (ARM Cortex M3 based Micro controller)
CAN interfacing on LPC1768 (ARM Cortex M3 based Micro controller)CAN interfacing on LPC1768 (ARM Cortex M3 based Micro controller)
CAN interfacing on LPC1768 (ARM Cortex M3 based Micro controller)
 
PIC timer programming
PIC timer programmingPIC timer programming
PIC timer programming
 
I/O Ports
I/O Ports I/O Ports
I/O Ports
 
Vxworks
VxworksVxworks
Vxworks
 
Plc and scada theory ppt
Plc and scada theory pptPlc and scada theory ppt
Plc and scada theory ppt
 
Programming ARM Cortex-M4 STM32 Nucleo
Programming ARM Cortex-M4  STM32 NucleoProgramming ARM Cortex-M4  STM32 Nucleo
Programming ARM Cortex-M4 STM32 Nucleo
 

Similar to Timer 0 programming on LPC 1768

please show elegoo arduino board setup using a passive buzzer- heres t.pdf
please show elegoo arduino board setup using a passive buzzer- heres t.pdfplease show elegoo arduino board setup using a passive buzzer- heres t.pdf
please show elegoo arduino board setup using a passive buzzer- heres t.pdf
admin463580
 
AVRTIMER.pptx
AVRTIMER.pptxAVRTIMER.pptx
AVRTIMER.pptx
Pratik Gohel
 
伺服馬達控制
伺服馬達控制伺服馬達控制
伺服馬達控制
艾鍗科技
 
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
 
Exercises with timers and UART
Exercises with timers and UARTExercises with timers and UART
Exercises with timers and UARTCorrado Santoro
 
8051 Timers and Counters
8051 Timers and Counters8051 Timers and Counters
8051 Timers and Counters
cjbas
 
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
 
8051 ch9-950217
8051 ch9-9502178051 ch9-950217
8051 ch9-950217
Gopal Krishna Murthy C R
 
Teste
TesteTeste
PWM wave generator using microcontroller
 PWM wave generator using microcontroller  PWM wave generator using microcontroller
PWM wave generator using microcontroller Swapnil2515
 
timers.pdf
timers.pdftimers.pdf
timers.pdf
ssusere1f79a
 
SE PAI Unit 5_Timer Programming in 8051 microcontroller_Part 2
SE PAI Unit 5_Timer Programming in 8051 microcontroller_Part 2SE PAI Unit 5_Timer Programming in 8051 microcontroller_Part 2
SE PAI Unit 5_Timer Programming in 8051 microcontroller_Part 2
KanchanPatil34
 
timer counter (1).pptx
timer counter (1).pptxtimer counter (1).pptx
timer counter (1).pptx
SujalKumar73
 
Timers done by Priyanga KR
Timers done by Priyanga KRTimers done by Priyanga KR
Timers done by Priyanga KR
PriyangaKR1
 
9 timer programming
9 timer programming9 timer programming
9 timer programming
Channabasappa Kudarihal
 

Similar to Timer 0 programming on LPC 1768 (20)

please show elegoo arduino board setup using a passive buzzer- heres t.pdf
please show elegoo arduino board setup using a passive buzzer- heres t.pdfplease show elegoo arduino board setup using a passive buzzer- heres t.pdf
please show elegoo arduino board setup using a passive buzzer- heres t.pdf
 
12 mt06ped007
12 mt06ped007 12 mt06ped007
12 mt06ped007
 
AVRTIMER.pptx
AVRTIMER.pptxAVRTIMER.pptx
AVRTIMER.pptx
 
伺服馬達控制
伺服馬達控制伺服馬達控制
伺服馬達控制
 
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
 
Exercises with timers and UART
Exercises with timers and UARTExercises with timers and UART
Exercises with timers and UART
 
8051 Timers and Counters
8051 Timers and Counters8051 Timers and Counters
8051 Timers and Counters
 
Uc
UcUc
Uc
 
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
 
8051 ch9-950217
8051 ch9-9502178051 ch9-950217
8051 ch9-950217
 
Teste
TesteTeste
Teste
 
8051 ch9
8051 ch98051 ch9
8051 ch9
 
Pwm wave
Pwm wave Pwm wave
Pwm wave
 
PWM wave generator using microcontroller
 PWM wave generator using microcontroller  PWM wave generator using microcontroller
PWM wave generator using microcontroller
 
timers.pdf
timers.pdftimers.pdf
timers.pdf
 
SE PAI Unit 5_Timer Programming in 8051 microcontroller_Part 2
SE PAI Unit 5_Timer Programming in 8051 microcontroller_Part 2SE PAI Unit 5_Timer Programming in 8051 microcontroller_Part 2
SE PAI Unit 5_Timer Programming in 8051 microcontroller_Part 2
 
timer counter (1).pptx
timer counter (1).pptxtimer counter (1).pptx
timer counter (1).pptx
 
Timers done by Priyanga KR
Timers done by Priyanga KRTimers done by Priyanga KR
Timers done by Priyanga KR
 
UNIT-5.ppt
UNIT-5.pptUNIT-5.ppt
UNIT-5.ppt
 
9 timer programming
9 timer programming9 timer programming
9 timer programming
 

More from Omkar Rane

Enabling SSL Elasticsearch on server
Enabling SSL Elasticsearch on serverEnabling SSL Elasticsearch on server
Enabling SSL Elasticsearch on server
Omkar Rane
 
Anti lock braking (ABS) Model based Design in MATLAB-Simulink
Anti lock braking (ABS) Model based Design in MATLAB-SimulinkAnti lock braking (ABS) Model based Design in MATLAB-Simulink
Anti lock braking (ABS) Model based Design in MATLAB-Simulink
Omkar Rane
 
Autosar fundamental
Autosar fundamentalAutosar fundamental
Autosar fundamental
Omkar Rane
 
Stress Management
Stress ManagementStress Management
Stress Management
Omkar Rane
 
Bootloaders (U-Boot)
Bootloaders (U-Boot) Bootloaders (U-Boot)
Bootloaders (U-Boot)
Omkar Rane
 
Concept of Diversity & Fading (wireless communication)
Concept of Diversity & Fading (wireless communication)Concept of Diversity & Fading (wireless communication)
Concept of Diversity & Fading (wireless communication)
Omkar Rane
 
Tata Motors GDC .LTD Internship
Tata Motors GDC .LTD Internship Tata Motors GDC .LTD Internship
Tata Motors GDC .LTD Internship
Omkar Rane
 
Machine Learning Model for M.S admissions
Machine Learning Model for M.S admissionsMachine Learning Model for M.S admissions
Machine Learning Model for M.S admissions
Omkar Rane
 
ADC (Analog to Digital conversion) using LPC 1768
ADC (Analog to Digital conversion) using LPC 1768ADC (Analog to Digital conversion) using LPC 1768
ADC (Analog to Digital conversion) using LPC 1768
Omkar Rane
 
UART interfacing on LPC1768 (Cortex M3 micro controller)
UART interfacing on LPC1768 (Cortex M3 micro controller)UART interfacing on LPC1768 (Cortex M3 micro controller)
UART interfacing on LPC1768 (Cortex M3 micro controller)
Omkar Rane
 
LED Blinking logic on LPC1768
LED Blinking logic on LPC1768LED Blinking logic on LPC1768
LED Blinking logic on LPC1768
Omkar Rane
 
Vlisi Course project presentation:Keypad Scanner
Vlisi Course project presentation:Keypad ScannerVlisi Course project presentation:Keypad Scanner
Vlisi Course project presentation:Keypad Scanner
Omkar Rane
 
VlSI course project report : Keypad Scanner
VlSI course project report : Keypad Scanner VlSI course project report : Keypad Scanner
VlSI course project report : Keypad Scanner
Omkar Rane
 
Nexys4ddr rm FPGA board Datasheet
Nexys4ddr rm  FPGA board DatasheetNexys4ddr rm  FPGA board Datasheet
Nexys4ddr rm FPGA board Datasheet
Omkar Rane
 
Linear Regression (Machine Learning)
Linear Regression (Machine Learning)Linear Regression (Machine Learning)
Linear Regression (Machine Learning)
Omkar Rane
 
transmission gate based design for 2:1 Multiplexer in micro-wind
transmission gate based design for 2:1 Multiplexer in micro-windtransmission gate based design for 2:1 Multiplexer in micro-wind
transmission gate based design for 2:1 Multiplexer in micro-wind
Omkar Rane
 
2:1 Multiplexer using NAND gate in Microwind
2:1 Multiplexer using NAND gate in Microwind 2:1 Multiplexer using NAND gate in Microwind
2:1 Multiplexer using NAND gate in Microwind
Omkar Rane
 
NAND Gate design in microwind
NAND Gate design in microwindNAND Gate design in microwind
NAND Gate design in microwind
Omkar Rane
 
Verilog full adder in dataflow & gate level modelling style.
Verilog full adder in dataflow  & gate level modelling style.Verilog full adder in dataflow  & gate level modelling style.
Verilog full adder in dataflow & gate level modelling style.
Omkar Rane
 
Sequence detector for "111"
Sequence detector for "111"Sequence detector for "111"
Sequence detector for "111"
Omkar Rane
 

More from Omkar Rane (20)

Enabling SSL Elasticsearch on server
Enabling SSL Elasticsearch on serverEnabling SSL Elasticsearch on server
Enabling SSL Elasticsearch on server
 
Anti lock braking (ABS) Model based Design in MATLAB-Simulink
Anti lock braking (ABS) Model based Design in MATLAB-SimulinkAnti lock braking (ABS) Model based Design in MATLAB-Simulink
Anti lock braking (ABS) Model based Design in MATLAB-Simulink
 
Autosar fundamental
Autosar fundamentalAutosar fundamental
Autosar fundamental
 
Stress Management
Stress ManagementStress Management
Stress Management
 
Bootloaders (U-Boot)
Bootloaders (U-Boot) Bootloaders (U-Boot)
Bootloaders (U-Boot)
 
Concept of Diversity & Fading (wireless communication)
Concept of Diversity & Fading (wireless communication)Concept of Diversity & Fading (wireless communication)
Concept of Diversity & Fading (wireless communication)
 
Tata Motors GDC .LTD Internship
Tata Motors GDC .LTD Internship Tata Motors GDC .LTD Internship
Tata Motors GDC .LTD Internship
 
Machine Learning Model for M.S admissions
Machine Learning Model for M.S admissionsMachine Learning Model for M.S admissions
Machine Learning Model for M.S admissions
 
ADC (Analog to Digital conversion) using LPC 1768
ADC (Analog to Digital conversion) using LPC 1768ADC (Analog to Digital conversion) using LPC 1768
ADC (Analog to Digital conversion) using LPC 1768
 
UART interfacing on LPC1768 (Cortex M3 micro controller)
UART interfacing on LPC1768 (Cortex M3 micro controller)UART interfacing on LPC1768 (Cortex M3 micro controller)
UART interfacing on LPC1768 (Cortex M3 micro controller)
 
LED Blinking logic on LPC1768
LED Blinking logic on LPC1768LED Blinking logic on LPC1768
LED Blinking logic on LPC1768
 
Vlisi Course project presentation:Keypad Scanner
Vlisi Course project presentation:Keypad ScannerVlisi Course project presentation:Keypad Scanner
Vlisi Course project presentation:Keypad Scanner
 
VlSI course project report : Keypad Scanner
VlSI course project report : Keypad Scanner VlSI course project report : Keypad Scanner
VlSI course project report : Keypad Scanner
 
Nexys4ddr rm FPGA board Datasheet
Nexys4ddr rm  FPGA board DatasheetNexys4ddr rm  FPGA board Datasheet
Nexys4ddr rm FPGA board Datasheet
 
Linear Regression (Machine Learning)
Linear Regression (Machine Learning)Linear Regression (Machine Learning)
Linear Regression (Machine Learning)
 
transmission gate based design for 2:1 Multiplexer in micro-wind
transmission gate based design for 2:1 Multiplexer in micro-windtransmission gate based design for 2:1 Multiplexer in micro-wind
transmission gate based design for 2:1 Multiplexer in micro-wind
 
2:1 Multiplexer using NAND gate in Microwind
2:1 Multiplexer using NAND gate in Microwind 2:1 Multiplexer using NAND gate in Microwind
2:1 Multiplexer using NAND gate in Microwind
 
NAND Gate design in microwind
NAND Gate design in microwindNAND Gate design in microwind
NAND Gate design in microwind
 
Verilog full adder in dataflow & gate level modelling style.
Verilog full adder in dataflow  & gate level modelling style.Verilog full adder in dataflow  & gate level modelling style.
Verilog full adder in dataflow & gate level modelling style.
 
Sequence detector for "111"
Sequence detector for "111"Sequence detector for "111"
Sequence detector for "111"
 

Recently uploaded

Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
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
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
karthi keyan
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
Jayaprasanna4
 
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
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
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
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
MdTanvirMahtab2
 
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
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
AhmedHussein950959
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
Osamah Alsalih
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
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
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
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
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
Pratik Pawar
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
Divya Somashekar
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
TeeVichai
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 

Recently uploaded (20)

Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
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
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
 
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
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
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
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
 
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
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.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...
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
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
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 

Timer 0 programming on LPC 1768

  • 1. Code: #include "LPC1768_Includes.h" #define PRESCALE 12000 //12000 PCLK clock cycles to increment TC by 1 void initTimer0(void); void DelayMs(unsigned int Ms) { T0TCR = 0x02; //Reset TImer T0TCR = 0x01; //Enable Timer while(T0TC<Ms); // wait until timer counter reaches the desired delay T0TCR =0x00; //Disable timer } void main() { PINSEL4=0x00; //initClocks(); //Initalize CPU & Peripheral Clocks @12MHz //VPBDIV = 0x01; //Initalize CPU & Peripheral Clocks @12MHz initTimer0(); //Initalize Timer0 FIO2DIR=0x000000FF; while(1) { FIO2SET=0x000000FF; DelayMs(500); //0.5 secs delay FIO2CLR=0x000000FF; DelayMs(500); } } void initTimer0(void) { T0CTCR = 0x0; T0PR =PRESCALE-1; //value in Decimal - Increment T0TC at every 12000 clock cycles //Count begins from 0 hence subtracting 1. 12000 clock cycles @12MHz = 1 ms
  • 2. T0TCR = 0x02; //Reset Timer } Adding timer register address to header file: Output: