Pages: [1]   Go Down
Author Topic: LCD shield won't work with Mega 2560  (Read 244 times)
0 Members and 1 Guest are viewing this topic.
Dee Why NSW
Offline Offline
Full Member
***
Karma: 5
Posts: 206
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I started with an LCD shield on an EtherTen. The LCD was originally declared lcd(8,9,4,5,6,7).  I was obliged to change this to 8,9,14,5,6,7 when I started to use the built-in SD card. This was expedited by cutting pin D4 off the little proto board between the LCD and the EtherTen, and running a jumper across to A0. This then meant the two boards had be used together but that was always the intention.

I have now fired up the Mega 2560 with this combination. Everything works except the LCD. The lights come on but no display. When I plug them back into the EtherTen, the display is fine.

So I am suss about the pins, particularly the jumper. I recall reading something about using different pins on the Mega but I can't find it.  I am looking at moving the jumper to A2 anyway, as I believe the buttons on the shield use A0.

[Edit]

OK I have now declared the LCD pins lcd(8,9,4,5,6,7), connected the LCD shield direct to the Mega 2560, no jumpers, and the SD card is not involved. I have run the usual short test code "Hello, Bastard!" and seconds count. It works fine. I now conclude there is nothing wrong with the hardware and it is all to do with using pin A0 instead of D4 directly, even  though this was OK with the EtherTen. The EtherTen installs as a Uno.

Is there a fundamental difference between the A0 pin on the Uno and that on the Mega 2560?

[and another Edit]

OK. I've got it sorted. Pin 14 (A0) on the Uno is pin 54 on the Mega. Hence A2 is now 56. I have declared the pins 8,9,56,5,6,7 and my LCD works OK. This would have to be the best-kept secret in Arduinodom, wouldn't it?

I can't believe how unhelpful the official web page is

http://www.arduino.cc/en/Main/ArduinoBoardMega2560

It just mentions the analogue pins as vague afterthought. And it looks like it is only going to get worse with the clock module........


« Last Edit: November 15, 2012, 02:48:31 am by NickPyner » Logged

Pages: [1]   Go Up
Jump to: