SlideShare a Scribd company logo
1 of 9
Download to read offline
09-EE-88 Page 1
MICROCONTROLLER
( PIC 18F458)
Microcontroller
A microcontroller is a small computer on a single integrated
circuit containing a processor core, memory, and programmable input/output
Peripherals.
In lab we are working on 18F458,it has 5 ports,
PORTS: group of pins
PORT A : having 7 pins
PORT B,PORT C,PORT D :8 PINS
PORT E: having 3 pins
PORTX : To store data ,port register is used
TRISX:Tri-state
0 is used for output
1 is used for input
09-EE-88 Page 2
Simple Binary Counter
Code:
void main()
{unsigned char c=0 ;
trisB=0x00; //make port B as output
PORTB=c;
while(1) //Infinite loop like for (;;)
{PORTB=c ;
c++ ;
delay_ms(500);}} //time delay in miliseconds}}
Proteus simulation
09-EE-88 Page 3
TIMERS
There are Four timers in 18F458.
8 bit Timer : a timer in which maximum value that can be implemented is 256
16 bit Timer: a timer in which maximum value that can be implemented is 65536
The clock source can be internal or external.if we use internal clock source ,then 1/4th
Of the freq of the crystal oscillator on the OSC1 And OSC2 pins .therefore it is used
For time delay generation ,so they are called timersBy choosing external clock option ,we feed
pulse through any pin of uC. This is called Counter.
First we will discuss about timers
09-EE-88 Page 4
EXAMPLE:
void tmo_delay();
void main()
{trisB=0x00; //make portB as output
portB=0x00; // all pins of port B are given value =0
while(1) //infinite loop
{
portB=0xff; // all pins of port B are given value =1
tmo_delay(); //function call
portB=0x00; // all pins of port B are given value =0
tmo_delay(); // function call
}}
void tmo_delay()
{
T0CON=0X08;
TMR0H=0X00;
TMR0L=0X00;
T0CON.TMR0ON=1 ;
T0CON.TMR0IF=0 ;
while(intcon.tmr0if==0) ;
t0con.tmr0on=0 ;
intcon.tmr0if=0 ;
}
09-EE-88 Page 5
Proteus simulation
******************
09-EE-88 Page 6
Timers as Counters
Timers can also be used as counters to count events happening outside
pic18F458.in counter mode the registers such as T0CON , TMR0H,TMR0L are the
same as for the timers discussed.
EXAMPLE:
void cnt_0( ) ;
void main( )
{
trisa.f4=1;
trisb.f0=0;
trisd=0x00;
porta.f4=0;
portb.f0=0;
portd=0x00;
while(1)
{
cnt_0 ( );
} }
Unsigned char cnt=0;
Unsigned char c=0
void cnt_0( )
{tmr0l=0x00;
t0con=0x68;
intcon.tmr0if=0 ;
09-EE-88 Page 7
intcon.tmr0on=1;
while(intcon.tmr0if==0)
{
portd=tmr0l;
cnt=tmr0l/10;
portb.f0=c ;
if (cnt==1 && cnt1==0)
c=1;
else
c=0;}
t0con.tmr0on=0
intcon.tmr0if=0;}}
Proteus simulation
09-EE-88 Page 8
INTERRUPTS
int cnt=0;
void interrupt()
{
if(intcon.int0if==1)
{
cnt++;
intcon.int0if=0;
}}
void main()
{
trisb.f0=1;
trisd=0x00;portd=0x00;
intcon=0x90;
while(1)
{portd=cnt;}}
09-EE-88 Page 9
Proteus simulation
************

More Related Content

What's hot

(381877808) 102054282 5-listing-program
(381877808) 102054282 5-listing-program(381877808) 102054282 5-listing-program
(381877808) 102054282 5-listing-programDimz I
 
4th sem hons
4th sem hons4th sem hons
4th sem honsavi9432
 
Two digit-countdown-timer
Two digit-countdown-timerTwo digit-countdown-timer
Two digit-countdown-timerHEATLBJ
 
Untitled 1
Untitled 1Untitled 1
Untitled 1lakachew
 
22 microcontroller programs
22 microcontroller programs22 microcontroller programs
22 microcontroller programsbabak danyal
 
Microcontroller avr
Microcontroller avrMicrocontroller avr
Microcontroller avrMahmoud Amr
 
Interfacing two wire adc0831 to raspberry pi2 / Pi3
Interfacing two wire adc0831 to raspberry pi2 / Pi3Interfacing two wire adc0831 to raspberry pi2 / Pi3
Interfacing two wire adc0831 to raspberry pi2 / Pi3Dnyanesh Patil
 
