Data interface not the same..!!
Dear Sir/Madam,
Using I2C, I am communicating to NHD-0216K3Z-FL-GBW-V3 with clock rate 40KHz. But when I update the display with new characters, I find characters are misplaced and not showing on display. For microsecond delays in command, I have provided 1ms delay in my driver and for 1.5ms delays, I have provided 2ms delay.
I found similar post in the same forum, the problem was found to on the LCD firmware.
Kindly let me know is there any firmware updated LCD, where this issue is solved. Or suggest an alternate display.
We have completed our first prototype. It is required to address and solve the display issue ASAP. So that we can move to final product release stage.
Using I2C, I am communicating to NHD-0216K3Z-FL-GBW-V3 with clock rate 40KHz. But when I update the display with new characters, I find characters are misplaced and not showing on display. For microsecond delays in command, I have provided 1ms delay in my driver and for 1.5ms delays, I have provided 2ms delay.
I found similar post in the same forum, the problem was found to on the LCD firmware.
Kindly let me know is there any firmware updated LCD, where this issue is solved. Or suggest an alternate display.
We have completed our first prototype. It is required to address and solve the display issue ASAP. So that we can move to final product release stage.
0
-
Hi Eashwar,
Please review the example I2C code below that is written for the Arduino Mega. It uses much longer delays so it may be worth trying to increase your delay time a bit more to see if that resolves the issue./******************************************************
* Using i2c on NHD 0216KZ3
* ARDUINO MEGA
*/
#define SCLK 21
#define SDO 20
const char Slave = 0x50;
const char t1[]=("Newhaven Display");
const char t2[]=(" LINE 2 ");
void I2C_out(unsigned char j){
int n;
unsigned char d;
d=j;
for(n = 0; n<8; n++){
if((d&0x80) == 0x80)
digitalWrite(SDO, HIGH);
else
digitalWrite(SDO, LOW);
d = (d<<1);
digitalWrite(SCLK, LOW);
delay(10);
digitalWrite(SCLK, HIGH);
delay(5);
digitalWrite(SCLK, LOW);
delay(10);
}
digitalWrite(SCLK, HIGH);
delay(1);
while(SDO ==1){
digitalWrite(SCLK, LOW);
//delay(1);
digitalWrite(SCLK, HIGH);
//delay(1);
}
digitalWrite(SCLK, LOW);
}
void I2C_Start(){
digitalWrite(SCLK, HIGH);
digitalWrite(SDO, HIGH);
digitalWrite(SDO, LOW);
digitalWrite(SCLK, LOW);
}
void I2C_Stop(){
digitalWrite(SDO, LOW);
digitalWrite(SCLK, LOW);
digitalWrite(SCLK, HIGH);
digitalWrite(SDO, HIGH);
}
void disp(const char *text)
{
int n;
for(n=0;n<16;n++)
{
I2C_Start();
delay(5);
I2C_out(Slave);
delay(5);
I2C_out(*text);
text++;
I2C_Stop();
delay(10);
}
}
void setup() {
// put your setup code here, to run once:
pinMode(SDO, OUTPUT);
pinMode(SCLK, OUTPUT);
digitalWrite(SCLK, LOW);
digitalWrite(SDO, LOW);
I2C_Start();
delay(1);
I2C_out(0x50);
delay(1);
delay(10);
I2C_out(0xFE);
I2C_out(0x51);
I2C_Stop();
delay(100);
I2C_Start();
delay(5);
I2C_out(Slave);
delay(5);
I2C_out(0xFE);
I2C_out(0x46);
delay(10);
I2C_Stop();
delay(100);
I2C_Start();
delay(5);
I2C_out(Slave);
delay(5);
I2C_out(0xFE);
I2C_out(0x47);
delay(100);
I2C_Stop();
delay(10);
I2C_Start();
delay(5);
I2C_out(Slave);
delay(5);
I2C_out(0xFE);
I2C_out(0x52);
delay(5);
I2C_out(40);
delay(5);
I2C_Stop();
delay(250);
}
void loop() {
unsigned char x = 0x21;
int i;
I2C_Start();
delay(5);
I2C_out(Slave);
delay(5);
I2C_out(0xFE);
I2C_out(0x51);
I2C_Stop();
double a;
char buff[10];
a = 2.523;
sprintf(buff, "%g" , a);
int n = 0;
/*
for (n = 0; n < 8 ; n ++){
I2C_Start();
delay(1);
I2C_out(Slave);
delay(1);
I2C_out(buff[n]);
delay(1);
I2C_Stop();
delay(1);
}
delay (2500);*/
disp(t1);
delay(100);
delay(100);
I2C_Start();
delay(5);
I2C_out(Slave);
delay(5);
I2C_out(0xFE);
I2C_out(0x45);
//delay(10);
I2C_out(0x40);
delay(10);
I2C_Stop();
delay(10);
disp(t2);
I2C_Stop();
delay(1000);
do{
delay(10);
for( i = 0 ; i < 50 ; i++){
I2C_Start();
delay(5);
I2C_out(Slave);
delay(5);
I2C_out(0xFE);
I2C_out(0x52);
delay(5);
I2C_out(i);
delay(5);
I2C_Stop();
delay(5);
}
int b;
for( i = 0 ; i < 51 ; i++){
I2C_Start();
delay(5);
I2C_out(Slave);
delay(5);
I2C_out(0xFE);
I2C_out(0x52);
delay(5);
b = 50 - i;
I2C_out(b);
delay(5);
I2C_Stop();
delay(25);
}
}while(1);
/*for(i = 0; i < 57; i++){
I2C_Start();
delay(5);
I2C_out(Slave);
delay(5);
I2C_out(x);
x++;
I2C_Stop();
delay(10);
}
// delay(5000);
I2C_Start();
delay(5);
I2C_out(Slave);
delay(5);
I2C_out(0xFE);
I2C_out(0x51);
delay(10);
I2C_out(0xFE);
I2C_out(0x4B);
delay(10);
I2C_out(0xFE);
I2C_out(0x46);
delay(10);
I2C_Stop();
disp(t1);
delay(1000);
for( i = 0 ; i < 50 ; i++){
I2C_Start();
delay(5);
I2C_out(Slave);
delay(5);
I2C_out(0xFE);
I2C_out(0x52);
delay(5);
I2C_out(i);
delay(5);
I2C_Stop();
delay(250);
}
I2C_Start();
delay(5);
I2C_out(Slave);
delay(5);
I2C_out(0xFE);
I2C_out(0x52);
delay(5);
I2C_out(40);
delay(5);
I2C_Stop();
delay(250);
while(1);*/
}0
Please sign in to leave a comment.
Comments
1 comment