Go Down

Topic: [Resolved] Problem with LCD after changing the used arduino-pins (Read 1 time) previous topic - next topic


Nov 29, 2012, 09:46 pm Last Edit: Dec 12, 2012, 08:12 pm by zimbosmurf Reason: 1

I have a REALLY strange problem:

NEW INFO: I use an Arduino Uno R3

I made a makeshift-arduino-shield from a prototype-board that connects to a serial LCD using a 2x5-crimp-on-header on a ribbon-cable. I used the following pin-connections:
Arduino    LCD
12           RS
11           Enable
5            D4
4            D5
3            D6
2            D7

I initalized the display using
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
and everything worked perfect!

Then I wanted to write a programm that uses external Interrupts, so I needed the arduino-pins 2 and 3, so I made a new shield with the following wiring:

Arduino    LCD
0            RS
1            Enable
4            D4
5            D5
6            D6
7            D7

I initialize the display using
LiquidCrystal lcd(0, 1, 4, 5, 6, 7);

The new wiring is not double-, not triple- but quadruplechecked - everything is correct!
Still - I have nothing on my display...contrast-setting is the same.

In this simple code I can change the commented LiquidCrystal-Line and use the old shield - and everything works. But using the new shield with the corresponding LiquidCrystal-Line, no Display!
Code: [Select]
// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(0, 1, 4, 5, 6, 7);
// LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
//LiquidCrystal(rs, enable, d4(11), d5(12), d6(13), d7 (14))

void setup(){
 // set up the LCD's number of columns and rows:
 lcd.begin(20, 4);
 // set up Serial Connection

void loop()
 // initialize LCD

I have no idea why it doesn't work...the only thing I can think of is the fact that pin 0 and 1 are labelled as RX and TX as well...could it be that I can't use these pins for the display or only use them under special circumstances?

I'm completely clueless...


Your speculation is correct: RX and TX are dedicated to the serial port.



Nov 29, 2012, 10:00 pm Last Edit: Nov 29, 2012, 10:02 pm by zimbosmurf Reason: 1
*gnarf* Thanks for your confirmation...

So these pins are used for the connection to the usb2serial-Interface and there's no way to use these in a sketch at all?


You are strongly suggested to use pins 0 and 1 only for serial port communication with you computer or another serial device. Trying to use it to drive an LCD is not the best choice. Did you run out of pins or something? Have you used the analog pins as digital pins?
Serial LCD keypad panel,phi_prompt user interface library,SDI-12 USB Adapter


No, I didn't run out of pins, I'm just at my girlfriends' house at the moment and I don't have a solderingiron here - so I can't change the pinning today - but I'm not willing to wait until tomorrow! ;)

So - no, I have no trouble actual changing the pins! :)


Nov 30, 2012, 12:11 am Last Edit: Nov 30, 2012, 12:13 am by floresta Reason: 1
could it be that I can't use these pins for the display or only use them under special circumstances?

You can use them as long as you don't intend to use the serial monitor and as long as whatever you plan to use them with does not affect the uploading of your program.

so I can't change the pinning today -

You don't appear to be using the serial monitor so you should be able to get rid of it's initialization.  Then remove your LCD shield, upload your program, reattach the shield and your LCD should work.




Thanks for the help and sorry that I didn't reply earlier...

The Serial.open in the sketch above isn't necessary, i just used it for debug-information on my computer...

Rewiring the shield worked just fine and everything works now...thanks!


Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131