IoT Gateway實現專題
IoT Gateway實現專題IoT Gateway實現專題
IoT Gateway實現專題艾鍗科技
 
LED Blinking logic on LPC1768
LED Blinking logic on LPC1768LED Blinking logic on LPC1768
LED Blinking logic on LPC1768Omkar Rane
 
Ir remote kit_blink.pde
Ir remote kit_blink.pdeIr remote kit_blink.pde
Ir remote kit_blink.pdeCore Pale
 
Tensorflow lite for microcontroller
Tensorflow lite for microcontrollerTensorflow lite for microcontroller
Tensorflow lite for microcontrollerRouyun Pan
 
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 1768Omkar Rane
 
TinyML - 4 speech recognition
TinyML - 4 speech recognition TinyML - 4 speech recognition
TinyML - 4 speech recognition 艾鍗科技
 
Raspberry Pi I/O控制與感測器讀取
Raspberry Pi I/O控制與感測器讀取Raspberry Pi I/O控制與感測器讀取
Raspberry Pi I/O控制與感測器讀取艾鍗科技
 
Temperature Sensor with LED matrix Display BY ►iRFAN QADOOS◄ 9
Temperature Sensor with LED matrix Display BY ►iRFAN QADOOS◄ 9Temperature Sensor with LED matrix Display BY ►iRFAN QADOOS◄ 9
Temperature Sensor with LED matrix Display BY ►iRFAN QADOOS◄ 9Irfan Qadoos
 
EMBEDDED SYSTEMS 5
EMBEDDED SYSTEMS 5EMBEDDED SYSTEMS 5
EMBEDDED SYSTEMS 5PRADEEP
 
Devirtualizing FinSpy
Devirtualizing FinSpyDevirtualizing FinSpy
Devirtualizing FinSpyjduart
 
Temperature sensor with a led matrix display (arduino controlled)
Temperature sensor with a led matrix display (arduino controlled)Temperature sensor with a led matrix display (arduino controlled)
Temperature sensor with a led matrix display (arduino controlled)TechLeap
 

What's hot (20)

(381877808) 102054282 5-listing-program
(381877808) 102054282 5-listing-program(381877808) 102054282 5-listing-program
(381877808) 102054282 5-listing-program
 
4th sem hons
4th sem hons4th sem hons
4th sem hons
 
Two digit-countdown-timer
Two digit-countdown-timerTwo digit-countdown-timer
Two digit-countdown-timer
 
Untitled 1
Untitled 1Untitled 1
Untitled 1
 
22 microcontroller programs
22 microcontroller programs22 microcontroller programs
22 microcontroller programs
 
Microcontroller avr
Microcontroller avrMicrocontroller avr
Microcontroller avr
 
Interfacing two wire adc0831 to raspberry pi2 / Pi3
Interfacing two wire adc0831 to raspberry pi2 / Pi3Interfacing two wire adc0831 to raspberry pi2 / Pi3
Interfacing two wire adc0831 to raspberry pi2 / Pi3
 
IoT Gateway實現專題
IoT Gateway實現專題IoT Gateway實現專題
IoT Gateway實現專題
 
Code2
Code2Code2
Code2
 
LED Blinking logic on LPC1768
LED Blinking logic on LPC1768LED Blinking logic on LPC1768
LED Blinking logic on LPC1768
 
final
finalfinal
final
 
Ir remote kit_blink.pde
Ir remote kit_blink.pdeIr remote kit_blink.pde
Ir remote kit_blink.pde
 
Tensorflow lite for microcontroller
Tensorflow lite for microcontrollerTensorflow lite for microcontroller
Tensorflow lite for microcontroller
 
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
 
TinyML - 4 speech recognition
TinyML - 4 speech recognition TinyML - 4 speech recognition
TinyML - 4 speech recognition
 
Raspberry Pi I/O控制與感測器讀取
Raspberry Pi I/O控制與感測器讀取Raspberry Pi I/O控制與感測器讀取
Raspberry Pi I/O控制與感測器讀取
 
Temperature Sensor with LED matrix Display BY ►iRFAN QADOOS◄ 9
Temperature Sensor with LED matrix Display BY ►iRFAN QADOOS◄ 9Temperature Sensor with LED matrix Display BY ►iRFAN QADOOS◄ 9
Temperature Sensor with LED matrix Display BY ►iRFAN QADOOS◄ 9
 
