Single chip cross rotating LED program

Publisher:平静宁静Latest update time:2016-01-14 Source: eefocusKeywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
  

 

 

     ORG 0000H     
MAIN:  MOV DPTR,#TAB
       MOV R2,#0
MM:    MOV  A,R2
       MOVC A,@A+DPTR
      lcall hbit
       CPL A
       MOV R4,A
       INC R2            
       MOV A,R2
       MOVC A,@A+DPTR
       lcall hbit
       CPL A
        MOV R3,A
       INC R2 

      MOV P0,R4
      MOV P2,R3
      DJNZ R6,$
      DJNZ R6,$       
      MOV A,R2
      CJNE A,#128,mm    ; 128 represents the length of four Chinese characters, 1 Chinese character is 32, 2 Chinese characters are 64----8 characters can reach 255.
      LJMP main

 hbit:    ;字符颠倒
mov c,acc.0
mov b.7,c
mov c,acc.1
mov b.6,c
mov c,acc.2
mov b.5,c
mov c,acc.3
mov b.4,c
mov c,acc.4
mov b.3,c
mov c,acc.5
mov b.2,c
mov c,acc.6
mov b.1,c
mov c,acc.7
mov b.0,c
mov a,b
ret


TAB:      ;Specific display content, here are 4 Chinese characters
db 08h,20h,06h,20h,80h,7eh,63h,80h
db 0ch,04h,00h,04h,20h,04h,20h,04h
db 20h,04h,3fh,0fch,20h,04h,20h,04h
db 20h,04h,20h,04h,00h,04h,00h,00h
db 20h,00h,20h,02h,22h,32h,22h,0e4h
db 22h,08h,0fah,30h,22h,0e0h,2fh,80h
db 22h,04h,0fah,02h,22h,02h,23h,0fch
db 20h,00h,20h,40h,20h,30h,00h,00h
db 20h,00h,20h,00h,27h,0feh,24h,20h
db 24h,0a0h,26h,0a0h ,2dh,0a0h,0f4h,0feh
db 24h,0a0h,25h,0a0h,26h,0a0h,24h,0a4h
db 24h,22h,67h,0fch,20h,00h,00h,00h
db 00h,00h,20h,04h,20h,08h,27h,9
8hdb 24h,0b0h,24h,82h,0a4h,81h,64h,0feh
db 24h,80h,24h,80h,24h,0a0h,27h,0b0h
db 60h,1ch,20h,08h,00h,00h,00h,00h
    

 end

Keywords:MCU Reference address:Single chip cross rotating LED program

Previous article:51 MCU Introduction 1
Next article:A little discussion on C51 interrupt programming

Recommended ReadingLatest update time:2024-11-16 14:38

Multi-task mechanism and its application based on 51 single chip microcomputer
1 Introduction Traditional single-chip microcomputer programs generally use a single-task mechanism. Single-task systems have the advantages of being simple, intuitive, and easy to control. However, since programs can only be executed sequentially, they lack flexibility and can only use interrupt functions
[Microcontroller]
51 MCU timer and interrupt programming
P2.0~P2.2 are connected to independent buttons K0, K1, and K2 respectively. P1 is connected to 8 LEDs, which light up when the output is low level. Require: Press the K1 key, P1.7 outputs a square wave with a period of 1s; Press K2 key, P1 outputs circulating water light, every 2 lights are on for 0.5s; Press the K0
[Microcontroller]
51 MCU timer and interrupt programming
UIP of MCU--TCP acts as a server and actively sends data ACK
TCP under uip acts as a server and actively sends data === I have been working on this recently. It is so tiring to find information on the Internet, and the descriptions are all vague and there are no examples. I really can't stand it. I finally figured it out and now I'm going to share it. 1. Add the pin definition
[Microcontroller]
UIP of MCU--TCP acts as a server and actively sends data ACK
Design of formaldehyde concentration detector based on 51 microcontroller
1. System Overview The modules used in the system include AT89C51 microcontroller + LCD1602 display + ADC0832 (simulating MQ-4 to detect formaldehyde concentration value) + buzzer alarm + small light + button. This design uses 51 microcontroller as the core control, and uses LCD1602 to display the formaldehyde conce
[Microcontroller]
Design of formaldehyde concentration detector based on 51 microcontroller
PIC16f877a MCU DS18b20 source code
//Debug summary: //The obvious problem is that in the write timing and read timing, the PIC MCU writes 1 to the bus by changing the direction to the input direction and pulling up the data line with a pull-up resistor, rather than outputting 1 in the output direction, which is different from AVR. //When the 8 bits of
[Microcontroller]
Design of Franck-Hertz Experimental Instrument Based on Single Chip Microcomputer
1 Introduction The Franck-Hertz experiment is a very important experiment in modern physics. Under certain conditions (mainly a certain first grid voltage UG1K, blocking voltage UG2P, and filament voltage UF), the relationship between the anode current IP and the second grid voltage UG2P is studied, and the exis
[Microcontroller]
Design of Franck-Hertz Experimental Instrument Based on Single Chip Microcomputer
Design of vehicle-mounted supercapacitor testing system based on microcontroller
With the advancement of science and technology, electric vehicle technology has developed rapidly. Compared with internal combustion engine vehicles, electric vehicles have the advantages of zero emissions, high performance and efficiency, low noise, low heat radiation, easy operation and easy maintenance, and will be
[Test Measurement]
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号