tmr0 equ 01h pcl equ 02h status equ 03h option_reg equ 81h intcon equ 0bh portc equiv 07h trisc equ 87h tmr0data equ 15h count equ 20h rp0 equ 5h org 0000h nop goto main org 0005h main nop bsf status,rp0 movlw 00h movwf trisc movlw 07h movwf option_reg bcf status,rp0 clrf count walk1 movf count,0 call read movwf portc incf count,1 movlw 0fh andwf count,1 call delay call delay call delay call delay call delay call delay call delay goto loop1 delay bcf intcon,2 movlw tmr0data movwf tmr0 delay1 btfss intcon,2 goto delay1 return read addwf pcl,1 retlw b'10000000' retlw b'11000000' retlw b'11100000' retlw b'11110000' retlw b'11111000' retlw b'11111100' retlw b'11111110' retlw b'11111111' retlw b'11111110' retlw b'11111100' retlw b'11111000' retlw b'11110000' retlw b'11100000' retlw b'11000000' retlw b'10000000' retlw b'00000000' end
This program uses TMR0 of 16F877A. For specific settings, please look up the function descriptions of INTCON, OPTION_REG, TMR0 and other related special working registers in 16F877C. I recommend the PIC microcontroller practical tutorial written by Mr. Li Xuehai.
Previous article:Design of pressure control system in closed container based on single chip microcomputer
Next article:Application of PIC microcontroller in aircraft refueling system
Recommended ReadingLatest update time:2024-11-16 15:19
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Application of siwave in single board PI design
- I would like to ask, the output waveform of the power amplifier is more than 180 degrees out of phase with the input waveform. What is going on?
- AD+FPGA+asynchronous FIFO+CMI+SPI code
- Using FSMC bus for inter-chip communication
- I'm a newbie. I don't understand. I'm asking for help on the problem I encountered when making a spi receiving module in Verilog.
- How feasible is it for the United States to skip 5G and go directly to 6G?
- 77 GHz Radar Solutions
- Showing Goods (7) - Open Source Development Board
- New version of IAR installation problems and solutions
- arm assembly instructions WFI and WFE