Pages: 1 2 [3] 4   Go Down
Author Topic: analog in to 4 bit LCD driver  (Read 12029 times)
0 Members and 1 Guest are viewing this topic.
Bristol, UK
Offline Offline
Edison Member
*
Karma: 1
Posts: 1197
Exhibitor at UK Maker Faire
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I've been looking at the LCD library, and connecting up a genuine Hitachi HD44780 LCD in 4-bit mode.  With that chip, extra delays are required after certain operations/commands.  But the code in "LiquidCrystal" uses explicit delays in microseconds, and does not use the "ready" bit output from the chip.  Would a version of the library that did use the "Ready" bit be a useful thing to have?  It would have the advantage of working faster with clone HD44780 chips (which need less delay), but would most likely make the code size bigger.
Logged

Austria
Offline Offline
Sr. Member
****
Karma: 3
Posts: 260
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

for some speedfreaks:

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1239682675/4#4

this boosts the speed a little  smiley-wink
Logged


0
Offline Offline
Newbie
*
Karma: 0
Posts: 18
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello I downloaded the LCD4Bit library,
I am using a 16x2 LCD (Amber on Black) from Sparkfun (GDM1602K)

The Pins and connections as fallows:

LCD  ->  Arduino

4 (RS) to Arduino Pin 12
5 (RW) to Arduino Pin GND
6 (E) to Arduino Pin 2

DB4 to Arduino Pin7
DB5 to Arduino Pin8
DB6 to Arduino Pin9
DB7 to Arduino Pin10

VSS GND to Arduino GND
VDD +5V to Arduino Pin 5V

I also connect the Pins on LCD 15(4.2V Led) and 16 (Power Supply for BKL 0v) to Arduino 5V and GND pins.

And I load up the example sketch from the library, upload it to Arduino and run it, the Test Led on 13 keeps blinking means data is going but there is no sign of any light/character on my LCD.

Any suggestions ?
Thanks
Logged

Bristol, UK
Offline Offline
Edison Member
*
Karma: 1
Posts: 1197
Exhibitor at UK Maker Faire
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Have you wired up a contrast pot?  Or does the Spark Fun board provide that already?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 18
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I just re checked the connections and the Backlight works fine now but now I have an another problem.

When I disconnect the Power lines for the lcd Display (not the ones for the Backlight) I see a pulse on the screen but nothings shows up,
it is like if I am going to write "Apple" on the screen, the boxes corresponding to those 5 letters light up for a very shortly like the letters going to appear but then nothing happens.

When I connect the power lines from Arduino to LCD that effect disappears and I just see the backlight.

I tried both 5V and 3V3 pins on arduino. But no luck.
Any ideas ?
Logged

Greenfield, NH
Offline Offline
Newbie
*
Karma: 0
Posts: 22
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Try using an external 3.3 volt source for the display and keep all grounds tied together.  Depending on the LCD, it may be drawing too much for the 3.3v from the Arduino directly, giving you unstable readings. Although this display is specified to operate at 3.3V, you should still be able to use it with 5VDC if you don't have any other option. And also, you never want to apply/disconnect power to the LCD with data being sent to it over the data lines....could ruin it  smiley-wink

Also, like Anachrocomputer mentioned, (and I would try this first before the other power supply option) you need a contrast pot on pin 3.  Hook up around a 10K pot with the outer legs between Pin1 (ground) and Pin2 (VDD) and the center pin of the pot tied to Pin3 (VO). Refer to page 6 of the manual and it shows the connections for the contrast: http://www.sparkfun.com/datasheets/LCD/ADM1602K-NSA-FBS-3.3v.pdf
« Last Edit: April 27, 2009, 10:47:08 am by jgueydan » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 18
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Okay I got a 10K resistor today, connected it and after I adjusted I can see some stuff, not the actual text that is supposed to be there but I can see all the lower and upper 16 boxes light up. So the contrast is fine at the moment but both the LCD4Bit library or the one came with arduino IDE does not work, I double checked the connections and also tried with a new LCD but still the same.

Any ideas ? I will go insane soon.
« Last Edit: April 28, 2009, 05:34:32 pm by tolgainam » Logged

Greenfield, NH
Offline Offline
Newbie
*
Karma: 0
Posts: 22
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you are seeing all the boxes lit up, then you have the contrast too high.  Can you provide a circuit or your code?  I can try it on my end and see if I get similar results.
Also, when I first used the LCD4bit library, I couldn't get anything on mine either.  I had to make some modifications to the LiquidCrystal library, and then everything worked great.  I'll see if I can find what I did to get mine to work, but would be great if you could post your code.

Try looking at this if you haven't already:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1235319100/0
« Last Edit: April 28, 2009, 06:29:40 pm by jgueydan » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 18
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This is the very basic Arduino code that I use with Liquid Crystal, Liquid Crystal seems less complex then lcd4bit and simple so I am just trying with it now:
Code:
#include <LiquidCrystal.h>

// LiquidCrystal display with:
// rs on pin 12
// rw on pin 11
// enable on pin 10
// d4, d5, d6, d7 on pins 5, 4, 3, 2
LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2);

void setup()
{
  // Print a message to the LCD.
  lcd.print("hello, world!");
}

void loop()
{
}

And the pin confugration is just same as there as fallows.
I am using it with a XIAMEN 1602K LCD (Amber-Black)

Unfortunately it is 03:42 here now and I am really sleepy, but tomorrow I will take a clear photo of the setup I have so you may have an idea about the general look. And also that will give me an another chance to re-check the cable stuff again.
thanks
« Last Edit: April 28, 2009, 06:42:51 pm by tolgainam » Logged

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

tikifare

There seem to be many people having trouble with the LiquidCrystal library, especially in 4-bit mode.  I have written a replacement for LiquidCrystal.cpp, the main part of the library.  You can find the file and some of my thoughts on why LiquidCrystal doesn't work all the time at http://web.alfredstate.edu/weimandn.

floresta
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 18
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

None of those work. I will go insane.
Tried 2 different Libraries (lcd4Bit and Liquid Crystal, bot the original and the modfied one) with three 3 different LCD's, all 2x16 but different brands and all I can see is the boxes, not a single character.
Logged

Greenfield, NH
Offline Offline
Newbie
*
Karma: 0
Posts: 22
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Try tieing your R/W pin to ground
Logged

Sierre, Switzerland
Offline Offline
Newbie
*
Karma: 0
Posts: 1
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Well, my first post here, hello everybody.

I managed to have mine work by simply sending lcd.clear() before printing to it.

I read somewhere to tie V0 (Contrast) to GND, this did not work in my case, i had to wire a potentiometer in so I could read anything
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 1
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I had a similar problem of it not working at all. My problem was that I hadn't changed the LCD4Bit lcd = LCD4Bit(2); to 2 to reflect the fact I had 2 lines! At first I was working under assumption that changing that was optional. Turns out no.

Hope this helps.
Logged

Concón, Chile, South América
Offline Offline
Full Member
***
Karma: 0
Posts: 150
Try to interface my car with Arduino
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I had my LCD display working fine with Arduino Diecimila, in a protoboard.

Now I connected it better, soldering to a shield.

Looks better, but it is not working. Unfortunately, I do not have backup of connections.

Please, when tikifare and others solve the problem, publish a "definitive" connections diagram here, to share.

It is impossible for me continue with my project if I cannot see results!

It is easy to understand tikifare feeling mad with this!

The 1602K LCD screen has a good tech note, but doesn´t work if there is no "official" wiring schem to Arduino.

OldBeaver
Logged

Pages: 1 2 [3] 4   Go Up
Jump to: