Interrupt Response

Publisher:心灵之舞Latest update time:2011-02-25 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

;Knowledge point: Application of interruption; 1khz means inverting once every 500us

; t1 is mode 0, then m1m0=00h, use timer c/t=0 gate=0

; Mode 0 is a 13-bit timer, the total time is 2 to the 13th power of microseconds. = 8192 microseconds, minus 500 microseconds = 7692

;1111000001100 is converted to hexadecimal, the high 8 bits are equal to 0fh and the low 8 bits are 0ch

; Note: These two fields are not continuous. The lower 8 bits 01100 are filled with 0 before calculation.

;For beginners, please practice more to master the calculation method, and use an oscilloscope to check the frequency if possible

; The basic condition for interrupt response is that there is an interrupt request, the corresponding position of the interrupt enable register is 1, and the total interrupt open ea=1

;Once the response is interrupted, only the breakpoint is protected but not the scene, so the scene should be protected in general.

ORG 0000H;

LJMP MAIN;

ORG 001BH; jump to interrupt entry

LJMP INSER; to the interrupt service routine

ORG 030H;

MAIN: MOV TMOD,#00H;ti working mode 0

MOV TH1,#0F0H; load initial value

MOV TL1,#0CH;

SETB EA; Enable interrupt

SETB ET1; Timer t1 is enabled

LOOP: SETB TR1; start timer

HERE: SJMP HERE; Wait for interrupt, virtual main program, other programs can be inserted here

ORG 0200H; interrupt service routine starts from 200h

INSER: MOV TH1,#0F0H; reload the timing initial value

MOV TL1,#0CH;

CPL P3.3; reverse small speaker

RETI; interrupt return

END
Reference address:Interrupt Response

Previous article:Application of counter
Next article:Interrupt response, two-level interrupt nesting, interrupt priority setting

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号