#INCLUDE"P16F877.inc"
Reference address:PIC microcontroller digital tube program
ORG 000H GOTO A1 ORG 0CH A1 MOVLW 1; bit 1 displays the number MOVWF 50H; MOVLW 2; bit 2 displays the number MOVWF 51H; MOVLW 3; bit 3 displays the number MOVWF 52H; MOVLW 4; bit 4 displays the number MOVWF 53H; MOVLW 4; Display digits MOVWF 40H; MOVLW B'00000001'; bit code MOVWF 41H; MOVLW 50H; MOVWF FSR ; indirect addressing A2 BSF STATUS,RP0;body1 BCF STATUS,RP1; MOVLW 0; MOVWF TRISB; RB port is set as output port MOVWF TRISD; RD port is set as output port BCF STATUS,RP0;body0 BCF STATUS,RP1; MOVLW 0FFH; MOVWF PORTB; RB port outputs high level MOVLW 0 MOVWF PORTD; RD port outputs low level to clear the screen MOVFW INDF; indirect addressing display data CALL Q1; check the data table MOVWF PORTB; Display the broken code output to port RB INCF FSR,1; Indirect addressing address plus 1 MOVFW 41H ; bit code MOVWF PORTD; bit code output to RD port RLF 41H,0; Process C RLF 41H,1; left shift code CALL M001; Delay DECFSZ 40H,1; Determine whether the 4 bits are displayed GOTO A2; otherwise continue to display GOTO A1; is to return ;********************************************* ; Delay subroutine ;********************************************* M001 MOVLW 2 MOVWF 30H M002 MOVLW 250 MOVWF 31H DECFSZ 31H,1 GOTO $-1 DECFSZ 30H, 1 GOTO M002 RETURN ;******************************************** ; data sheet ;******************************************** Q1 ADDWF PCL,1 RETLW 00C0H ;0 RETLW 00F9H ;1 RETLW 00A4H ;2 RETLW 00B0H ;3 RETLW 0099H ;4 RETLW 0092H ;5 RETLW 0082H ;6 RETLW 00F8H ;7 RETLW 0080H ;8 RETLW 0090H ;9 RETLW 0088H ;A RETLW 0083H ;B RETLW 00C6H ;C RETLW 00A1H ;D RETLW 0086H ;E RETLW 008EH ;F END
Previous article:PIC microcontroller flashing program
Next article:PIC microcontroller external interrupt
- Popular Resources
- Popular amplifiers
Recommended Content
Latest Microcontroller Articles
He Limin Column
Microcontroller and Embedded Systems Bible
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
MoreSelected Circuit Diagrams
MorePopular Articles
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
MoreDaily News
- Keysight Technologies Helps Samsung Electronics Successfully Validate FiRa® 2.0 Safe Distance Measurement Test Case
- Innovation is not limited to Meizhi, Welling will appear at the 2024 China Home Appliance Technology Conference
- Innovation is not limited to Meizhi, Welling will appear at the 2024 China Home Appliance Technology Conference
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Download from the Internet--ARM Getting Started Notes
- Learn ARM development(22)
- Learn ARM development(21)
- Learn ARM development(20)
- Learn ARM development(19)
- Learn ARM development(14)
Guess you like
- Reading SHT3x with ESP8266
- [Hua Diao Experience] 13 Building the PlatformIO IDE development environment for ESP32C3
- Learning is polite, sharing is polite! Follow Xiaomei and learn about Intel SoC FPGA!
- Effects of Differential Input Clamping on Operational Amplifiers
- High-speed and high-precision motion controller using DSP+FPGADSP+FPGA
- About Passive Filtering
- Add heat dissipation and screen to ART-Pi
- ADI MEMS promotes the development of inclination monitoring, answer questions and win gifts!
- I want to make a circuit that outputs three states, please help
- [Perf-V Review] Flowing Light & Verilog Basic Syntax