74HC595 Shift register library in development

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Howdy all, once again :)

First thing to mention, sorry to all mods and admins if I posted on the wrong forum, my bad my mistake, won't happen again :).

Second, I was recently included in a project which uses a couple of 74HC595 shift registers, I decided to make a library to keep my code nice, clean, and i some ways portable. So here is the code and a test schematic for anyone who wishes to take a look at it and give some comments.

Just as a disclaimer, the library is version 0.1 :-) and lacks some comments.

So thanks to anyone in advance.

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,
I guess you can gain more attention to your library if you make an I/O board, give it a name/version, draw the schematics and layout, publish all this along with your library. Additionally interesting would be to have that board extensible up to N I/O lines, as well as adjustable to some frequently used voltage level (CMOS/TTL). Besides you could provide a list of applications where one can use your board (interacting with PC over LPT/RS-232, cell-phone, phone-line ...). The more applications the better.
Regards

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks a lot for your remarks, I will certainly get on some of the ideas you mentioned here as soon as possible.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Your schematic tells, how shiftregisters schould never be used. :!:

Shiftregisters are used to save pins, but you waste pins.

You need only 3 pins to control as many 74HC595 as you want.

Simple connect all RCLK and SRCLK together and only the first SER to the micro.
Then SER of the next 74HC595 must be connected to QH'.
Then e.g. for 3 shiftregister chainded, shift 3 bytes in.
And then clock the RCLK to update all registers simultaneously.

Peter

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

danni wrote:
Your schematic tells, how shiftregisters schould never be used. :!:

Shiftregisters are used to save pins, but you waste pins.

You need only 3 pins to control as many 74HC595 as you want.

Simple connect all RCLK and SRCLK together and only the first SER to the micro.
Then SER of the next 74HC595 must be connected to QH'.
Then e.g. for 3 shiftregister chainded, shift 3 bytes in.
And then clock the RCLK to update all registers simultaneously.

Peter

My dumb mistake, thanx for your remark

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I've done a correction both to the schematic and the code.
The SHIFTREG_OutputValue() function now first transmits all the bytes to the shift registers and then issues a latch pulse.
Now I'm using only three pins for 4 shift registers, so I guess this would be a better solution, than the previous one.

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank for share!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

vuong49ctu wrote:
Thank for share!

No problem, I am glad if it helped you :)