EasyManua.ls Logo

STC micro STC8A8K64D4 Series - Timer 2 (16-Bit Auto Reload)

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
- 327 -
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.16 Timer 2 (16-bit auto reload)
C language code
//Operating frequency for test is 11.0592MHz
#include "reg51.h"
#include "intrins.h"
sfr T2L = 0xd7;
sfr T2H = 0xd6;
sfr AUXR = 0x8e;
sfr IE2 = 0xaf;
#define ET2 0x04
sfr AUXINTIF = 0xef;
#define T2IF 0x01
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;
sfr P4M0 = 0xb4;

Table of Contents

Related product manuals