HT1621B驱动问题
问一下各位大神以上的液晶片应该如何驱动
以下是测试用的
#include <Mega8515.h>
void nop(unsigned int t)
{
while(--t);
}
void wr(unsigned char datas, unsigned char net)
{
unsigned char i;
for(i=0; i<net; i++)
{
PORTB.1=0;
PORTB.2=datas&0x80;
nop(10);
PORTB.1=1;
nop(10);
datas<<=1;
}
}
void wrcomd(unsigned char cmd)
{
PORTB.0=0;
wr(0x80,4);
wr(cmd,8);
PORTB.0=1;
}
void wrdata(unsigned char add, unsigned char datas)
{
add<<=2;
PORTB.0=0;
wr(0xa0,3);
wr(add,6);
wr(datas,8);
PORTB.0=1;
}
void ovre(unsigned char un)
{
unsigned char i, u;
u=0;
for(i=0; i<un; i++)
{
wrdata(u,0x00);
u+=2;
}
}
void main(void)
{
DDRA=0xff;
DDRB=0xff;
DDRC=0xff;
DDRD=0xff;
PORTA=0xff;
PORTB=0xff;
PORTC=0xff;
PORTD=0xff;
nop(200);
PORTB=0xff;
wrcomd(0x02);
wrcomd(0x30);
wrcomd(0x52);
wrcomd(0x06);
ovre(16);
nop(500);
wrdata(0x06,0x04); 这一句好像点亮了第三位的E段
}
现在我还搞不清楚上传的图是怎么点亮的,请各位大神指导一下,例如我要点这图中的第一位的A段在 HT1621B里面写数据应该如何写,寄存器的 101指令后的地址和数据是如何设置的,在此万分感谢!! 这么长没激情看。
发送101000000(二进制)在发送6个0xff看看~ 帮你顶顶吧 谢谢!金牛哥,昨晚我终于明白了
页:
[1]