[SOLVED] LCD connection 3 wire changing default pins

Hi.

What I'd like to do is connecting LCD display to Arduino using 3 pins.

http://playground.arduino.cc/Main/LiquidCrystal#Information

I installed this library. It works fine.

But I in my circuit 10, 11 and 13th pins are already full.

Is there a way to change the pins, so that I should be able to use free pins i.e (7, 8 and 9th) pins instead of the default ones.

This particular library won’t work for you. They are using the SPI bus of your arduino to shift out the data.
If your other hardware doesn’t use SPI move it to other pins, and free them up for this setup.
If your other hardware does use SPI then all you really need to do is connect the 595 to the same SPI lines, and choose another Latch pin (say D9).
This is because the SPI bus can support more than 1 device.
You can also try the FM NewLiquidCrystal library, I’m pretty sure they have support for a 3-wire SR which can be driven by any pins you want.
Here’s some more info on how/why you would want to use SPI:

  1. It’s very fast.
  2. The SPI library is very small.
  3. See my article here for more info: http://www.instructables.com/id/3-Wire-HD47780-LCD-for-less-than-1-dollar/

TheCoolest: If your other hardware does use SPI then all you really need to do is connect the 595 to the same SPI lines, and choose another Latch pin (say D9).

I don't know whether my hardware does use SPI. But here is my circuit.

Arduino's pins [10 .. 13] are used by SD card.

TheCoolest: Here's some more info on how/why you would want to use SPI: 1) It's very fast. 2) The SPI library is very small. 3) See my article here for more info: http://www.instructables.com/id/3-Wire-HD47780-LCD-for-less-than-1-dollar/

Wow very nice article indeed. I will try as soon as possible. :)

I have one 74HC595 so I should buy another one .

Also PCB images are very nice. Did you use 2 PCB's for this project.

SD cards use SPI as well. So basically you can use the same SCK and MOSI pins for the 595 (just before the resistors), and a separate chip select pin. For example D9 or whatever you want.

akuz: Wow very nice article indeed. I will try as soon as possible. :)

Thanks :)

akuz: Also PCB images are very nice. Did you use 2 PCB's for this project.

I used a single 24x18 perfboard to build the prototype. I'm now waiting for professionally made PCBs to get here. I already made a new PCB design which is much more compact, so should be considerably cheaper to produce. (If there will be any user demand for these)

TheCoolest: SD cards use SPI as well. So basically you can use the same SCK and MOSI pins for the 595 (just before the resistors), and a separate chip select pin. For example D9 or whatever you want.

I didn't draw all of the circuit. But the blue wire is MISO(12), the grey wire is SCK (13), yellow wire is MOSI(11) and brown wire is SS(10).

So using same SCK and MOSI pins for the 595 should I connect both SD card and 595 to the Arduino like that. I used D9 as chip select pin.

Thanks.

The lines to the 595 should come out of the Arduino, before the voltage dividers. And there should be a line between pin9 (Q7') on U1 to pin14 (DS) on U2.

Hopefully this time it is correct :slight_smile:

Looks good now :)

Thank you very much.

This was a nice tip :)