Structure of Microcontroller EA, RST, ALE, PSEN ROM COUNTER INPUTS OSC INTERRUPT CONTROL 4 I/O PORTS BUS CONTROL SERIAL PORT EXTERNAL INTERRUPTS CPU ON - CHIP RAM ETC TIMER 0 TIMER 1 ADDRESS/DATA TXD RXD P0 P1 P2 P3
Structure of Microcontroller
What are Interrupts? A  hardware event  is something that happens in the micro-controller's hardware. An example of an event is the RESET that occurs when pin 9 is set low. Micro-controllers are micro-computers whose architecture has been optimized to respond quickly to external events.
Output Compare Interrupts  Output compare interrupts are hardware interrupts that are tied to timer events and this means that they can be used by a micro-controller to enforce the real-time processing of events.  The output compare event can also be used to effect specific output pins.
Output Compare Interrupts  In particular, you will use the output compare interrupt to build a system that outputs a specified voltage using a pulse-width modulation scheme.
Output Compare Interrupts  In the Microcontroller output compare events are tied to a 16-bit hardware register (also called a timer) This register is incremented at a rate that can be specified by the programmer.
Output Compare Interrupts  When the value of  timer register  equals the value stored in another  output compare register , then an  output compare event  occurs and the Microcontroller responds by issuing an  output compare interrupt .  The  counter register  cannot be reset or stopped by the user.
Output Compare Interrupts  So to generate timing events, we compare the value in timer register against another number that is held in an  output compare register .  When the value in timer register matches the number in the output compare register, we trigger an  output-compare event .
Output Compare Interrupts  Output compare events are generated in the micro-controller's hardware.  This event will result in a hardware interrupt (also called an output compare interrupt) being generated if the interrupt is  enabled
Output Compare Interrupts  Enabling  the interrupt means that the software pays attention to the interrupt.  We  enable  all interrupts by setting the I bit in the condition code register of the micro-controller. This is bit is usually set in the init() function
IEN0 - Interrupt enable register 0
CMOD - PCA counter mode register (address D9H) bit allocation
CMOD - PCA counter mode register (address D9H) bit allocation
CCON - PCA counter control register (address 0D8H) bit description
CCON - PCA counter control register (address 0D8H) bit description
CCAPMn - PCA modules compare/capture register
CCAPMn - PCA modules compare/capture register
PCA IN COMPARE MODE
PCA IN COMPARE MODE The 16-bit software timer mode is used to trigger interrupt routines, which must occur at periodic intervals.  It is setup by setting both the ECOM and MAT bits in the module’s CCAPMn register
PCA IN COMPARE MODE The PCA timer will be compared to the module’s capture registers (CCAPnL and CCAPnH) when a match occurs, an interrupt will occur, if the ECCFn (CCAPMn SFR) bit for the module is set.
XEM VÍ DỤ MÔ PHỎNG vd3 Output Compare

More Related Content

PPTX
Ec8791 lpc2148 timer unit
PPTX
PPTX
PID Controllers
PPTX
Industrial Temperature Controller using Microcontroller
PDF
Atmel microcontrollers-a tmega328-p_datasheet
PPTX
PLC LADDER DIAGRAM
PPTX
Pid controllers
Ec8791 lpc2148 timer unit
PID Controllers
Industrial Temperature Controller using Microcontroller
Atmel microcontrollers-a tmega328-p_datasheet
PLC LADDER DIAGRAM
Pid controllers

What's hot (20)

PPT
An Overview of LPC2101/02/03
PPTX
Design and tuning of PID override control system based on signal filtering
PPTX
Tuning presentation v1
PDF
Pi dcontroller
PDF
Pid controller
PPTX
PID Control Basics
PPTX
Enhanced phase width modulation in TMS320F28335D
PDF
PID Temperature Controller
PDF
Lec 12 (cont plc)
PPTX
Pid controller tuning using fuzzy logic
PPTX
Design of fuzzzy pid controller for bldc motor
PDF
PID Controllers
PPTX
ATMEGA 328
PPT
PPTX
Pid controller
PPTX
PID Controller and its design
PPTX
08 pid.controller
PDF
AVR introduction
An Overview of LPC2101/02/03
Design and tuning of PID override control system based on signal filtering
Tuning presentation v1
Pi dcontroller
Pid controller
PID Control Basics
Enhanced phase width modulation in TMS320F28335D
PID Temperature Controller
Lec 12 (cont plc)
Pid controller tuning using fuzzy logic
Design of fuzzzy pid controller for bldc motor
PID Controllers
ATMEGA 328
Pid controller
PID Controller and its design
08 pid.controller
AVR introduction
Ad

Viewers also liked (16)

PDF
Maui Electric Company - The Apocalypse - Keep Calm and Shaka Brah
PPTX
A birthday to remember
PPTX
ประเพณีสงกรานต์
PPTX
ประเพณีสงกรานต์
PPTX
ประเพณีสงกรานต์
PDF
Columbia Community Exchange registration form
PDF
Hawaii State Auditor - AUDIT of Department of Taxation and Hawaii Film Offic...
PPTX
Boggs tract farm work day & raffling garden plots 8 13 11
PDF
Mauna Kea and Mout Fuji - Substantive Significance
PPT
Puentes presentation revised 10_23_11
PPT
K christ linked-in show
PPTX
Invitation material
PDF
No Taxation Without Representation - Message to Governor David Ige, Departme...
PPTX
მეტალები
PDF
Encuesta Keller 4to Trimestre 2016
Maui Electric Company - The Apocalypse - Keep Calm and Shaka Brah
A birthday to remember
ประเพณีสงกรานต์
ประเพณีสงกรานต์
ประเพณีสงกรานต์
Columbia Community Exchange registration form
Hawaii State Auditor - AUDIT of Department of Taxation and Hawaii Film Offic...
Boggs tract farm work day & raffling garden plots 8 13 11
Mauna Kea and Mout Fuji - Substantive Significance
Puentes presentation revised 10_23_11
K christ linked-in show
Invitation material
No Taxation Without Representation - Message to Governor David Ige, Departme...
მეტალები
Encuesta Keller 4to Trimestre 2016
Ad

