/***************SC92F7323+LCD88888*****************/
/***************QQ:74145445************************/
/*************快手:共同学习STM8********************/
/*************keiluvision2*************************/
/*************20210808*****************************/
/**************************************************/
// lcd88888
//|1|2|3|4|5|6|7|8|9|10|11|12|com4|com3|com2|com1|
//SC92F7323 ________ ________
// 5V-|1 /VDD \_/ P0.0/28|-com_0
// 0V-|2 /VSS P0.1/27|-com_1
// -|3 /P5.1 P0.2/26|-com_2
// -|4 /P5.0 P0.3/25|-com_3
// -|5 /P1.0 P0.4/24|-lcd_1
// -|6 /P1.1 P0.5/23|-lcd_2
// TCK-|7 /P1.2 P0.6/22|-lcd_3
// TDIO-|8 /P1.3 P0.7/21|-lcd_4
// -|9 /P1.4 P2.0/20|-lcd_5
// -|10/P1.5 P2.1/19|-lcd_6
// -|11/P1.6 P2.2/18|-lcd_7
// beiguang-|12/P1.7 P2.3/17|-lcd_8
// lcd_12-|13/P2.7 P2.4/16|-lcd_9
// lcd_11-|14/P2.6______P2.5/15|-lcd_10
/**************************************************/
/**************************************************/
/**************************************************/
#include <SC92F732x_C.H>
sbit led =P1^0;
sbit lcd_1 =P0^4;
sbit lcd_2 =P0^5;
sbit lcd_3 =P0^6;
sbit lcd_4 =P0^7;
sbit lcd_5 =P2^0;
sbit lcd_6 =P2^1;
sbit lcd_7 =P2^2;
sbit lcd_8 =P2^3;
sbit lcd_9 =P2^4;
sbit lcd_10 =P2^5;
sbit lcd_11 =P2^6;
sbit lcd_12 =P2^7;
#define bit0 0x01
#define bit1 0x02
#define bit2 0x04
#define bit3 0x08
#define bit4 0x10
#define bit5 0x20
#define bit6 0x40
#define bit7 0x80
#define com1_gao P0VO &= ~bit0; P00=1;
#define com1_ban P0VO |=bit0;
#define com1_di P0VO &= ~bit0; P00=0;
#define com2_gao P0VO &= ~bit1; P01=1;
#define com2_ban P0VO =1;
#define com2_di P0VO &= ~bit1; P01=0;
#define com3_gao P0VO &= ~bit2; P02=1;
#define com3_ban P0VO |=bit0;
#define com3_di P0VO &= ~bit2; P02=0;
#define com4_gao P0VO &= ~bit3; P03=1;
#define com4_ban P0VO |=bit0;
#define com4_di P0VO &= ~bit3; P03=0;
/**************************************************/
void lcd_xianshi(); //lcd显示
void yanshi(); //延时
/**************************************************/
void main()
{
/**************************************************/ //液晶初始化
P0 |=bit0|bit1|bit2|bit3|bit4|bit5|bit6|bit7;
OTCON =0x80; //分压电阻37.5k
/**************************************************/
P01=0;
while (1)
{
lcd_xianshi();
}
}
/**************************************************/
void lcd_xianshi() //lcd显示
{
com1_gao;
com2_ban;
com3_ban;
com4_ban;
lcd_1 =0;
lcd_2 =0;
lcd_3 =0;
lcd_4 =0;
lcd_5 =0;
lcd_6 =0;
lcd_7 =0;
lcd_8 =0;
lcd_9 =0;
lcd_10 =0;
lcd_11 =0;
lcd_12 =0;
//while(1);
com1_ban;
com2_gao;
com3_ban;
com4_ban;
com1_ban;
com2_ban;
com3_gao;
com4_ban;
com1_ban;
com2_ban;
com3_ban;
com4_gao;
yanshi();
com1_di;
com2_ban;
com3_ban;
com4_ban;
lcd_1 =1;
lcd_2 =1;
lcd_3 =1;
lcd_4 =1;
lcd_5 =1;
lcd_6 =1;
lcd_7 =1;
lcd_8 =1;
lcd_9 =1;
lcd_10 =1;
lcd_11 =1;
lcd_12 =1;
com1_ban;
com2_di;
com3_ban;
com4_ban;
com1_ban;
com2_ban;
com3_di;
com4_ban;
com1_ban;
com2_ban;
com3_ban;
com4_di;
yanshi();
}
/**************************************************/
/**************************************************/
/**************************************************/
void yanshi() //延时
{
unsigned int x,y;
for(x=200;x>0;x--)
for(y=200;y>0;y--);
}
/**************************************************/ |