[Resolved] Problem with LCD after changing the used arduino-pins

Hi!

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!

// 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
  Serial.begin(9600);
};

void loop()
{
  // initialize LCD
  lcd.clear();
  lcd.setCursor(0,0);
  lcd.print("Speed:");
  lcd.setCursor(0,1);
  lcd.print("Avg:");
  lcd.setCursor(20,0);
  lcd.print("Way:");
  lcd.setCursor(20,1);
  lcd.print("Max-Spd.:");
};

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.

-br

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?

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! :wink:

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

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.

Don

Hi!

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!

Thank you for the update.

Don