EMBEDDED SYSTEMS 5
EMBEDDED SYSTEMS 5EMBEDDED SYSTEMS 5
EMBEDDED SYSTEMS 5
 
Devirtualizing FinSpy
Devirtualizing FinSpyDevirtualizing FinSpy
Devirtualizing FinSpy
 
Temperature sensor with a led matrix display (arduino controlled)
Temperature sensor with a led matrix display (arduino controlled)Temperature sensor with a led matrix display (arduino controlled)
Temperature sensor with a led matrix display (arduino controlled)
 

Viewers also liked

Pai a fahimu & saipul
Pai a fahimu & saipulPai a fahimu & saipul
Pai a fahimu & saipulFahim Knap
 
El delito-informático-de-pornografía-infantil
El delito-informático-de-pornografía-infantilEl delito-informático-de-pornografía-infantil
El delito-informático-de-pornografía-infantilErick Roncal
 
Propiedad intelectual-y-software
Propiedad intelectual-y-softwarePropiedad intelectual-y-software
Propiedad intelectual-y-softwareErick Roncal
 
色色な場所
色色な場所色色な場所
色色な場所brown-yima
 
discografia de bruno mars
discografia de bruno marsdiscografia de bruno mars
discografia de bruno marsVanesa Meza
 
Bday greetings (women) 2013
Bday greetings (women) 2013Bday greetings (women) 2013
Bday greetings (women) 2013ceicleap
 
виховна
виховнавиховна
виховнаdirektor8
 
публікації вчителя історії Кондратьєва А.В.
публікації вчителя історії Кондратьєва А.В.публікації вчителя історії Кондратьєва А.В.
публікації вчителя історії Кондратьєва А.В.direktor8
 
Agenda digital 2.0.
Agenda digital 2.0.Agenda digital 2.0.
Agenda digital 2.0.Erick Roncal
 
Березка Чесноковка
Березка ЧесноковкаБерезка Чесноковка
Березка Чесноковкаdnegrij
 
библионочь 2016 г.презентация1
библионочь 2016 г.презентация1библионочь 2016 г.презентация1
библионочь 2016 г.презентация1dnegrij
 
презентация профилактика орз и гриппа
презентация профилактика орз и гриппапрезентация профилактика орз и гриппа
презентация профилактика орз и гриппаdnegrij
 
Handoff management
Handoff managementHandoff management
Handoff managementMounika Uade
 

Viewers also liked (17)

Pai a fahimu & saipul
Pai a fahimu & saipulPai a fahimu & saipul
Pai a fahimu & saipul
 
El delito-informático-de-pornografía-infantil
El delito-informático-de-pornografía-infantilEl delito-informático-de-pornografía-infantil
El delito-informático-de-pornografía-infantil
 
Propiedad intelectual-y-software
Propiedad intelectual-y-softwarePropiedad intelectual-y-software
Propiedad intelectual-y-software
 
色色な場所
色色な場所色色な場所
色色な場所
 
Aimee
AimeeAimee
Aimee
 
discografia de bruno mars
discografia de bruno marsdiscografia de bruno mars
discografia de bruno mars
 
Bday greetings (women) 2013
Bday greetings (women) 2013Bday greetings (women) 2013
Bday greetings (women) 2013
 
виховна
виховнавиховна
виховна
 
публікації вчителя історії Кондратьєва А.В.
публікації вчителя історії Кондратьєва А.В.публікації вчителя історії Кондратьєва А.В.
публікації вчителя історії Кондратьєва А.В.
 
Agenda digital 2.0.
Agenda digital 2.0.Agenda digital 2.0.
Agenda digital 2.0.
 
Березка Чесноковка
Березка ЧесноковкаБерезка Чесноковка
Березка Чесноковка
 
lily cortes
lily corteslily cortes
lily cortes
 
библионочь 2016 г.презентация1
библионочь 2016 г.презентация1библионочь 2016 г.презентация1
библионочь 2016 г.презентация1
 
The Raven Huginn
The Raven HuginnThe Raven Huginn
The Raven Huginn
 
презентация профилактика орз и гриппа
презентация профилактика орз и гриппапрезентация профилактика орз и гриппа
презентация профилактика орз и гриппа
 
Ppt0000003
Ppt0000003Ppt0000003
Ppt0000003
 
Handoff management
Handoff managementHandoff management
Handoff management
 

Similar to Micro

MicrocontrollersII (1).pptx
MicrocontrollersII (1).pptxMicrocontrollersII (1).pptx
MicrocontrollersII (1).pptxnodov66591
 
