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.
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)
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
Some ideas, xodball is a container does not work as a library
HC595-container.xodball (10.0 KB)
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.
I have one somewhere around here i will test it tomorrow night if you don’t beat me to it.
@bradzilla84 thank you very much, I will prove it
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);
Yea I was thinking that when I did it and Reset/CLR needs to be pulled high according to the “Other Uses” link.
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
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
PD: I will test on breadboard tomorrow
I could not wait until tomorrow, it works !!!
can you add an optional ctrl node?
Glad to hear. I will finish those changes tonight and update. (in about 5hrs)
great, there is no urgency
Ver 0.0.2 is up for testing.
The output values must be inverted.
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
thanks for your time
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
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?
Sorry for the late reply I ran out of time last night I’ll take a look at it tonight.
Ver 0.0.4 is up (had to make some changes)
Can you test when you get a chance please
I see that some I did well, but others would have never worked
99% was spot on you are really getting the hang of it.
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.