Pages: 1 2 [3]   Go Down
Author Topic: ShiftRegLCD lib (LiquidCrystal 3-wire replacement)  (Read 8716 times)
0 Members and 1 Guest are viewing this topic.
Norway
Offline Offline
Sr. Member
****
Karma: 4
Posts: 423
microscopic quantum convulsions of space-time
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Update: Inluded an overview of the functions in its own wikipage, which was long overdue. So far I just used to look at the ShiftRegLCD.cpp if I needed to know what the functions (or methods) were.
Logged

Amsterdam
Offline Offline
Full Member
***
Karma: 1
Posts: 139
he's looking at you, kiddy...
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

thanks for your reply.
the contrast is ok. i can read the first line perfectly. last night i was connecting the display directly (4 bit parallel) with the arduino 0017 demo code, but could'nt get it to display info at all, so it could be that the lcd ids faulty. i will, receive another one this week, so i can check that later.

nice job!
Logged

--
"We're all in this together..."

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

hey guys, this thread is a little old but it has helped me so much, i have gotten all four lines working on my LCD screen but with only 1 problem. whenever i try to set the cursor it prints out two weird characters. any idea why this is.

here a image of it.

« Last Edit: February 21, 2010, 03:54:21 am by Du-z » Logged

Amsterdam
Offline Offline
Full Member
***
Karma: 1
Posts: 139
he's looking at you, kiddy...
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

could you please edit the previous message so i don't have to stand 10 meters from my screen to see the picture? 640x480 will be enough...
Logged

--
"We're all in this together..."

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

woops i never preview the image before i posted sorry. it has been substituted with a thumbnail. smiley
Logged

Norway
Offline Offline
Sr. Member
****
Karma: 4
Posts: 423
microscopic quantum convulsions of space-time
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Weird!

Could it have anything to do with the datatype you are using to set the position? Although I would think it would cast variable types automatically if that was the case. Also, your LCD shows the text properly, so it basically works. But just in case, can you say something about your circuit? What type of shiftregister, and how long are the wires connecting to it from the arduino? Noise maybe? Maybe the LCD isn't completely HD44780 compatible?

Actually I doubt all of what I'm saying here smiley-razz In short; weird!


A question or two: even if the two strange characters show, does it actually change the cursor position? If not, how did you get it to the next line? What if you tried to write ASCII character 13 (CR), and / or ASCII character 10 (LF), will that get you to the next line without any strange output? Just a thought. I have never actually tried this with any LCDs yet.
Logged

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

it must of been something in the code that was grabbing the temperature data, when i tried a simple Hello World on each line it didn't happen.

i was/am using the 3 wire method with a 74LS164N.
Logged

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

Hi To all,

I am N.Nandhakumar from India. I am doing a project as part of my academics. I am doing a Datalogging project using EM-406a GPS and Arduino named "Tran-Duino"

I am also using the Adafruit GPS shield V1.1 and a 2-line JHD162a LCD display.

In the Arduino , pins 10-13 is used for sd card storage, pins 0-4 is used by GPS. I want to display the data the GPS logs into the sd card.

I have found the code for that, but since LCD display requires atleast 6 pins ,and the arduino is left with only 5 pins, I am not able to connect the LCD. If I do so, It just displays junk values  :'( .

Then I googled and I found the arduinoshiftreglcd library and tried it using 74HCT164N IC . But I am getting only the black Blocks in the first line of the display.

I followed the schematic given in this same thread . I am having a Arduino ATMEGA328 made by Bhasha Technologies, India.

I am using Arduino-0017 IDE in Ubuntu 9.10

Now My doubts are,

How to display text?

I can afford to connect the LCD with maximum 5 wires [ since that is the number of wires left in the arduino ] . So, It would be a great help If I get a interface less than that.

I also need help on how to display the text in 2 lines of the display

Please Help me out.

Waiting for your valuable suggestions

Thanks in advance

N.Nandhakumar smiley
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 653
Posts: 50890
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sparkfun has several serial LCD's. Here's one:
http://www.sparkfun.com/commerce/product_info.php?products_id=9568

Only requires +5V, Gnd, and one digital pin.
Logged

Sofia, Bulgaria
Offline Offline
Full Member
***
Karma: 0
Posts: 237
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

have you connected the contrast controlling potentiometer to the lcd?
Logged

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

Thanks for the reply Mircho and PaulS .

I am using a variable resistor POT in the schematic .

But even when I tuned it , the black blocks only gets disappeared slowly but I am not able to get any text on it .

I am not able to identify the problem clearly . I have built the schematic using breadboard and also tried by directly soldering the wires to the IC using a IC Base.

In  both the ways I get only the same output - black blocks.

Please give your suggestions. It will be of great help if I build the circuit using the shift register .

Regards

N.Nandhakumar
Logged

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

You have listed pins 0-4 and 10-13 as being used in your sketch, but you have not said that you are using any of the analog pins.

If you are not using the analog pins for any other purpose, you can use them as digital pins, referred to as numbers 14 (analog input 0) to 19 (analog input 5). You then have 11 pins available for output, not the 5 you think you have.
Logged

Norway
Offline Offline
Sr. Member
****
Karma: 4
Posts: 423
microscopic quantum convulsions of space-time
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello!

How are you connecting the LCD/shiftregister? Via two or three wires? As stated, some (me included) had trouble getting the two-wire method to work with a HC family shiftregister. I am not sure why though. I guess the same applies to HCT. You can either try with a LS type shiftregister, or use the three-wire method (unless you are already doing that, in which case I do not know what the issue is).

Maybe if you posted the code related to the LCD it would help, as well as the schematic you use for the LCD.

Also, as TBAr explains, the analog inputs 0 to 5, can be used as digital I/O 14 to 19.


I am also using Ubuntu 9.10 and usually arduino-0017 btw, but I do not think that is the issue.
I have an old HD44780 compatible one-line LCD as well as a 2-line LCD named "JHD202C", which both works fine with the library.


As for using your 2nd line, you must first initialize the display correctly. The functions are explained in the usage page.

Quote
Initialization
#include <ShiftRegLCD.h>
ShiftRegLCD srlcd(Datapin, Clockpin, Enablepin or TWO_WIRE [, Lines [, Font]])


Quote
Or, if using three wires, and a 2-line display. Enable will be on pin 8:
#include <ShiftRegLCD.h>
ShiftRegLCD srlcd(12, 13, 8, 2);

and

Quote
Cursor positioning
srlcd.home();  // Set cursor position to zero
srlcd.setCursor(column, row); // Sets cursor position


Remember row begins at row 0 (zero), for the first line. Also column begins at column 0.

Hope this helps.
Logged

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

Hi Folks,

Can anyone tell me if the NTE brand NTE74LS164 is suitable for use with ShiftRegLCD. I'm not sure what the significance of the "N" is in the part number.

For some background…
I've had no luck getting ShiftRegLCD to work using a 74HC164N and, most recently a NTE74LS164. I've tried both 2 wire and 3 wire circuits and checked my wiring so many times that I am seeing it in my sleep. I think I may have blew out the HC and it seems like the LS is the way to go at any rate. My LCD works fine when hooked up parallel and the contrast setting is the same.

Thanks!
Logged

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