In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-05-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the relevant knowledge of "what is the method of realizing interrupt counting in C language". In the operation process of actual cases, many people will encounter such difficulties. Next, let Xiaobian lead you to learn how to deal with these situations! I hope you can read carefully and learn something!
#include void init(){ //Because the interrupt TF1 will be automatically cleared by hardware, it can be left alone here. P1 = 0xff; //Set the light off TMOD = 0x5f; //Set Counter 1 to work in Counter Mode, Mode 1 TH1 = 0xff; TL1 = 0xfb; TR1 = 1; //Counter 1 available EA = 1; //interrupt allowed ET1 =1; //Allow counter 1 interrupt}void main(){ init(); while(1){}}void yetinterrupt() interrupt 3{ P1 = 0xfe; //Set light on while(TL1 == 0x00) {} //Wait for the 6th press init();}
assembly language edition
ORG 0000HLJMP MAINORG 001BHLJMP IR_T1MAIN: SETB P1.O ACALL INIT_T1WAIT: JMP WAIT ; loop wait; initialize counter 1INIT_T1: MOV TMOD, #50H ; Set T1 working mode 1 count MOV TH1, #0FFH MOV TL1, #0FBH SETB EA SETB ET1 SET TR1 RET; Interrupt register service IR_T1: CLR P1.0LOOP: MOV A, TL1 JZ LOOP ; A register equals 0 jump SETB P1.0 LCALL INIT_T1 RETIEND"C language implementation interrupt counting method is what" the content is introduced here, thank you for reading. If you want to know more about industry-related knowledge, you can pay attention to the website. Xiaobian will output more high-quality practical articles for everyone!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
File name: checkbox.htmlCheckbox Checkbox < / h4 >
© 2024 shulou.com SLNews company. All rights reserved.