SlideShare a Scribd company logo
ATMEL and PIC Microcontroller
       Programming
           using
        C language
            Presented by:
     Engr. Tirso L. Llantada, ECE
Overview
• Introduction to Microcontrollers
• Hardware Configuration
• Microcontroller Programming
What is a Microcontroller
                 (MCU)
• It is a single chip microprocessor system
  which contains data and program memory,
  serial and parallel I/O ports, timers, external
  and internal interrupts, ALL integrated into a
  single chip.
Central Processing Unit(CPU)
             vs
 Microprocessor Unit(MPU)
             vs
 Microcontroller Unit(MCU)
Central Processing Unit
• this could refer to the actual processor part of a
  microcontroller, the microprocessor within a
  computer, or the processor "box" of a computer
  system.
             Microprocessor Unit
• This devices tend to be aimed at computer
  applications.
             Microcontroller Unit
• This devices tend to be aimed at embedded control
  applications
• They tend to consist of a processor plus a number of
  useful peripherals (MMU, Timers, watchdog, A/D, etc,
  etc, etc).
ALU

Control Unit
ARE WE CLEAR?
Microcontroller Architecture
                    EEPROM
                               RAM
                    ROM



                                            Serial
Other Peripherals    Microprocessor     Communications
                                           (RS232)



                    Analog    Digital
                     I/O       I/O
Microcontroller Architecture
What you need to know!
• Before you can make a working microcontroller
  project, you should first know the following:

1.   Supply Voltage
2.   Number of I/O
3.   Special Purpose I/O(Serial Ports, ADC Ports, etc)
4.   Memory(RAM and ROM)
5.   Timers/Counters
6.   Interrupts
7.   XTAL Oscillator frequency
INTRODUCING
ATMEL 89C2051
 Supply(VCC,GND)- 2.7V to 6V Operating Range
     Pin         I/0pins:
                    o Port 1 - The Port 1 is an 8-bit bi-directional I/O port. The
Configuration         Port 1 out-put buffers can sink 20 mA and can drive LED
                      displays directly.
                    o Port 3 - Port 3 pins P3.0 to P3.5, P3.7 are seven bi-
                      directional I/O pins with internal pull-ups.
                 Special Purpose I/O
                    o   P3.0 RXD (serial input port)
                    o   P3.1 TXD (serial output port)
                    o   P3.2 INT0 (external interrupt 0)
                    o   P3.3 INT1 (external interrupt 1)
                    o   P3.4 T0 (timer 0 external input)
                    o   P3.5 T1 (timer 1 external input)
                 Memory(2Kbytes)
                 Timers/Counters - 2 16-bit timer/counter
                 Interrupts(6 sources of interrupts)
                    o   Reset, Timer 0 overflow, Timer 1 overflow,
                        External Interrupt 0, External Interrupt 1, Serial
                        Port events (buffer full, buffer empty, etc)

                 XTAL frequency - 0 Hz to 24 MHz
Hardware Configuration

 RS232
Microcontroller Programming
• Traditionally, it can only be programmed using
  assembly language.
• But due to the complexity of assembly
  language, high level language were developed
  such as BASIC and C Programming
Microcontroller Programming
      using C language
Structure of Microcontroller C Programming
Sample Programs
        #include<AT892051.h>
        /*Function to delay about a second
        void wait_a_sec()
        {
        Unsigned int x;
        for(x=0;x<33000;x++);
        }
        /*start of main program*/
        main()
        {
        int LED = 1;
             for(;;)
             {
                  P1=~LED;
                  LED++;
                  wait_a_sec();
             }
        }
Oops! First we
   configure!
• Select
  Project – Components,
  Environment, Books
Configuration
• Set the following parameters
Compiling the
   Project
• Select
  Project – Build target
Check Status
   Window
• There should be
  0 errors and
  0 warnings
Burn the program
Interrupt Subroutines
1. Interrupt subroutine for timer 1
               Void timer1() interrupt 3
               {
               Interrupt service code goes here
               }
2. Interrupt subroutine for timer 3
              Void timer0() interrupt 1
              {
              Interrupt service code goes here
              }
Interrupt Sources
BORING?
Lets go with a more interesting one!
Ad

More Related Content

What's hot (20)

301378156 design-of-sram-in-verilog
301378156 design-of-sram-in-verilog301378156 design-of-sram-in-verilog
301378156 design-of-sram-in-verilog
Srinivas Naidu
 
Programming with PIC microcontroller
Programming with PIC microcontroller Programming with PIC microcontroller
Programming with PIC microcontroller
Raghav Shetty
 
ARM Architecture
ARM ArchitectureARM Architecture
ARM Architecture
Dwight Sabio
 
Arm instruction set
Arm instruction setArm instruction set
Arm instruction set
Mathivanan Natarajan
 
Ppt on brake failure indicator.
Ppt on brake failure indicator.Ppt on brake failure indicator.
Ppt on brake failure indicator.
mmnbaig
 
PIC MICROCONTROLLERS -CLASS NOTES
PIC MICROCONTROLLERS -CLASS NOTESPIC MICROCONTROLLERS -CLASS NOTES
PIC MICROCONTROLLERS -CLASS NOTES
Dr.YNM
 
INTRODUCTION TO MICROCONTROLLER
INTRODUCTION TO MICROCONTROLLERINTRODUCTION TO MICROCONTROLLER
INTRODUCTION TO MICROCONTROLLER
Ankita Jaiswal
 
Embedded Systems (18EC62) - ARM Cortex-M3 Instruction Set and Programming (Mo...
Embedded Systems (18EC62) - ARM Cortex-M3 Instruction Set and Programming (Mo...Embedded Systems (18EC62) - ARM Cortex-M3 Instruction Set and Programming (Mo...
Embedded Systems (18EC62) - ARM Cortex-M3 Instruction Set and Programming (Mo...
Shrishail Bhat
 
Serial Communication
Serial CommunicationSerial Communication
Serial Communication
UshaRani289
 
Microcontroller presentation
Microcontroller presentationMicrocontroller presentation
Microcontroller presentation
xavierpaulino
 
Pin diagram 8085
Pin diagram 8085 Pin diagram 8085
Pin diagram 8085
Siddhesh Palkar
 
digital electronics Design of 101 sequence detector without overlapping for...
digital  electronics Design of 101 sequence detector without  overlapping for...digital  electronics Design of 101 sequence detector without  overlapping for...
digital electronics Design of 101 sequence detector without overlapping for...
sanjay kumar pediredla
 
FPGA
FPGAFPGA
FPGA
Abhilash Nair
 
Dsp lab pdf
Dsp lab pdfDsp lab pdf
Dsp lab pdf
shareslidesplease
 
Question paper with solution the 8051 microcontroller based embedded systems...
Question paper with solution  the 8051 microcontroller based embedded systems...Question paper with solution  the 8051 microcontroller based embedded systems...
Question paper with solution the 8051 microcontroller based embedded systems...
manishpatel_79
 
Password based door locking system
Password based door locking systemPassword based door locking system
Password based door locking system
Arjun Singh
 
7 segment led interfacing with 8051
7 segment led interfacing with 80517 segment led interfacing with 8051
7 segment led interfacing with 8051
Sam Patel
 
8086 Micro-processor and MDA 8086 Trainer Kit
8086 Micro-processor and MDA 8086 Trainer Kit8086 Micro-processor and MDA 8086 Trainer Kit
8086 Micro-processor and MDA 8086 Trainer Kit
Amit Kumer Podder
 
Module 2 ARM CORTEX M3 Instruction Set and Programming
Module 2 ARM CORTEX M3 Instruction Set and ProgrammingModule 2 ARM CORTEX M3 Instruction Set and Programming
Module 2 ARM CORTEX M3 Instruction Set and Programming
Amogha Bandrikalli
 
Interfacing Stepper motor with 8051
Interfacing Stepper motor with 8051Interfacing Stepper motor with 8051
Interfacing Stepper motor with 8051
Pantech ProLabs India Pvt Ltd
 
301378156 design-of-sram-in-verilog
301378156 design-of-sram-in-verilog301378156 design-of-sram-in-verilog
301378156 design-of-sram-in-verilog
Srinivas Naidu
 
Programming with PIC microcontroller
Programming with PIC microcontroller Programming with PIC microcontroller
Programming with PIC microcontroller
Raghav Shetty
 
Ppt on brake failure indicator.
Ppt on brake failure indicator.Ppt on brake failure indicator.
Ppt on brake failure indicator.
mmnbaig
 
PIC MICROCONTROLLERS -CLASS NOTES
PIC MICROCONTROLLERS -CLASS NOTESPIC MICROCONTROLLERS -CLASS NOTES
PIC MICROCONTROLLERS -CLASS NOTES
Dr.YNM
 
INTRODUCTION TO MICROCONTROLLER
INTRODUCTION TO MICROCONTROLLERINTRODUCTION TO MICROCONTROLLER
INTRODUCTION TO MICROCONTROLLER
Ankita Jaiswal
 
Embedded Systems (18EC62) - ARM Cortex-M3 Instruction Set and Programming (Mo...
Embedded Systems (18EC62) - ARM Cortex-M3 Instruction Set and Programming (Mo...Embedded Systems (18EC62) - ARM Cortex-M3 Instruction Set and Programming (Mo...
Embedded Systems (18EC62) - ARM Cortex-M3 Instruction Set and Programming (Mo...
Shrishail Bhat
 
Serial Communication
Serial CommunicationSerial Communication
Serial Communication
UshaRani289
 
Microcontroller presentation
Microcontroller presentationMicrocontroller presentation
Microcontroller presentation
xavierpaulino
 
digital electronics Design of 101 sequence detector without overlapping for...
digital  electronics Design of 101 sequence detector without  overlapping for...digital  electronics Design of 101 sequence detector without  overlapping for...
digital electronics Design of 101 sequence detector without overlapping for...
sanjay kumar pediredla
 
Question paper with solution the 8051 microcontroller based embedded systems...
Question paper with solution  the 8051 microcontroller based embedded systems...Question paper with solution  the 8051 microcontroller based embedded systems...
Question paper with solution the 8051 microcontroller based embedded systems...
manishpatel_79
 
Password based door locking system
Password based door locking systemPassword based door locking system
Password based door locking system
Arjun Singh
 
7 segment led interfacing with 8051
7 segment led interfacing with 80517 segment led interfacing with 8051
7 segment led interfacing with 8051
Sam Patel
 
8086 Micro-processor and MDA 8086 Trainer Kit
8086 Micro-processor and MDA 8086 Trainer Kit8086 Micro-processor and MDA 8086 Trainer Kit
8086 Micro-processor and MDA 8086 Trainer Kit
Amit Kumer Podder
 
Module 2 ARM CORTEX M3 Instruction Set and Programming
Module 2 ARM CORTEX M3 Instruction Set and ProgrammingModule 2 ARM CORTEX M3 Instruction Set and Programming
Module 2 ARM CORTEX M3 Instruction Set and Programming
Amogha Bandrikalli
 

Viewers also liked (20)

Programming ATmega microcontroller using Embedded C
Programming ATmega microcontroller using Embedded CProgramming ATmega microcontroller using Embedded C
Programming ATmega microcontroller using Embedded C
Varun A M
 
AVR programming - BASICS
AVR programming - BASICSAVR programming - BASICS
AVR programming - BASICS
Robotix 2011
 
Final Report
Final ReportFinal Report
Final Report
Susmit Sircar
 
Thesis
ThesisThesis
Thesis
Zain Khan
 
Microcontrollermesin2008 aneukmesinunsyiah
Microcontrollermesin2008 aneukmesinunsyiahMicrocontrollermesin2008 aneukmesinunsyiah
Microcontrollermesin2008 aneukmesinunsyiah
afdhal teknik
 
An energy efficient street lightening system based on solar energy and mppt a...
An energy efficient street lightening system based on solar energy and mppt a...An energy efficient street lightening system based on solar energy and mppt a...
An energy efficient street lightening system based on solar energy and mppt a...
eSAT Journals
 
12w led corn light IES
12w led  corn  light IES12w led  corn  light IES
12w led corn light IES
ngt led
 
LED Corn Light 12W new
LED Corn Light 12W newLED Corn Light 12W new
LED Corn Light 12W new
ngt led
 
Voltage frequency converter
Voltage frequency converterVoltage frequency converter
Voltage frequency converter
Xi Qiu
 
Frequency to voltage converter.final
Frequency to voltage converter.finalFrequency to voltage converter.final
Frequency to voltage converter.final
prashant singh
 
Max232
Max232Max232
Max232
____
 
L9 understanding-atmega328 p-2
L9 understanding-atmega328 p-2L9 understanding-atmega328 p-2
L9 understanding-atmega328 p-2
rsamurti
 
Arduino atmega328
Arduino atmega328Arduino atmega328
Arduino atmega328
Luciano FS
 
Max 232
Max 232Max 232
Max 232
Samarth
 
Flow chart programming
Flow chart programmingFlow chart programming
Flow chart programming
Tearsome Llantada
 
Arduino uno lcd display 16x2
Arduino uno lcd display 16x2Arduino uno lcd display 16x2
Arduino uno lcd display 16x2
Robomart India
 
L16 usart-atmega328 p
L16 usart-atmega328 pL16 usart-atmega328 p
L16 usart-atmega328 p
rsamurti
 
L8 understanding-atmega328 p-1
L8 understanding-atmega328 p-1L8 understanding-atmega328 p-1
L8 understanding-atmega328 p-1
rsamurti
 
Pic16f84
Pic16f84Pic16f84
Pic16f84
Homoud Alsohaibi
 
Programming ATmega microcontroller using Embedded C
Programming ATmega microcontroller using Embedded CProgramming ATmega microcontroller using Embedded C
Programming ATmega microcontroller using Embedded C
Varun A M
 
AVR programming - BASICS
AVR programming - BASICSAVR programming - BASICS
AVR programming - BASICS
Robotix 2011
 
Microcontrollermesin2008 aneukmesinunsyiah
Microcontrollermesin2008 aneukmesinunsyiahMicrocontrollermesin2008 aneukmesinunsyiah
Microcontrollermesin2008 aneukmesinunsyiah
afdhal teknik
 
An energy efficient street lightening system based on solar energy and mppt a...
An energy efficient street lightening system based on solar energy and mppt a...An energy efficient street lightening system based on solar energy and mppt a...
An energy efficient street lightening system based on solar energy and mppt a...
eSAT Journals
 
12w led corn light IES
12w led  corn  light IES12w led  corn  light IES
12w led corn light IES
ngt led
 
LED Corn Light 12W new
LED Corn Light 12W newLED Corn Light 12W new
LED Corn Light 12W new
ngt led
 
Voltage frequency converter
Voltage frequency converterVoltage frequency converter
Voltage frequency converter
Xi Qiu
 
Frequency to voltage converter.final
Frequency to voltage converter.finalFrequency to voltage converter.final
Frequency to voltage converter.final
prashant singh
 
Max232
Max232Max232
Max232
____
 
L9 understanding-atmega328 p-2
L9 understanding-atmega328 p-2L9 understanding-atmega328 p-2
L9 understanding-atmega328 p-2
rsamurti
 
Arduino atmega328
Arduino atmega328Arduino atmega328
Arduino atmega328
Luciano FS
 
Arduino uno lcd display 16x2
Arduino uno lcd display 16x2Arduino uno lcd display 16x2
Arduino uno lcd display 16x2
Robomart India
 
L16 usart-atmega328 p
L16 usart-atmega328 pL16 usart-atmega328 p
L16 usart-atmega328 p
rsamurti
 
L8 understanding-atmega328 p-1
L8 understanding-atmega328 p-1L8 understanding-atmega328 p-1
L8 understanding-atmega328 p-1
rsamurti
 
Ad

Similar to Atmel and pic microcontroller (20)

8449972 embedded-systems-and-model-of-metro-train
8449972 embedded-systems-and-model-of-metro-train8449972 embedded-systems-and-model-of-metro-train
8449972 embedded-systems-and-model-of-metro-train
Jitendra Saroj
 
Pc based wire less data aquisition system using rf(1)
Pc based wire less data aquisition system using rf(1)Pc based wire less data aquisition system using rf(1)
Pc based wire less data aquisition system using rf(1)
Vishalya Dulam
 
Embedded system design using arduino
Embedded system design using arduinoEmbedded system design using arduino
Embedded system design using arduino
Santosh Verma
 
Embedded system
Embedded  systemEmbedded  system
Embedded system
ANSHUL GUPTA
 
Arduino_Beginner.pptx
Arduino_Beginner.pptxArduino_Beginner.pptx
Arduino_Beginner.pptx
aravind Guru
 
CHAPTER1.pptx ON 8051 MICROCONTROLLER INTRODUCTION CHAPTER
CHAPTER1.pptx  ON 8051 MICROCONTROLLER INTRODUCTION CHAPTERCHAPTER1.pptx  ON 8051 MICROCONTROLLER INTRODUCTION CHAPTER
CHAPTER1.pptx ON 8051 MICROCONTROLLER INTRODUCTION CHAPTER
NagarathnaRajur2
 
Iot Workshop NITT 2015
Iot Workshop NITT 2015Iot Workshop NITT 2015
Iot Workshop NITT 2015
Srivignessh Pss
 
Summer training embedded system and its scope
Summer training  embedded system and its scopeSummer training  embedded system and its scope
Summer training embedded system and its scope
Arshit Rai
 
Overview of Microcontroller and ATMega32 microcontroller
Overview of Microcontroller and ATMega32 microcontrollerOverview of Microcontroller and ATMega32 microcontroller
Overview of Microcontroller and ATMega32 microcontroller
Rup Chowdhury
 
8051 microcontroller
8051 microcontroller8051 microcontroller
8051 microcontroller
snehapvs
 
unit-2.pptx
unit-2.pptxunit-2.pptx
unit-2.pptx
KanchanThory
 
Microcontroller from basic_to_advanced
Microcontroller from basic_to_advancedMicrocontroller from basic_to_advanced
Microcontroller from basic_to_advanced
Imran Sheikh
 
8051 Microcontroller slides foe electronics
8051 Microcontroller slides foe electronics8051 Microcontroller slides foe electronics
8051 Microcontroller slides foe electronics
KiranG764628
 
PILOT Session for Embedded Systems
PILOT Session for Embedded Systems PILOT Session for Embedded Systems
PILOT Session for Embedded Systems
Mohamed Al-Emam, PMP®, CAP®
 
Introduction to the Arduino
Introduction to the ArduinoIntroduction to the Arduino
Introduction to the Arduino
Wingston
 
Best-embedded-corporate-training-in-mumbai
Best-embedded-corporate-training-in-mumbaiBest-embedded-corporate-training-in-mumbai
Best-embedded-corporate-training-in-mumbai
Unmesh Baile
 
Microcontroller 8051 gs
Microcontroller 8051 gsMicrocontroller 8051 gs
Microcontroller 8051 gs
Moorthy Peesapati
 
microcontroller 8051 17.07.2023.pdf
microcontroller 8051 17.07.2023.pdfmicrocontroller 8051 17.07.2023.pdf
microcontroller 8051 17.07.2023.pdf
818Farida
 
Summer training embedded system and its scope
Summer training  embedded system and its scopeSummer training  embedded system and its scope
Summer training embedded system and its scope
Arshit Rai
 
Embedded systemsc
Embedded systemscEmbedded systemsc
Embedded systemsc
idris kamaruddin
 
8449972 embedded-systems-and-model-of-metro-train
8449972 embedded-systems-and-model-of-metro-train8449972 embedded-systems-and-model-of-metro-train
8449972 embedded-systems-and-model-of-metro-train
Jitendra Saroj
 
Pc based wire less data aquisition system using rf(1)
Pc based wire less data aquisition system using rf(1)Pc based wire less data aquisition system using rf(1)
Pc based wire less data aquisition system using rf(1)
Vishalya Dulam
 
Embedded system design using arduino
Embedded system design using arduinoEmbedded system design using arduino
Embedded system design using arduino
Santosh Verma
 
Arduino_Beginner.pptx
Arduino_Beginner.pptxArduino_Beginner.pptx
Arduino_Beginner.pptx
aravind Guru
 
CHAPTER1.pptx ON 8051 MICROCONTROLLER INTRODUCTION CHAPTER
CHAPTER1.pptx  ON 8051 MICROCONTROLLER INTRODUCTION CHAPTERCHAPTER1.pptx  ON 8051 MICROCONTROLLER INTRODUCTION CHAPTER
CHAPTER1.pptx ON 8051 MICROCONTROLLER INTRODUCTION CHAPTER
NagarathnaRajur2
 
Summer training embedded system and its scope
Summer training  embedded system and its scopeSummer training  embedded system and its scope
Summer training embedded system and its scope
Arshit Rai
 
Overview of Microcontroller and ATMega32 microcontroller
Overview of Microcontroller and ATMega32 microcontrollerOverview of Microcontroller and ATMega32 microcontroller
Overview of Microcontroller and ATMega32 microcontroller
Rup Chowdhury
 
8051 microcontroller
8051 microcontroller8051 microcontroller
8051 microcontroller
snehapvs
 
Microcontroller from basic_to_advanced
Microcontroller from basic_to_advancedMicrocontroller from basic_to_advanced
Microcontroller from basic_to_advanced
Imran Sheikh
 
8051 Microcontroller slides foe electronics
8051 Microcontroller slides foe electronics8051 Microcontroller slides foe electronics
8051 Microcontroller slides foe electronics
KiranG764628
 
Introduction to the Arduino
Introduction to the ArduinoIntroduction to the Arduino
Introduction to the Arduino
Wingston
 
Best-embedded-corporate-training-in-mumbai
Best-embedded-corporate-training-in-mumbaiBest-embedded-corporate-training-in-mumbai
Best-embedded-corporate-training-in-mumbai
Unmesh Baile
 
microcontroller 8051 17.07.2023.pdf
microcontroller 8051 17.07.2023.pdfmicrocontroller 8051 17.07.2023.pdf
microcontroller 8051 17.07.2023.pdf
818Farida
 
Summer training embedded system and its scope
Summer training  embedded system and its scopeSummer training  embedded system and its scope
Summer training embedded system and its scope
Arshit Rai
 
Ad

Atmel and pic microcontroller

  • 1. ATMEL and PIC Microcontroller Programming using C language Presented by: Engr. Tirso L. Llantada, ECE
  • 2. Overview • Introduction to Microcontrollers • Hardware Configuration • Microcontroller Programming
  • 3. What is a Microcontroller (MCU) • It is a single chip microprocessor system which contains data and program memory, serial and parallel I/O ports, timers, external and internal interrupts, ALL integrated into a single chip.
  • 4. Central Processing Unit(CPU) vs Microprocessor Unit(MPU) vs Microcontroller Unit(MCU)
  • 5. Central Processing Unit • this could refer to the actual processor part of a microcontroller, the microprocessor within a computer, or the processor "box" of a computer system. Microprocessor Unit • This devices tend to be aimed at computer applications. Microcontroller Unit • This devices tend to be aimed at embedded control applications • They tend to consist of a processor plus a number of useful peripherals (MMU, Timers, watchdog, A/D, etc, etc, etc).
  • 8. Microcontroller Architecture EEPROM RAM ROM Serial Other Peripherals Microprocessor Communications (RS232) Analog Digital I/O I/O
  • 10. What you need to know! • Before you can make a working microcontroller project, you should first know the following: 1. Supply Voltage 2. Number of I/O 3. Special Purpose I/O(Serial Ports, ADC Ports, etc) 4. Memory(RAM and ROM) 5. Timers/Counters 6. Interrupts 7. XTAL Oscillator frequency
  • 12.  Supply(VCC,GND)- 2.7V to 6V Operating Range Pin  I/0pins: o Port 1 - The Port 1 is an 8-bit bi-directional I/O port. The Configuration Port 1 out-put buffers can sink 20 mA and can drive LED displays directly. o Port 3 - Port 3 pins P3.0 to P3.5, P3.7 are seven bi- directional I/O pins with internal pull-ups.  Special Purpose I/O o P3.0 RXD (serial input port) o P3.1 TXD (serial output port) o P3.2 INT0 (external interrupt 0) o P3.3 INT1 (external interrupt 1) o P3.4 T0 (timer 0 external input) o P3.5 T1 (timer 1 external input)  Memory(2Kbytes)  Timers/Counters - 2 16-bit timer/counter  Interrupts(6 sources of interrupts) o Reset, Timer 0 overflow, Timer 1 overflow, External Interrupt 0, External Interrupt 1, Serial Port events (buffer full, buffer empty, etc)  XTAL frequency - 0 Hz to 24 MHz
  • 14. Microcontroller Programming • Traditionally, it can only be programmed using assembly language. • But due to the complexity of assembly language, high level language were developed such as BASIC and C Programming
  • 15. Microcontroller Programming using C language
  • 17. Sample Programs #include<AT892051.h> /*Function to delay about a second void wait_a_sec() { Unsigned int x; for(x=0;x<33000;x++); } /*start of main program*/ main() { int LED = 1; for(;;) { P1=~LED; LED++; wait_a_sec(); } }
  • 18. Oops! First we configure! • Select Project – Components, Environment, Books
  • 19. Configuration • Set the following parameters
  • 20. Compiling the Project • Select Project – Build target
  • 21. Check Status Window • There should be 0 errors and 0 warnings
  • 23. Interrupt Subroutines 1. Interrupt subroutine for timer 1 Void timer1() interrupt 3 { Interrupt service code goes here } 2. Interrupt subroutine for timer 3 Void timer0() interrupt 1 { Interrupt service code goes here }
  • 25. BORING? Lets go with a more interesting one!