EasyManua.ls Logo

STC micro STC8A8K64D4 Series - Timer 1 (Mode 2) Is Used as Baud Rate Generator of UART1

Default Icon
901 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
STC8A8K64D4 Series Manual
- 323 -
MOV P2M1, #00H
MOV P3M0, #00H
MOV P3M1, #00H
MOV P4M0, #00H
MOV P4M1, #00H
MOV P5M0, #00H
MOV P5M1, #00H
LCALL UART_INIT
SETB ES
SETB EA
MOV DPTR,#STRING
LCALL UART_SENDSTR
LOOP:
MOV A,RPTR
XRL A,WPTR
ANL A,#0FH
JZ LOOP
MOV A,RPTR
ANL A,#0FH
ADD A,#BUFFER
MOV R0,A
MOV A,@R0
LCALL UART_SEND
INC RPTR
JMP LOOP
STRING: DB 'Uart Test !',0DH,0AH,00H
END
13.5.15 Timer 1 (Mode 2) is used as baud rate generator of UART1
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 = 0x8e;
sfr P0M1 = 0x93;
sfr P0M0 = 0x94;
sfr P1M1 = 0x91;
sfr P1M0 = 0x92;
sfr P2M1 = 0x95;
sfr P2M0 = 0x96;
sfr P3M1 = 0xb1;
sfr P3M0 = 0xb2;
sfr P4M1 = 0xb3;

Table of Contents

Related product manuals