Similar to Output compare (20)

PPTX
Microcontroller
PDF
Assembler4
PPTX
ESD III UNIT.pptx
PPTX
Basics of Programmable Logical Controllers
PPTX
Timer & Interrupt Atmega16
PPT
PLC Basics programming and easy to learn by yourself
PDF
Timers and Endge-aligned PWM
DOCX
What software commands are used to allow the 9S12 program to receive i (1).docx
PDF
Lecture7
PDF
Microprocessor and microcontroller
PPT
Embedded System Introduction and applications.ppt
PPT
Embedded System intro Embedded System intro.ppt
PPT
Computing systems are everywhere Most of us think of “desktop” computers PC’s...
PPT
An embedded system is a specialized computing system designed to perform a de...
PPT
Introduction to Embedded Systems for beginners
PDF
Microprocessor & Interfacing (Part-2) By Er. Swapnil V. Kaware
PDF
Microcontroller part 2
PDF
Itsp documentation quadcopter flight controller based on kalman filters
PDF
CPU Implemented on an Xilinix FPGA
Microcontroller
Assembler4
ESD III UNIT.pptx
Basics of Programmable Logical Controllers
Timer & Interrupt Atmega16
PLC Basics programming and easy to learn by yourself
Timers and Endge-aligned PWM
What software commands are used to allow the 9S12 program to receive i (1).docx
Lecture7
Microprocessor and microcontroller
Embedded System Introduction and applications.ppt
Embedded System intro Embedded System intro.ppt
Computing systems are everywhere Most of us think of “desktop” computers PC’s...
An embedded system is a specialized computing system designed to perform a de...
Introduction to Embedded Systems for beginners
Microprocessor & Interfacing (Part-2) By Er. Swapnil V. Kaware
Microcontroller part 2
Itsp documentation quadcopter flight controller based on kalman filters
CPU Implemented on an Xilinix FPGA

Output compare

  • 1. Structure of Microcontroller EA, RST, ALE, PSEN ROM COUNTER INPUTS OSC INTERRUPT CONTROL 4 I/O PORTS BUS CONTROL SERIAL PORT EXTERNAL INTERRUPTS CPU ON - CHIP RAM ETC TIMER 0 TIMER 1 ADDRESS/DATA TXD RXD P0 P1 P2 P3
  • 3. What are Interrupts? A hardware event is something that happens in the micro-controller's hardware. An example of an event is the RESET that occurs when pin 9 is set low. Micro-controllers are micro-computers whose architecture has been optimized to respond quickly to external events.
  • 4. Output Compare Interrupts Output compare interrupts are hardware interrupts that are tied to timer events and this means that they can be used by a micro-controller to enforce the real-time processing of events. The output compare event can also be used to effect specific output pins.
  • 5. Output Compare Interrupts In particular, you will use the output compare interrupt to build a system that outputs a specified voltage using a pulse-width modulation scheme.
  • 6. Output Compare Interrupts In the Microcontroller output compare events are tied to a 16-bit hardware register (also called a timer) This register is incremented at a rate that can be specified by the programmer.
  • 7. Output Compare Interrupts When the value of timer register equals the value stored in another output compare register , then an output compare event occurs and the Microcontroller responds by issuing an output compare interrupt . The counter register cannot be reset or stopped by the user.
  • 8. Output Compare Interrupts So to generate timing events, we compare the value in timer register against another number that is held in an output compare register . When the value in timer register matches the number in the output compare register, we trigger an output-compare event .
  • 9. Output Compare Interrupts Output compare events are generated in the micro-controller's hardware. This event will result in a hardware interrupt (also called an output compare interrupt) being generated if the interrupt is enabled
  • 10. Output Compare Interrupts Enabling the interrupt means that the software pays attention to the interrupt. We enable all interrupts by setting the I bit in the condition code register of the micro-controller. This is bit is usually set in the init() function
  • 11. IEN0 - Interrupt enable register 0
  • 12. CMOD - PCA counter mode register (address D9H) bit allocation
  • 13. CMOD - PCA counter mode register (address D9H) bit allocation
  • 14. CCON - PCA counter control register (address 0D8H) bit description
  • 15. CCON - PCA counter control register (address 0D8H) bit description
  • 16. CCAPMn - PCA modules compare/capture register
  • 17. CCAPMn - PCA modules compare/capture register
  • 19. PCA IN COMPARE MODE The 16-bit software timer mode is used to trigger interrupt routines, which must occur at periodic intervals. It is setup by setting both the ECOM and MAT bits in the module’s CCAPMn register
  • 20. PCA IN COMPARE MODE The PCA timer will be compared to the module’s capture registers (CCAPnL and CCAPnH) when a match occurs, an interrupt will occur, if the ECCFn (CCAPMn SFR) bit for the module is set.
  • 21. XEM VÍ DỤ MÔ PHỎNG vd3 Output Compare