Interrupt
The timer is the most basic functional device of the 51 single-chip microcomputer, and it is very important to master its programming method;
#include #include unsigned char n=0,f=0,s=0; void main() { TMOD=0X61; TH0=(65536-9216)/256; TL0=(65536-9216)%256; initialize the timer TH1=156; TL1=156; IT0=1; EX0=1; EA=1; T1=0; while(1)P1=s; } void Timer0() interrupt 1 { T1=1; TH0=(65536-9216)/256; TL0=(65536-9216)%256; T1=0; } void Timer1() interrupt 3 { s++; } void interrupt1(void) interrupt 0 { if(f==0){ TR1=1;TR0=1; ET1=1;ET0=1; f=1; } else if(f==1) { TR1=0;TR0=0; ET1=0;ET0=0; f=0; } }
Previous article:Two-phase stepping motor control system based on 51 single chip microcomputer
Next article:Proteus simulation of 8255 parallel I/O expansion experiment based on 51 single chip microcomputer
Recommended posts
- 【Follow me Season 2 Episode 4】 Mission Memo
- EventHomePage HerearethepartsIboughtforthisevent: Theslightlyembarrassingthingisthatthebuzzerinterfacedoesn'tseemtobecompatiblewiththe2.54Dupontline,soitmaynotbeveryconvenienttouseabreadboard.Irealize
- eew_kTvRL7 DigiKey Technology Zone
- AC Servo System Design Guide
- Thisbookaimstoguidedesign.Itstartswithservomotorsandtheirmodels,andthengraduallyexpandstomaincircuits,PWMdrivecontrol,currentandpositionsensors,closed-loopcontrolstructures,andthentocontrolstrategies,controlalgor
- arui1999 Download Centre
- [Program source code] Freescale MAPS-K64 development board program example
- TodayIwouldliketosharewithyoumyprogramexamplesonFreescaleMAPS-K64developmentboard. FreescaleMK64FN1M0VLQ12microcontrollerfeatures: BasedonARMCortex-M4processor,120MHzmainfrequency,integratedDSPinstructions,FPU
- annysky2012 NXP MCU
- Scaling of DSP data
- DSPfixed-pointarithmeticoperation 1Numbercalibration Infixed-pointDSPchips,fixed-pointnumbersareusedfornumericalcalculations,andtheiroperandsaregenerallyrepresentedbyintegers.Themaximumrepresentationrangeofanintegerd
- fish001 DSP and ARM Processors
- Qorvo breaks power barrier with 10W Ka-band GaN amplifier
- Qorvo,Inc.,aleadingproviderofcoretechnologiesandRFsolutionsformobile,infrastructureanddefenseapplications,todayannouncedthelaunchofanMMICpoweramplifierthatdeliversover10wattsofsaturatedpowerinthe32-38GHzfre
- Jacktang RF/Wirelessly
- Embedded Qt-Table Usage Test
- ThisarticleintroducestheuseoftablecomponentsinQt,whichrequirestheuseofQTableWidget. Let'sintroduceQTableWidgetthroughanexample.Thefollowingfigureshowsthetesteffectofthetable. 1QTableWidget QTableWidgetisata
- DDZZ669 ARM Technology
- Popular Resources
- Popular amplifiers
- 西门子S7-12001500 PLC SCL语言编程从入门到精通 (北岛李工)
- Siemens Motion Control Technology and Engineering Applications (Tongxue, edited by Wu Xiaojun)
- MCU C language programming and Proteus simulation technology (Xu Aijun)
- 100 Examples of Microcontroller C Language Applications (with CD-ROM, 3rd Edition) (Wang Huiliang, Wang Dongfeng, Dong Guanqiang)
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- Europe's three largest chip giants re-examine their supply chains
- Breaking through the intelligent competition, Changan Automobile opens the "God's perspective"
- The world's first fully digital chassis, looking forward to the debut of the U7 PHEV and EV versions
- Design of automotive LIN communication simulator based on Renesas MCU
- When will solid-state batteries become popular?
- Adding solid-state batteries, CATL wants to continue to be the "King of Ning"
- The agency predicts that my country's public electric vehicle charging piles will reach 3.6 million this year, accounting for nearly 70% of the world
- U.S. senators urge NHTSA to issue new vehicle safety rules
- Giants step up investment, accelerating the application of solid-state batteries
- Guangzhou Auto Show: End-to-end competition accelerates, autonomous driving fully impacts luxury...
- Try the flexible ink screen
- What does a 5G base station look like? This article will help you find out!
- Help! Is there a suitable sensor?
- 3 UCOS time management
- Design of intelligent robot for home medical care based on Bluetooth and DSP
- [NXP Rapid IoT Review] +9. Experience of using NXP Rapid IOT
- The issue of volume size and capacity of audio transformers
- Three-phase AC source phase sequence detection protector integrated circuit TH221A without neutral line
- There is a problem with the loss of magnetic components in switching power supplies
- Hello August!