Chapter 7 Interrupt
This presentation is the property of its rightful owner.
Sponsored Links
1 / 15

Chapter 7 Interrupt PowerPoint PPT Presentation


  • 91 Views
  • Uploaded on
  • Presentation posted in: General

Chapter 7 Interrupt. จุดประสงค์ : เพื่อศึกษากลไกการทำงานของการขัดจังหวะ ( Interrupt ) ในระบบ Microprocessor และสามารถใช้งานการขัดจังหวะในระบบ MCS-51 ได้.

Download Presentation

Chapter 7 Interrupt

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Chapter 7 interrupt

Chapter 7 Interrupt

: ( Interrupt ) Microprocessor MCS-51


Chapter 7 interrupt

Timer Overflow Serial Port 2

Pulling : JNBTF0,$ Timer 0 Overflow

Interrupt : ( Interrupt) Overflow


Chapter 7 interrupt

( Interrupt ) CALL

JMP


Chapter 7 interrupt

Interrupt

Interrupt


Chapter 7 interrupt

(Interrupt)

Interrupt Vector Interrupt Interrupt Service Routine

MCS-51 Interrupt 5

( 6 8052)


Chapter 7 interrupt

Interrupt Vector Interrupt


Chapter 7 interrupt

Register

IE : Interrupt Enable Register

A8H

MSB

LSB

EA : DisableInterrupt 0 Interrupt 1 Enable/Disable Interrupt source

ET2: Enable Timer2Interrupt 1 Interrupt Timer2 Overflow


Chapter 7 interrupt

ES : Enable Serial Port 1 Interrupt Serial Port

ET1 : Enable Timer1Interrupt 1 Interrupt Timer2 Overflow

EX1 : Enable ExternalInterrupt 1 Interrupt INT1 0 1 0 IT1 TCON

ET0 : Enable Timer0Interrupt 1 Interrupt Timer0 Overflow

EX0 : Enable ExternalInterrupt 1 Interrupt INT0 0 1 0 IT0 TCON


Chapter 7 interrupt

IP : Interrupt Priority

0B8H

MSB

LSB

Interrupt Interrupt

( priority)

Interrupt

IP


Chapter 7 interrupt

  • Interrupt MCS-51

  • IE0

  • TF0

  • IE1

  • TF1

  • RI+TI


Chapter 7 interrupt

High Priority

Interrupt

MCS-51


Chapter 7 interrupt

Example

Interrupt External Interrupt 0 LED P1.0 Toggle

$MOD51

ORG 8000H

JMP START

ORG8003H

JMPEX0_ROUTINE

ORG 8100H

START: SETBIT0

MOVIE,#81H

JMP $

EX0_ROUTINE: CPL P1.0

RETI

END


Chapter 7 interrupt

Clock Timer Interrupt

$MOD51; Use 8051 Directive

ORG 0000H; Code Start at Address 0000H

JMP START; Go to Start Label

ORG 000BH

JMPTimer0_Routine

ORG 0100H; Code Start at Address 0000H

START: MOV TMOD,#01H; Timer0 Mode 1 :16Bit Timer

MOV TH0,#0DCH; Initial for Timer0 High Byte

MOV TL0,#00H; Initial for Timer0 Low Byte

MOV IE,#82H; Timer0 Interrupt Enable

SETB TR0; Start Timer0 Run

LOOP: JMP$


Chapter 7 interrupt

Timer0_Routine: MOVTH0,#0DCH;Reloaded TH0

MOVTL0,#00H;Reloaded TL0

CPL P1.7; Complement P1.7

RETI

END


  • Login