视频地址https://www.bilibili.com/video/BV1ca4y1a7MF/
/*应广单片机编程第6季PMS154CLCD驱动01VDD/2*/
#include "extern.h"
feng bit pa.0;
lcd_1 bit pa.3;
lcd_2 bit pa.4;
lcd_a bit pb.0;
lcd_b bit pb.1;
lcd_c bit pb.2;
lcd_d bit pb.3;
lcd_e bit pb.4;
lcd_f bit pb.5;
lcd_g bit pb.6;
lcd_dp bit pb.7;
#define lcd1gao $ lcd_1 out,high //输出高
#define lcd1di $ lcd_1 out,Low //输出低
#define lcd1ban $ lcd_1 in //输出半电位
void FPPA0 (void)
{
.ADJUST_IC SYSCLK=IHRC/4 // SYSCLK=IHRC/4
//misc =0b0001_0000;
$ MISC LCD_Enable; //使能VDD/2
$ feng out,Low;
lcd1gao;
lcd_a =1;
lcd_a =0;
lcd1di;
lcd_a =1;
lcd_a =0;
lcd1ban;
lcd_a =1;
lcd_a =0;
while (1)
{
//lcd1gao;
lcd1ban;
lcd_a =1;
lcd_a =0;
.delay 2000;
//lcd1di;
lcd1ban;
lcd_a =0;
lcd_a =1;
.delay 2000;
}
}
/*feng =1;
.delay 1000;
feng =0;
.delay 2000;
*/
|