Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - swadhin

Pages: [1]
1
OLEDs / Re: What hex command to invert text
« on: November 26, 2015, 11:08:32 PM »
hello admin,
I am using NHD-0216CW-AY3 lcd and interface to linux using i2c-smbus protocol.
from data sheet i can clear Display & DDRAM registors but please send me all the configuration that i can set the display 2 lines and crusor in home position. if possible please provide how to bring the display on.
Now using clearing display and Display on of command i'm getting some garbage value in display.
20H->00H and 20H->0F h
This is my function that i'm using to write in to the us2066 controller.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
int lcd_write_cmd_data(unsigned char cmd, unsigned char val) {
        int ret;
        ret= smbus_i2c_init();
        if (ret<0) {
                printf("smbus_i2c_init() is failed\n");
        }
        ret= i2c_smbus_write_byte_data(fd, cmd ,val);
        if (ret < 0) {
                printf("failed writing register\n");
                return ret;
        }
        usleep(500);
        return 0;
}

int lcd_write_data(unsigned char val) {
        int ret;
        ret= smbus_i2c_init();
        if (ret<0) {
                printf("smbus_i2c_init() is failed\n");
        }
        ret= i2c_smbus_write_byte(fd, val);
        if (ret < 0) {
                printf("failed to write the value \n");
                return ret;
        }
        usleep(500);
        return 0;
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Pages: [1]