Go Down

Topic: 74HC595 and 74HC165 combined library. (Read 2362 times) previous topic - next topic

dreamgame

Hello to all.

I am doing a project on i wanna use one 74HC595 and one 74HC165 for the inputs and outputs. And i will like to use it in one library, like the one is found at the end of that thread.

  http://arduino.cc/forum/index.php/topic,46937.15.html

I have readed many times the entire thread, and the instructions of how to use it, is for the early versions, on which there are two libraries, one for the 165, and another for the 595.

In the combined version i dont know how to initialize the library, neither the functions to read and write on the shift registers.

Maybe the author or someone else can help me to understand better the use of that library? A little drawing showing the shared pins on the ic's will help too.

I wanna apologize for my english, i am a spanish speaker.

Thank you.

Grumpy_Mike

How do you want to wire these up as two chained shift registers or as two separate systems?

dreamgame

I wanna use as a separate systems.

The 165 for reading switchwes, and the 595 for general purposes, like driving leds, two optocouplers and other stuff like that.


Grumpy_Mike

Just add the two libraries into you sketch and initialises the two devices separately and don't use any common pins.

Reply #24 has an example of using the two together.

dreamgame

I know. And is well explained.

But i am using a uno, with an lcd and other stuff attached, only have 5 free pins.

robtillaart

Did you know the analog pins can also be used for digital out ..., maybe that solves the #free pins?
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Grumpy_Mike

Well instead of the shift registers why not use a port expander.
The MCP23016 gives you 16 input/output pins for just two I2C pins, and you can have up to 8 of them connected at the same time. Where as for faster transfer using SPI you can use the MCP23S13 which again gives 16 I/O with 8 usable at the same time.

dreamgame

robtillart.

No didn't know. And what pin number is used? A0?

Grumpy_Mike.

I wanna use the 74HC because i have a bunch of them. And the MCP seems pretty hard to find around here.


Grumpy_Mike

Quote
And what pin number is used? A0?

Using A0 refer to it as pin14, A1 as pin15 and so on.


dreamgame

Farnell is one place to find this in spain, and can be also found on RS.

But, 1.95€ the part. 14.95€ transports.

For one or two ic's is not a big deal.

The MCP23016 already have a library?

Why you prefer the MCP23016 vs a 74HC? The 74HC are cheaper. 

Grumpy_Mike

Because they use less pins and are easer to use. I use them in a lot of my projects. Yes Farnell have a postage charge but if you buy enough it is postage free. In the UK this works out at about £25.

Go Up