#include “HT66F0185.h”
//以HT66F0185为例设定驱动,步骤如下
//1、设定共用引脚是COM还是SEG(COMSEGS5-----COMSEGS0)
//2、使能LCDEN
//3、设定与LCD共用的IO口为输出功能
//4、设定frame是0还是1
//5、根据波形图,设定PXn输出0还是输出1(比如COM0与PC2共用,则_pc2=0或1)
//FRAME LCDEN COMnEN IO output
//0 1 1 0 (1/3) * VDD
//0 1 1 1 VDD
//0 1 0 0 VSS
//0 1 0 1 VDD
//1 1 1 0 (2/3)*VDD
//1 1 1 1 VSS
//1 1 0 0 VSS
//1 1 0 1 VDD
//FRAME LCDEN SEGnEN IO output
//0 1 1 0 (2/3) * VDD
//0 1 1 1 VSS
//0 1 0 0 VSS
//0 1 0 1 VDD
//1 1 1 0 (1/3) * VDD
//1 1 1 1 VDD
//1 1 0 0 VSS
//1 1 0 1 VDD
void main()
{
_wdtc = 0xAF;//关闭看门狗
_lcden = 1;//LCD enable
_frame = 0;//frame = 0
/*
_pcc2 = 0;//PC2 output enable
_comsegs0 = 0;//select com0
_com0en = 1;//enable com0
_pc2 = 0;
_pc2 = 1;
_com0en = 0;//disable com0
_pc2 = 0;
_pc2 = 1;
*/
_pbc4 = 0;
_seg6en = 1;
_pb4 = 0;
_pb4 = 1;
_seg6en = 0;
_pb4 = 0;
_pb4 = 1;
while(1)
{
_nop();
}
}