Pages: [1]   Go Down
Author Topic: Would these pin connections be ok for LCD?  (Read 328 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
The LCD (Hitachi 16x2) tutorials show this config for pin connections:
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

LCD data pin D4 to digital pin 5
LCD data pin D5 to digital pin 4
LCD data pin D6 to digital pin 3
LCD data pin D7 to digital pin 2

If another shield connected to the Uno is already needing to use digital pins 2 and 3, is it ok to do this:
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

LCD data pin D4 to digital pin 5
LCD data pin D5 to digital pin 4
LCD data pin D6 to digital pin 9
LCD data pin D7 to digital pin 8

There are two banks of digital pins, so not sure if mixing is ok.

Thanks much.
Logged

BCC AZ USA
Offline Offline
God Member
*****
Karma: 21
Posts: 935
It gets hot so it must be working
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You can assign any digital pin to any LCD input, but you must make sure that the correct pins are matched to the LCD pins in the constructor.  I have done this in the past to make wiring from a standalone 329 to the LCD easier.
Logged

DE
Offline Offline
God Member
*****
Karma: 20
Posts: 674
| Germany | NRW |
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hoi
You may the LCD parameters better understand with this:
The (mostly) 6 parameters define the following signals/Pins of the LCD:
RS
En
D4
D5
D6
D7
in this order !

So you can define every pin on the ARDUINO side but the LCD side is fix by the order of the parameters.

RS is mostly Pin4 and En mostly Pin6
D4-D7 mostly Pin11-Pin14.

Always best  to have a look in a datasheet  smiley-grin
« Last Edit: December 08, 2013, 10:53:06 am by A.R.Ty » Logged

Dum spiro, spero - if you find my posting helpful, please click my Karma smiley
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Do you know A.R.T

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks much,
Pin remapping to different digital pins works well.  This is a big help, because at first I was scratching my head after realizing the GSM shield used up pins 2,3 and 7. 
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 26
Posts: 4118
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
You can assign any digital pin to any LCD input, but you must make sure that the correct pins are matched to the LCD pins in the constructor.
Just to clarify this a bit:
  All of the I/O pins on the Arduino are digital, including the so called 'analog' pins.
  Most of the signal pins on the LCD are I/O, only the RS and E are input only.

You can use any available Arduino I/O pin to connect to any of the LCD signal pins.


Code:
//LiquidCrystal lcd(RS, E, D4, D5, D6, D7);
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);      // put your pin numbers here

Don
Logged

0
Offline Offline
Shannon Member
****
Karma: 162
Posts: 10461
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The only exception (on the 328 boards that bring them out) is pins A6 and A7 which are analog inputs only.
The Uno doesn't bring them out (because the DIP version of the 328 doesn't).  I think some of the Mini,
Pro Mini and Nano family of boards bring out A6/7

Not sure about the analog pins on the Mega
Logged

[ I won't respond to messages, use the forum please ]

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 26
Posts: 4118
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The only exception (on the 328 boards that bring them out) is pins A6 and A7 which are analog inputs only.
That's not an exception since they are not I/O ports.

Quote
The Uno doesn't bring them out (because the DIP version of the 328 doesn't).
The DIP version doesn't bring them out because they don't exist.

Don
Logged

Pages: [1]   Go Up
Jump to: