Pages: [1]   Go Down
Author Topic: 74HC595 and 74HC165 combined library.  (Read 1992 times)
0 Members and 1 Guest are viewing this topic.
SPAIN
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 602
Posts: 33371
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

SPAIN
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 602
Posts: 33371
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

SPAIN
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I know. And is well explained.

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

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 212
Posts: 13531
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Rob Tillaart

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

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 602
Posts: 33371
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

SPAIN
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 602
Posts: 33371
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
And what pin number is used? A0?
Using A0 refer to it as pin14, A1 as pin15 and so on.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 602
Posts: 33371
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
the MCP seems pretty hard to find around here.
For Spain:-
You can get them here:-
http://es.farnell.com/jsp/search/results.jsp?N=0&Ntk=gensearch&Ntt=MCP23016&Ntx=mode+matchallpartial&suggestions=false&ref=globalsearch&_requestid=22843&isGoback=false&displaytext=&isRedirect=false
Logged

SPAIN
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 602
Posts: 33371
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Pages: [1]   Go Up
Jump to: