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 - gnyturan

Pages: [1]
1
Character LCDs / Re: NHD-0420H1Z-FL-GBW-33V3 - 2 Lines Mode Problem
« on: October 29, 2015, 08:45:55 AM »
Dear all,

I have solved the problem, and would like to give to solution so anyone else having similar problems can solve them.

1. To switch to the 2-line mode, it is better to use the internal reset circuitry wake up routine which you can find in the lcd chip datasheet.
2. When you switch to the 2-line mode, duty cycle drops so does the contrast.
3. If you are not using trimmer for contrast, mind that in the LCD screen, there is an 8.8k ohm resistance between VCC and V0. This dramatically affects your voltage division ratio. Do your calculations accordingly.

Have a nice day :)
Gunay

2
Character LCDs / Re: NHD-0420H1Z-FL-GBW-33V3 - 2 Lines Mode Problem
« on: October 28, 2015, 05:03:41 AM »
Hello again,

With Saurabh's help I realized that I did not reset the internal logic. When I used "Initializing by Reset Circuit" I was able to switch to 2-line mode. However, contrast is almost gone in this mode. In 1-line mode I applied 132mV with a voltage divider of 2k-47k from 3.3V. I measure it, it is fine. When I measure it in 2-line mode it becomes 700mV. How is this even possible?

Thank you very much in advance.
Gunay.

3
Character LCDs / Re: NHD-0420H1Z-FL-GBW-33V3 - 2 Lines Mode Problem
« on: October 26, 2015, 10:48:31 AM »
Hello,

Thank you for the swift reply.

I am adding the code parts so you can see the initialization.

Code: [Select]
void initLCD(void){
OPENABLE;
delay(6);
writeInstruction(FUNCTIONSET1LINE);
delay(110);
writeInstruction(FUNCTIONSET1LINE);
delay(11);
writeInstruction(FUNCTIONSET1LINE);
delay(11);
//writeInstruction(FUNCTIONSET2LINES);
writeInstruction(CURSORSHIFT);
writeInstruction(DISPLAYON);
writeInstruction(ENTRYMODESET);
writeInstruction(CLEARDISPLAY);
}

Code: [Select]
// Screen Definitions
#define SCREENCMD LPC_GPIO2->CLR |= 0x00000001
#define SCREENDATA LPC_GPIO2->SET |= 0x00000001
#define READMODE LPC_GPIO2->SET |= 0x00000002
#define WRITEMODE LPC_GPIO2->CLR |= 0x00000002
#define OPENABLE LPC_GPIO2->CLR |= 0x00000004
#define OPDISABLE LPC_GPIO2->SET |= 0x00000004
#define FUNCTIONSET2LINES 0x38 //default: 0x38
#define FUNCTIONSET1LINE 0x30 //default: 0x38
#define DISPLAYON 0x0C
#define DISPLAYOFF 0x08
#define CURSORSHIFT 0x10
#define CLEARDISPLAY 0x01
#define ENTRYMODESET 0x06
#define SECONDLINEADDRESS 0xC0

Code: [Select]
void writeInstruction(unsigned int inst){
instructionToDataBus(inst);
SCREENCMD;
OPDISABLE;
WRITEMODE;
delay(1);
OPENABLE;
}

Code: [Select]
void writeString(char *str){
int i = 0;
SCREENDATA;
WRITEMODE;
while(str[i] != '\0'){
while(i<40 && (str[i] != '\0')){
OPDISABLE;
charToDataBus(str[i]);
delay(20);
OPENABLE;
delay(20);
i++;
}
if(i>39){
writeInstruction(SECONDLINEADDRESS);
SCREENDATA;
WRITEMODE;
while((str[i] != '\0') && i<80){
OPDISABLE;
charToDataBus(str[i]);
delay(20);
OPENABLE;
delay(20);
i++;
}
}
}
}

With these codes, I print numbers to the screen by these lines in main:

Code: [Select]
delay(1000);
configureScreenPins();
delay(1000);
initLCD();
writeString("1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33");

The problem is, whenever I use 2 line mode command, I see nothing on the screen but the backlight. If I remove it, it works for 1st and 3rd lines with a loss of 40 characters as expected. I suppose the problem is with the wake-up routine but I followed the example codes and similar posts in the forum.

ps. delay function is a ms delay function.


4
Character LCDs / NHD-0420H1Z-FL-GBW-33V3 - 2 Lines Mode Problem
« on: October 24, 2015, 07:37:01 PM »
Hello everyone,

I am using NHD-0420H1Z-FL-GBW-33V3 with NXP LPC1774 an coding in C. When I initialize the LCD as described in the datasheet I cannot display anything, but if I try to use it in 1-line mode, it displays characters to the 1st and 3rd lines only.

So far, I tried:
- 3 (and more) wake up calls with 0x30 and then sending 0x38
- Putting exaggerated delays between init commands
- working in 1-line mode and addressing with 2-line addresses (0xC0 command for second line)
- using another unused screen

If anywhere in the code I use 0x38 command, I get blank screen.

If anyone had the same problem and/or knows the solution could you please help me with this.
Thank you very much in advance,
Kind regards
Gunay

Pages: [1]