ShiftRegLCD lib (LiquidCrystal 3-wire replacement)

Well..
I might've bought the wrong chip! I seen that they use the LS164 and the HEF4094.. well I ordered a set of HC164, HC595 and a bunch other for $5 for 10 of each.. a steal! So I couldn't pass it up!!

I'm curious though.. am I able to use the HC164 to do this? Not exactly the LS164.. I looked through the datasheet and couldn't notice much a difference.. (I didn't really know what to look for, lol :))

Just try it :). I did not read the datasheets of both chips, just browsed in farnell to compare the general characteristics and I think LS is a little bit slower (36Mhz) and probably there is something about the maximum ratings of both chips that is different.

Well, somebody mentioned the pins were different, so I tried changing those..
I must've messed up somewhere, but I'm not getting anything.. besides power. LCDs not even initializing or anything, so I'm assuming it's something in my wiring.. I've tried a couple times to mix it up, unplug it.. redo all my wiring..
I'm missing something here! :stuck_out_tongue:
But hey, I'm happy with having my LCD work!

But I'm curious, I was reading up about somebody using a PIC18F(some numbers here) for a 1 wire interface, other than the power and ground obviously, and used serial communication to talk to that chip, which sends the commands out to the LCD.. I'm curious
What kind of uh, "talent" or expertise do I need to implement something like this with one of my arduinos? I have a couple old 168's laying around and was hoping for them to be useful! I think a setup like that would be awesome!
It's somewhat like this, but was more.. homemade and sexy! (can't find the link, but here's the Sparkfun version)

We can go further. With a dedicated tiny or mega on the back of the LCD we can achieve 0(ZERO) wires LCD communication. :slight_smile:

Well bah hum bug.. after trying for a couple hours.. pass!

I have a total of 4 different chips with the set I bought.. maybe a different one will work? I tried hooking up the 164 as suggested.. but it's the HC.. I think they may be a totally different chip?

74HC164 165 573 595 are the chips I have.. I've used the 595 without any problems, the rest I'm not really sure what to do with.. other than try a LCD with less wires!! :smiley:

But yeah, that wireless communication over the IR set is AWESOME! I used it just for the sake of having it! :slight_smile:

Anyone interested in I2C control for parallel HD44780 compat. LCD's using PCF8574?
I'm just finalyzing the library-modifications and would be glad to share.
(Still need a bit of time to clean the code and do some extra tests and find a webspot to store the files for download).

I needed to free up some ports on the Arduino and also wanted to be able to connect more than one LCD to it.
Doing it with I2C, I should in theory be able to connect up to 16 (8 on a PCF8574 and 8 on a 8574A) LCD's.
I'v only tested with one 16 x 2 LCD so far. Tests with 20 x 4 LCD are sheduled next.
For now all functions of the LiquidCrystal lib shipped with IDE 0017 seem to work. In addition I've added backlight control.
Still working on the buisy flag checks so timing is controlled by the LCD instead of the Arduino app.

CaptainObvious:

Since I also got a bunch of the 74HC164 since last time, I decided to give those a go. But it was a no-go on both my displays.

However, in 3-wire mode they worked. So the problem is probably the 74HC not managing the quick'n'dirty diode-resistor AND gate for the enable signal.

But then again, it seems Mouse above here made it work with the 74HC164 in 2-wire mode, so I'm not really sure. Also you got it to work with the HC595.

Could be experimenting more with the series R resistor solves it. Or, of course, have an actual factual digital AND gate :stuck_out_tongue: But that would increase complexity a bit.

I've tried to look up the capabilities of the 74LS164 and 74HC164, but it's not always easy comparing them when datasheets don't have the same names or tables.

For the 74LS164, datasheet says, under "recommended operating conditions"
HIGH level output current: -0.4 mA (max)
LOW level output current: 8 mA (max)

Whereas the datasheetsfor the 74HC164 says, under "Absolute maximum ratings":
DC output current, per pin: +/- 25 mA

I find that pretty puzzling, seems like the HC family IC's can sink and source more current than the LS family. Maybe my assumption above is wrong about it not being able to work with the diode-resistor AND gate. It would seem it should handle it pretty well (4.3-ish volt / 1k= 4.3-ish mA).

Mario_H:

Sounds interesting! I've never worked with I2C yet though, so I'm not sure how exactly that works or how complicated it is to set up. Also I'm wondering about the speed of an I2C bus and how well the bandwith is spent communicating about wating for a busy-flag is. As I understand it, it can be quite a few devices on an I2C bus? (This might not be a problem though, I'm just thinking out loud here).

May I suggest googlecode http://code.google.com/intl/nb-US/projecthosting/ to host your project?

Raron,

I2C is "simple". I'm a newby and got it working in a sec.
Thanks for the storage suggestion but I already found a spot to store Lib/samples/additional info.
Links on the playground:
Arduino Playground - LCD in the section "Using 4-bit mode with Hitachi LCD controllers."
Arduino Playground - LCDAPI
(both linking to: http://www.xs4all.nl/~hmario/arduino/LiquidCrystal_I2C/ )

I didn't get the Busy flag checking working as quick as I wanted and needed to move forward with my project so I've added that to my "To do" list.
The number of I2C devices on a bus can grow to big numbers when you start using busmultiplexers like the PCA9546.
My experience with I2C speeds is insufficient to give you any advice: Try it, play with is and see where you end up, thats my roadmap :wink:

hello all,

ive build the 74ls164 setup with a 16x2 display, and it only wants to display text on the first line. even lcd.setCursor(2,1) did not work. even to setCursor(2,0) it did'nt listen.

if i initialize the lcd with ShiftRegLCD srlcd(9, 10, 8, 2); i get a non functioning lcd. no characters show up.
ShiftRegLCD srlcd(9, 10, 8, 1 ); is working fine.

any ideas?

I'm sorry I don't know why it doesn't work. What is the name of your display?

I got a 20x2 line LCD that works with "ShiftRegLCD srlcd(12, 13, TWO_WIRE,2);". I use it in 2-wire mode, and have never actually tested 3-wire with this library myself (I use my old lib and old PCB for that). I don't see any bugs in the library regarding 3-wire mode (no guarantee though).

Could be your "contrast" setting (pot) needs to change to see it?

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.

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!

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.

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...

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

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 :stuck_out_tongue: 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.

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.

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 :cry: .

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 :slight_smile:

Sparkfun has several serial LCD's. Here's one:

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

have you connected the contrast controlling potentiometer to the lcd?