Download Print this page

Uart1 Using T1 (Mode 2) As Baud Rate Generator - STC micro STC8A8K64D4 Series Reference Manual

Advertisement

STC8A8K64D4 Series Manual
RET
MAIN:
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
LCALL
SETB
SETB
MOV
LCALL
LOOP:
MOV
XRL
ANL
JZ
MOV
ANL
ADD
MOV
MOV
LCALL
INC
JMP
STRING:
DB
END

14.8.3 UART1 using T1 (Mode 2) as baud rate generator

C language code
//Operating frequency for test is 11.0592MHz
#include "reg51.h"
#include "intrins.h"
#define
FOSC
11059200UL
#define
BRT
(256 - FOSC / 115200 / 32)
sfr
AUXR
=
SP, #5FH
P0M0, #00H
P0M1, #00H
P1M0, #00H
P1M1, #00H
P2M0, #00H
P2M1, #00H
P3M0, #00H
P3M1, #00H
P4M0, #00H
P4M1, #00H
P5M0, #00H
P5M1, #00H
UART_INIT
ES
EA
DPTR,#STRING
UART_SENDSTR
A,RPTR
A,WPTR
A,#0FH
LOOP
A,RPTR
A,#0FH
A,#BUFFER
R0,A
A,@R0
UART_SEND
RPTR
LOOP
'Uart Test !',0DH,0AH,00H
0x8e;
- 397 -

Advertisement

loading
Need help?

Need help?

Do you have a question about the micro STC8A8K64D4 Series and is the answer not in the manual?

This manual is also suitable for:

Micro stc8a8k64d4-64pinMicro stc8a8k64d4-48pin