EasyManua.ls Logo

STC micro STC8A8K64D4 Series - Page 201

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
-
- 185 -
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 u8;
typedef unsigned int u16;
typedef unsigned long u32;
sfr AUXR = 0x8e;
sfr P1M1 = 0x91;
sfr P1M0 = 0x92;
sfr P2M1 = 0x95;
sfr P2M0 = 0x96;
/********************Local constant declaration**************************/

Table of Contents

Related product manuals