打印
[技术问答]

紧急求助HT1625驱动问题

[复制链接]
1141|2
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
Tony0201|  楼主 | 2016-8-18 23:02 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本人第一次使用HT1625,液晶屏始终不亮,求助用过的大神帮忙分析一下,万分感激!
在线等,急!急!急!

#define CMD_SYSEN       0x01
#define CMD_LCDON       0x03
#define CMD_TIMERDIS    0x04
#define CMD_WDTDIS      0x05
#define CMD_RC32K       0x18
#define CMD_IRQDIS      0x80

void LCD_Init(void)
{
    SendCmd(CMD_SYSEN);
    SendCmd(CMD_LCDON);
    SendCmd(CMD_TIMERDIS);
    SendCmd(CMD_WDTDIS);
    SendCmd(CMD_RC32K);
    SendCmd(CMD_IRQDIS);
}

void SendBit_1625(uint8_t mdata, uint8_t cnt)
{
    uint8_t i;
   
    Delayus(1);
    for(i=0; i<cnt; i++)
    {
        if(mdata & 0x80)
            LCD_DATA_H;
        else
            LCD_DATA_L;
                LCD_WR_L;
                Delayus(1);
                LCD_WR_H;       //write one bit
        Delayus(1);
                mdata <<= 1;
    }
}

void SendDataBit_1625(uint8_t mdata, uint8_t cnt)
{
    uint8_t i;
   
    for(i=0; i<cnt; i++)
    {
        if(mdata & 0x01)
            LCD_DATA_H;
        else
            LCD_DATA_L;
                LCD_WR_L;
                Delayus(1);
                LCD_WR_H;       //write one bit
        Delayus(1);
        mdata >>= 1;
    }
}

void SendCmd(uint8_t command)
{
    LCD_CS_L;
    SendBit_1625(0x80, 3);      //100
    SendBit_1625(command, 9);
    LCD_CS_H;
}

void Write_1625(uint8_t addr, uint8_t mdata)
{
    LCD_CS_L;
    SendBit_1625(0xa0, 3);      //101
    SendBit_1625(addr<<1, 7);
    SendDataBit_1625(mdata, 4);
    LCD_CS_H;
}

void WriteAll_1625(uint8_t addr, uint8_t *p, uint8_t cnt)
{
    uint8_t i;
   
    LCD_CS_L;
    SendBit_1625(0xa0, 3);      //101
    SendBit_1625(addr<<1, 7);
    for(i=0; i<cnt; i++)
    {
        SendDataBit_1625(*p, 8);
        p++;
    }
    LCD_CS_H;
}

void test(void)
{
    uint8_t i, temp;

    temp = 0xFF;
    LCD_CS_L;
    SendBit_1625(0xa0, 3);      //101
    SendBit_1625(0x00, 7);
    for(i =0; i <64; i ++)
    {
        SendDataBit_1625(temp, 8);
    }
}

相关帖子

沙发
QQ178960471| | 2016-9-14 00:35 | 只看该作者

使用特权

评论回复
板凳
QQ178960471| | 2016-10-13 23:51 | 只看该作者

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

2

主题

3

帖子

0

粉丝