Download Print this page

STC micro STC8A8K64D4 Series Reference Manual page 201

Advertisement

STC8A8K64D4 Series Manual
Only two functions are required in the LCD scanning program:
1. LCD segment code scan function
void
LCD_scan(void)
The program calls this function at a certain interval, and it will display the contents of the LCD display buffer on the LCD.
It takes 8 calling cycles to scan all of them. The calling interval is generally 1~ 2ms. The scanning cycle is 8ms if 1ms is used.
The refresh rate is 125Hz.
2. LCD segment code display buffer loading function
void LCD_load(u8 n,u8 dat)
This function is used to put the displayed numbers or characters in the LCD display buffer. For example, LCD_load (1,6)
is to display the number 6 at the first digit position. It supports the display of 0 ~ 9, A ~ F. You can add them by yourself if
you need other characters.
In addition, macros are used to display, extinguish, or flash colons or decimal points.
C language code
/*****************Function description******************
STC15 series of microcontrollers are used to test segment LCD driven by I/O directly (6 8-word LCDs, 1/4 Dutys, 1/3 bias).
Time (hours, minutes and seconds) is displayed after power-on.
P3.2 is connected to ground via a switch to enter sleep or wake up.
******************************************/
#include "reg51.h"
#include "intrins.h"
typedef
unsigned char
typedef
unsigned int
typedef
unsigned long
sfr AUXR = 0x8e;
sfr P1M1 = 0x91;
sfr P1M0 = 0x92;
sfr P2M1 = 0x95;
sfr P2M0 = 0x96;
/********************Local constant declaration**************************/
u8;
u16;
u32;
-
- 185 -

Advertisement

loading
Need help?

Need help?

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

Questions and answers

This manual is also suitable for:

Micro stc8a8k64d4-64pinMicro stc8a8k64d4-48pin