| Datenblatt-Suchmaschine für elektronische Bauteile |
|
STC89LE53RC Datenblatt(PDF) 99 Page - STCmicro Technology Co,.Ltd |
|
|
|||||||||||||||||||||||||||||
STC89LE53RC Datenblatt(HTML) 99 Page - STCmicro Technology Co,.Ltd |
|
99 / 165 page ![]() ;Define LED indicator LED_MCU_START EQU P1.7 ;MCU operating LED indicator ;------------------------------------------------------------------------------------------------------------------------- ORG 0000H AJMP MAIN ;------------------------------------------------------------------------------------------------------------------------- ORG 0023H AJMP UART_Interrupt ;Jump into RS232 UART-Interrupt service subroutine NOP NOP ;-------------------------------------------------------------------------------------------------------------------------- MAIN: MOV SP, #7FH ;Set stack pointer CLR LED_MCU_START ;Turn on MCU operating LED indicator ACALL Initial_UART ;Initialize UART MOV R0, #30H ;30H = the ASCII code of printable character '0' MOV R2, #10 ;Send ten characters '0123456789' LOOP: MOV A, R0 ACALL Send_One_Byte ;Send one byte ; if Character-Display, display '0123456789' ;if Hexadecimal-Display, display '30 31 32 33 34 35 36 37 38 39' INC R0 DJNZ R2, LOOP MAIN_WAIT: SJMP MAIN_WAIT ;infinite circle ;---------------------------------------------------------------------------------------------------------------------------- UART_Interrupt: ;UART-Interrupt service subroutine JB RI, Is_UART_Receive CLR TI ;Clear serial port transmit interrupt flag RETI Is_UART_Receive: CLR RI PUSH ACC MOV A, SBUF ;acquire the received byte ACALL Send_One_Byte ;re-send the received byte POP ACC RETI ;----------------------------------------------------------------------------------------------------------------------- Initial_UART: ;Initialize UART ;SCON Bit: 7 6 5 4 3 2 1 0 ; SM0/FE SM1 SM2 REN TB8 RB8 TI RI MOV SCON, #50H ;0101,0000 8-bit variable baud rate,no odd parity bit MOV TMOD, #21H ;Use Timer 1 as 8 bit auto-reload counter MOV TH1, #RELOAD_COUNT ;Set auto-reload count of Timer 1 MOV TL1, #RELOAD_COUNT ;---------------------------------------------------------------------------------------------------------------------- ; ORL PCON, #80H ;baud rate double 99 |
|
Link URL |
| War ALLDATASHEET hilfreich? [ DONATE ] |
Über Alldatasheet | Werbung | Kontakt | Privatsphäre und Datenschutz | Link zum Datenblatt | Linktausch | Hersteller All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |