STC8A8K64D4 Series Manual
-
SETB BUSY
MOV SBUF,A
RET
MAIN:
MOV SP, #5FH
MOV P0M0, #00H
MOV P0M1, #00H
MOV P1M0, #00H
MOV P1M1, #00H
MOV P2M0, #00H
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 P_SW2,#80H
MOV DPTR,# VREF_ADDR
CLR A
MOVX A,@DPTR ; Read the high byte of the internal 1.19V reference signal source
LCALL UART_SEND
INC DPTR
MOVX A,@DPTR ; Read the low byte of the internal 1.19V reference signal source
LCALL UART_SEND
LOOP:
JMP LOOP
END
7.5.2 Read Internal Referrence Voltage (from Flash)
C language code
//Operating frequency for test is 11.0592MHz
#include "reg51.h"
#include "intrins.h"
#define FOSC 11059200UL
#define BRT (65536 - FOSC / 115200 / 4)
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;
sfr P4M0 = 0xb4;