I want to use D0-D3 data pins of LCD 16x2 to display "hello World"

Hello Community,

I'm currently exploring the utilization of the D0-D3 data pins of an LCD 16x2 with Arduino. While I understand that displaying messages on the LCD using the more conventional D4-D7 data pins is straightforward, I'm eager to learn how to extend this functionality to incorporate the D0-D3 pins.

Could anyone kindly provide guidance on how I can achieve this?

Thank you in advance for your assistance.

Best regards,
Ali


const int rs = 12, en = 11, d0 = 2, d1 = 3, d2 = 4, d3 = 5;
LiquidCrystal lcd(rs, en, d0, d1, d2, d3);

void setup() {
  lcd.begin(16, 2);
}

void loop() {
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("DigitalUX");
  lcd.setCursor(0, 1);
  lcd.print("Hello Ali!");
  delay(2000);
}```

My understanding is that it is either d4-d7 or using it in 8 bit mode using d0-d7 .

Thank you Deva for your comment.

I understand that in the 4-bit mode it's D4-D7 or in the 8-bit mode it's D0-D7. I want to use D0-D3 pins in 4-bit mode. It may be possible to modify the LiquidCrystal library but I don't know how to do it.

Welcome to the forum

Are you exploring this just out of interest or do you have a reason for doing it ?

Thank you!

Actually, I'm doing an Internship and I have got this task to solve.

Are you aiming to use pins D0 to D3 instead of D4 to D7 or as well as them ? Has someone designed a PCB using the wrong 4 pins by any chance ?

1 Like

Unless there is more to your requirement, it sounds like you have been given an impossible task. I think all LCD controllers use D4-D7 in 4 bit mode. If you suddenly decided to use D0-D3, how would the LCD controller know where the data is?

Hi, @alirehancodes

You need to read the LCD chip data, I think you will find the firmware only uses D4 to D7 for 4 bit operation and cannot use D0 to D3.
The Arduino library has nothing to do with how the LCD firmware works.
Here is a LCD 16x2 datasheet;
ADM1602K-NSW-FBS-3.3v.pdf (896.7 KB)

Tom... :grinning: :+1: :coffee: :australia:

1 Like

I'm just aiming to use pins D0 to D3 in 4-bit mode. No one designed the wrong PCB it is just a task.

The question simply is if D0 to D7 are data pins in LCD 16x2 then why do we use D4 to D7 why not D0 to D3? And I have to use D0 to D3 pins in 4-bit mode?

Can I do this by making some changes in the LiquidCrystal library or any other way?

Hello Tom,

I appreciate your insight. However, I'm still curious if there might be alternative methods to accomplish this task. If you have any further suggestions or insights, I'd be eager to explore them.

Because that is how the LCD controller works.

You cannot use D0 to D3 in 4-bit mode.

No it is impossible.

1 Like

Hi, @alirehancodes

If you want to try, then use the Arduino LCD library, but connect the four data connections from the controller to D0 to D3, instead of D4 to D7 and see what happens when you "Hello World" the display.

Can you please tell us your electronics, programming, arduino, hardware experience?

Is this a school/college/university project?

Tom.... :grinning: :+1: :coffee: :coffee: :coffee: :coffee: :australia:

Thank you all so much for your contributions. You're truly amazing people. I've found the solution I needed. Until next time, take care and have a good one!

I tried this to connect the four data connections from the controller to D0 to D3. It displays nothing.

I'm actually doing an Internship. I'm not to much experienced in electronics and hardware but I'm familiar with programming.

Please share the solution with us

Was the "task" stated like this:
"If you can use DB0 - DB3, I have a bridge in Walthamstow for sale."

Function Set
DL: Sets the interface data length. Data is sent or received in 8-bit lengths (DB7 to DB0) when DL is 1, and in 4-bit lengths (DB7 to DB4) when DL is 0.When 4-bit length is selected, data must be sent or received twice

In this PDF, on page 34, you can see some internal-to-HD44780-chip data lines in a matrix, forming each character...

There is no way to use DB0 to DB3 for 4 bit interface mode.

Take some time to read the datasheet.
There are multiple references about this, here is one from page 22:

For 4-bit interface data, only four bus lines (DB4 to DB7) are used for transfer. Bus lines DB0 to DB3 are disabled.

--- bill

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.