Pages: [1]   Go Down
Author Topic: LCD connection  (Read 630 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Sr. Member
****
Karma: 0
Posts: 376
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

is there any reason why I cant just simply connect my LCD with the following connections?

RS - pin 4 (digital 2)
E - pin 6 (digital 4)

d4 - pin 11(digital 5)
d5 - pin 12(digital 6)
d6 - pin 13 ( digital 7)
d7 - pin 14 (digital smiley-cool

And then define those pins in the code with the following line:

LiquidCrystal lcd(2,4,5,6,7,8);

as soon as the sketch uploads the arduino freezes, if i run the sketch with no lcd attached then it works fine, as soon as I attach it then it freezes.
It will run a sketch fine if i dont use the LCD in the code, so it doesnt seem to be a physical problem

Logged

Santiago de Chile
Offline Offline
Sr. Member
****
Karma: 13
Posts: 488
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

And where do you connect the rest of the pins? full schematic and code would be helpful.
Logged

Work for what you love

Offline Offline
Faraday Member
**
Karma: 69
Posts: 2875
The last thing you did is where you should start looking.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
if i run the sketch with no lcd attached then it works fine, as soon as I attach it then it freezes.
As mart256 says.

Show us an image of your wiring.
Logged

The way you have it in your schematic isn't the same as how you have it wired up! That goes for me too.

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

Quote
is there any reason why I cant just simply connect my LCD with the following connections?

Code:
RS - pin 4 (digital 2)
E - pin 6 (digital 4)

d4 - pin 11(digital 5)
d5 - pin 12(digital 6)
d6 - pin 13 ( digital 7)
d7 - pin 14 (digital 8)

And then define those pins in the code with the following line:

Code:
LiquidCrystal lcd(2,4,5,6,7,8);

This part is correct.  The tutorial doesn't explain how this works, it's buried here http://arduino.cc/en/Reference/LiquidCrystalConstructor.  By the way, do you see why the use of code tags is important to correctly present your code?

In order to have any chance at diagnosing your problem we need more information.  This would include not only a photo of your setup but the complete sketch as well.


Don
Logged

Online Online
Newbie
*
Karma: 0
Posts: 24
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Up some pictures of your hardware
Logged

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

Up some pictures of your hardware

Why didn't anyone else think of this ????

Don
Logged

Offline Offline
Sr. Member
****
Karma: 0
Posts: 376
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Up some pictures of your hardware

Why didn't anyone else think of this ????

Don

Don , I spent ages reading past posts about this sort of thing from you yesterday, it seems that wherever there are LCD problems that Don is there to save the day.

Anyway, long story short, i hadnt connected the RW pin a quick wire to ground and VIOLA what a suprise, things seem to work as they should, or at least i have a sketch that doesnt freeze and there is writing on the screen thats refreshing itself,

that seems to be a good start,

thanks to everyone for making me draw a schem, I didnt want to look like a total numpty so obviously checked everything twice whilst drawing it ,
Logged

Offline Offline
Faraday Member
**
Karma: 69
Posts: 2875
The last thing you did is where you should start looking.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I didnt want to look like a total numpty
This happens to everyone now and then.
Keep on Arduinoing.
Logged

The way you have it in your schematic isn't the same as how you have it wired up! That goes for me too.

Offline Offline
Sr. Member
****
Karma: 0
Posts: 376
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

well it worked briefly and then went crazy again, haha

I found that when I pressed a switch that connected D10 to ground that everything went well, I have no clue why , then I looked and there was a solder blob on between the tracks of 10 and 11,

now more crazyness, so I have the whole affair under a magnifying glass to see if there are any more rogue solder blobs or any dry joints,

I will prevail!!
Logged

Offline Offline
Sr. Member
****
Karma: 0
Posts: 376
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well after a lot of poking prodding resoldering and more resoldering, I hav eprogressed  smiley

I found that my push to make switches were installed with a 90 degree offset, meaning that I had 10 11 and 12 connected to ground all the time, I dont know why this would stop the sketch running, but I have removed the switches and it now runs,

I also had a dippy IDE cable on the FTDI powering it all , which, with the slightest of movement would reset power,

So with those hurdles behind me, and the HELLO WORLD sketch running "smoothly" i have the next question ,

Why can I only see characters 0 -7 on the lcd on rows 0 and 1?  I have the LCD object defined as 16,2 but alas no luck seeing the characters after column 7.

is it possible that I have it in 8 bit mode and only have the four data wires connected?? or would that just not show anything onscreen?
Logged

Offline Offline
Edison Member
*
Karma: 62
Posts: 1035
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi spruce_m00se

Quote
I found that my push to make switches were installed with a 90 degree offset

Are they the PCB-mount tactile type?  If so, someone posted a tip about them a while - if you wire to opposite corners, you are guaranteed to not have a short smiley

On the LCD problem, could you post your code?

Regards

Ray

Logged

Hackscribble.  Writing about making things.
arduino@hackscribble.com | www.hackscribble.com

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

Quote
Why can I only see characters 0 -7 on the lcd on rows 0 and 1?  I have the LCD object defined as 16,2 but alas no luck seeing the characters after column 7.

This sounds like it may be a problem with the connections between the display and the pc board.  Do a search on this site for 'zebra' (I'm not kidding) to find some topics concerning this.

Quote
is it possible that I have it in 8 bit mode and only have the four data wires connected?? or would that just not show anything onscreen?

In this case you would see a single row of blocks on the screen.

It's not likely to be software related, but just in case you should try writing data to every memory location in the LCD controller.


Code:
#include <LiquidCrystal.h>

//LiquidCrystal lcd(rs,en,d4,d5,d6,d7);
  LiquidCrystal lcd(12, 11, 5, 4, 3, 2);       // put your pin numbers here

void setup()
  {
    lcd.begin(20, 4);                          // put your LCD parameters here
    for (char i=47; i<127; i++)                // send 80 consecutive displayable characters to the LCD
      {
        lcd.print(i);
        delay(100);                            // this delay allows you to observe the addressing sequence
      }
  }


void loop()
  { 
  }

Don
Logged

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

Quote
Are they the PCB-mount tactile type?  If so, someone posted a tip about them a while - if you wire to opposite corners, you are guaranteed to not have a short.

That's a great idea for loose switches on a workbench or when designing a pc board.  It will also work if you can somehow mount the switch over the gap in the middle of a solderless breadboard (but I don't think they are large enough to bridge the gap).  If you mount them on either side of the gap they still have to be oriented properly.

Don
Logged

Offline Offline
Sr. Member
****
Karma: 0
Posts: 376
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

well.

After a lot of messing around I took everything off the board except the lcd and th e arduino chip, resonator and caps.

It started to randomly reset after a length of time, normally under 30 seconds,
i tried to reflash the bootloader just incase and couldnt, although could always load sketches,

in the end it has ended up in a box until my fury subsides smiley

I will try the code to write to each memory block later, I want to know if the screen is still working before I continue,
Logged

Pages: [1]   Go Up
Jump to: