HC595 Serial to Parallel Shifting-Out


#1

HC595-device

The datasheet refers to the 74HC595 as an “8-bit serial-in, serial or parallel-out shift register with output latches; 3-state.” In other words, you can use it to control 8 outputs at a time while only taking up a few pins on your microcontroller. Normal use 3 pins, or 5 pin with Enable and Clear.

As it is a device, the main node is one, which is combined with others to complete the function.

Inputs

  • DS (data serial) — pin 14 HC595
  • LT (latch) — pin 12 HC595
  • CLK (clock) — pin 11 HC595
  • CLR (clear -reset) — pin 10 HC595 (low)
  • EN (enable) — pin 13 HC595 (low)

Outputs

  • DEV (output device) — connection to the rest of the nodes

I do not have the knowledge in C ++ or in XOD-C to do it :neutral_face:

library HC595

Some ideas, xodball is a container does not work as a library

HC595-container.xodball (10.0 KB)

Other uses -----


#2

Wow cesars
This is a perfect example of what is needed to easily make new Nodes for people.
As a result here it is ready for testing. :smile:
I have one somewhere around here i will test it tomorrow night if you don’t beat me to it.
bradzilla84/74hc595


#3

@bradzilla84 thank you very much, I will prove it :wink:


#4

@bradzilla84
If I want to use only 3 pins, the EN and CLR pins are not necessary? It would be enough to eliminate them and comment the lines?

// digitalWrite (getValue <input_CLR> (ctx), LOW);
// digitalWrite (getValue <input_EN> (ctx), LOW);


#5

Yea I was thinking that when I did it and Reset/CLR needs to be pulled high according to the “Other Uses” link.


#6

Actually, the pins of the 595 have driven me crazy, and I did not clarify well.
An ENABLE is active with LOW and a CLEAR is active with LOW, so in order to function normally, EN-LOW & CLR-HIGH is needed.

it would not work with the other nodes, would have to put something like that

hc595-en-clr

    digitalWrite(getValue<input_CLRo>(ctx), !getValue<input_CLRi>(ctx));
    digitalWrite(getValue<input_ENo>(ctx), getValue<input_ENi>(ctx));

But I thought that maybe they are not necessary, and it’s enough with DS, CLK and LATCH.

That would not be a problem, I have not managed to make it work.
Simulating the HC595, with DATA to Vcc and inverted CLK + LATCH signal I have correct displacement.
But when loading the hex does not work, the signals do not seem to be synchronized and do not send data. Checking the library seems to be all right, I understand very little :see_no_evil:

PD: I will test on breadboard tomorrow


#7

I could not wait until tomorrow, it works !!! :clap::clap:

can you add an optional ctrl node?


#8

Glad to hear. I will finish those changes tonight and update. (in about 5hrs)


#9

great, there is no urgency :smile:


#10

Hey Cesars
Ver 0.0.2 is up for testing.


#11

The output values must be inverted.

For example:
if Enable = TRUE the output must be LOW, and if Reset is TRUE, the output must be LOW.

If Enable = False, the output value is HIGH and Qa to Qh is Tri-State.
If RST = FALSE is discarded with a LOW in output.

I have it working with digital-write node code components

But in this case the code should be:

     digitalWrite (getValue <input_CLR> (ctx), !getValue <input_ENRClear> (ctx));
     digitalWrite (getValue <input_EN> (ctx), !getValue <input_ENEnable> (ctx));

The activators for my taste have a very long name :roll_eyes:

thanks for your time


#12

No problem…Done.
Ver 0.0.3


#13

I have left you an MP, on the last code.

To finish with the topic, I ask is it possible to create the state reading with sr.get() and sr.getallow ()?

it would be something like that, for now XOD does not support more than 7 outputs

hc595-read


#14

In HC595-device you could add a Number SRn (num shift register) and place it here
… ShiftRegister74HC595 (getValue <input_SRn> (ctx), getValue <input_DS> (ctx)

what do you think?


#15

Sorry for the late reply I ran out of time last night I’ll take a look at it tonight.


#16

Hey Cesars
Ver 0.0.4 is up (had to make some changes)
Can you test when you get a chance please :smile:


#17

I see that some I did well, but others would have never worked :grin:
thanks


#18

No problem.
99% was spot on you are really getting the hang of it. :blush:


#19

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.