Microcontroller
MicrocontrollerMicrocontroller
MicrocontrollerSpitiq
 
Microcontrollers ii
Microcontrollers iiMicrocontrollers ii
Microcontrollers iiKumar Kumar
 
Xcs 234 microprocessors
Xcs 234 microprocessorsXcs 234 microprocessors
Xcs 234 microprocessorssweta suman
 
MicrocontrollersII.ppt
MicrocontrollersII.pptMicrocontrollersII.ppt
MicrocontrollersII.pptSatheeshMECE
 
introduction to Microcontrollers 8051.ppt
introduction to Microcontrollers 8051.pptintroduction to Microcontrollers 8051.ppt
introduction to Microcontrollers 8051.pptjaychoudhary37
 
timing_diagram_of_8085.pptx
timing_diagram_of_8085.pptxtiming_diagram_of_8085.pptx
timing_diagram_of_8085.pptxBhagyarajKosamia
 
Embedded system (Chapter 3) io_port_programming
Embedded system (Chapter 3) io_port_programmingEmbedded system (Chapter 3) io_port_programming
Embedded system (Chapter 3) io_port_programmingIkhwan_Fakrudin
 
Microcontroller 8051
Microcontroller 8051Microcontroller 8051
Microcontroller 8051Rashmi
 
Unit 3-1 (1)
Unit 3-1 (1)Unit 3-1 (1)
Unit 3-1 (1)Vasu Ch
 
Hardware interfacing basics using AVR
Hardware interfacing basics using AVRHardware interfacing basics using AVR
Hardware interfacing basics using AVRMohamed Abdallah
 
Linux Serial Driver
Linux Serial DriverLinux Serial Driver
Linux Serial Driver艾鍗科技
 
Lecture1 The 8085 Microprocessor
Lecture1 The 8085 MicroprocessorLecture1 The 8085 Microprocessor
Lecture1 The 8085 MicroprocessorZeeshan Ahmed
 
microcontroller basics
microcontroller basicsmicrocontroller basics
microcontroller basicssagar Ramdev
 
8051 Microcontroller PPT's By Er. Swapnil Kaware
8051 Microcontroller PPT's By Er. Swapnil Kaware8051 Microcontroller PPT's By Er. Swapnil Kaware
8051 Microcontroller PPT's By Er. Swapnil KawareProf. Swapnil V. Kaware
 
8051 Microcontroller By Er. Swapnil Kaware
8051 Microcontroller By Er. Swapnil Kaware8051 Microcontroller By Er. Swapnil Kaware
8051 Microcontroller By Er. Swapnil KawareProf. Swapnil V. Kaware
 

Similar to Micro (20)

MicrocontrollersII (1).pptx
MicrocontrollersII (1).pptxMicrocontrollersII (1).pptx
MicrocontrollersII (1).pptx
 
Microcontroller
MicrocontrollerMicrocontroller
Microcontroller
 
Microcontrollers ii
Microcontrollers iiMicrocontrollers ii
Microcontrollers ii
 
Xcs 234 microprocessors
Xcs 234 microprocessorsXcs 234 microprocessors
Xcs 234 microprocessors
 
MicrocontrollersII.ppt
MicrocontrollersII.pptMicrocontrollersII.ppt
MicrocontrollersII.ppt
 
introduction to Microcontrollers 8051.ppt
introduction to Microcontrollers 8051.pptintroduction to Microcontrollers 8051.ppt
introduction to Microcontrollers 8051.ppt
 
timing_diagram_of_8085.pptx
timing_diagram_of_8085.pptxtiming_diagram_of_8085.pptx
timing_diagram_of_8085.pptx
 
Embedded system (Chapter 3) io_port_programming
Embedded system (Chapter 3) io_port_programmingEmbedded system (Chapter 3) io_port_programming
Embedded system (Chapter 3) io_port_programming
 
020419.pdf
020419.pdf020419.pdf
020419.pdf
 
unit-3-8255.pdf
unit-3-8255.pdfunit-3-8255.pdf
unit-3-8255.pdf
 
Microcontroller 8051
Microcontroller 8051Microcontroller 8051
Microcontroller 8051
 
Unit 3-1 (1)
Unit 3-1 (1)Unit 3-1 (1)
Unit 3-1 (1)
 
8051 MC.pptx
8051 MC.pptx8051 MC.pptx
8051 MC.pptx
 
Hardware interfacing basics using AVR
Hardware interfacing basics using AVRHardware interfacing basics using AVR
Hardware interfacing basics using AVR
 
Linux Serial Driver
Linux Serial DriverLinux Serial Driver
Linux Serial Driver
 
8086
80868086
8086
 
Lecture1 The 8085 Microprocessor
Lecture1 The 8085 MicroprocessorLecture1 The 8085 Microprocessor
Lecture1 The 8085 Microprocessor
 
microcontroller basics
microcontroller basicsmicrocontroller basics
microcontroller basics
 
8051 Microcontroller PPT's By Er. Swapnil Kaware
8051 Microcontroller PPT's By Er. Swapnil Kaware8051 Microcontroller PPT's By Er. Swapnil Kaware
8051 Microcontroller PPT's By Er. Swapnil Kaware
 
8051 Microcontroller By Er. Swapnil Kaware
8051 Microcontroller By Er. Swapnil Kaware8051 Microcontroller By Er. Swapnil Kaware
8051 Microcontroller By Er. Swapnil Kaware
 

Recently uploaded

Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxhumanexperienceaaa
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 

Recently uploaded (20)

Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 

Micro

  • 1. 09-EE-88 Page 1 MICROCONTROLLER ( PIC 18F458) Microcontroller A microcontroller is a small computer on a single integrated circuit containing a processor core, memory, and programmable input/output Peripherals. In lab we are working on 18F458,it has 5 ports, PORTS: group of pins PORT A : having 7 pins PORT B,PORT C,PORT D :8 PINS PORT E: having 3 pins PORTX : To store data ,port register is used TRISX:Tri-state 0 is used for output 1 is used for input
  • 2. 09-EE-88 Page 2 Simple Binary Counter Code: void main() {unsigned char c=0 ; trisB=0x00; //make port B as output PORTB=c; while(1) //Infinite loop like for (;;) {PORTB=c ; c++ ; delay_ms(500);}} //time delay in miliseconds}} Proteus simulation
  • 3. 09-EE-88 Page 3 TIMERS There are Four timers in 18F458. 8 bit Timer : a timer in which maximum value that can be implemented is 256 16 bit Timer: a timer in which maximum value that can be implemented is 65536 The clock source can be internal or external.if we use internal clock source ,then 1/4th Of the freq of the crystal oscillator on the OSC1 And OSC2 pins .therefore it is used For time delay generation ,so they are called timersBy choosing external clock option ,we feed pulse through any pin of uC. This is called Counter. First we will discuss about timers
  • 4. 09-EE-88 Page 4 EXAMPLE: void tmo_delay(); void main() {trisB=0x00; //make portB as output portB=0x00; // all pins of port B are given value =0 while(1) //infinite loop { portB=0xff; // all pins of port B are given value =1 tmo_delay(); //function call portB=0x00; // all pins of port B are given value =0 tmo_delay(); // function call }} void tmo_delay() { T0CON=0X08; TMR0H=0X00; TMR0L=0X00; T0CON.TMR0ON=1 ; T0CON.TMR0IF=0 ; while(intcon.tmr0if==0) ; t0con.tmr0on=0 ; intcon.tmr0if=0 ; }
  • 5. 09-EE-88 Page 5 Proteus simulation ******************
  • 6. 09-EE-88 Page 6 Timers as Counters Timers can also be used as counters to count events happening outside pic18F458.in counter mode the registers such as T0CON , TMR0H,TMR0L are the same as for the timers discussed. EXAMPLE: void cnt_0( ) ; void main( ) { trisa.f4=1; trisb.f0=0; trisd=0x00; porta.f4=0; portb.f0=0; portd=0x00; while(1) { cnt_0 ( ); } } Unsigned char cnt=0; Unsigned char c=0 void cnt_0( ) {tmr0l=0x00; t0con=0x68; intcon.tmr0if=0 ;
  • 7. 09-EE-88 Page 7 intcon.tmr0on=1; while(intcon.tmr0if==0) { portd=tmr0l; cnt=tmr0l/10; portb.f0=c ; if (cnt==1 && cnt1==0) c=1; else c=0;} t0con.tmr0on=0 intcon.tmr0if=0;}} Proteus simulation
  • 8. 09-EE-88 Page 8 INTERRUPTS int cnt=0; void interrupt() { if(intcon.int0if==1) { cnt++; intcon.int0if=0; }} void main() { trisb.f0=1; trisd=0x00;portd=0x00; intcon=0x90; while(1) {portd=cnt;}}
  • 9. 09-EE-88 Page 9 Proteus simulation ************