Another HC595 Shift Register Thread, cant get it to work

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

Hi, I have read like every thread that mentions the HC595 serial in, parallel out shift register. I have checked my wiring 50 times. I have checked the data sheet countless times.
My problem is that it ways shifts in a HIGH whether the serial input is 0 or 5V. I measure on the 1st Shift register serial input pin (14), it is 0V. But then shifts high's in. I dont know what to do. I am so far behind on this project. Any help would be super appreciated.
I havent programmed code yet because I cannot get the logic right.At the moment I am testing it with debounced toggle switches (1K/10uF Low pass filter).

Is my schematic correct?
Thank you.

Attachment(s): 

Just a noob in this crazy world trying to get some electrons to obey me.

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

This is a circuit I use:

Leon

Leon Heller G1HSM

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

Hi Leon, thanks for your circuit, but seems to be the same as mine. There must be something wrong with my implementation. I will post some sequences of whats happening and maybe a brainiac can see whats going on in the weird pattern

Just a noob in this crazy world trying to get some electrons to obey me.

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

Just follow the timing diagrams in the data sheet carefully, and you should be able to get it to work. I've got some software somewhere, but can't find it.

Leon

Leon Heller G1HSM

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

There are three cascaded shift registers, 1 to 24. 1 Being the first input, then shifted to 24.
The start sequence is random junk when one turns it on.
Black = High, White = Low.

More to come shortly

Attachment(s): 

Just a noob in this crazy world trying to get some electrons to obey me.

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

I think your problem lies in the way you clock data in: a debounced switch *without* a schmitt-trigger following the RC will give slow rising- end falling-edges. And that drives the 595 nuts.
Since the days I started using AVR's, I let an AVR take care of the debounce action. And use one pin of the AVR as the output.

Nard

edit: and toggle the clock-pin only when data is stable. What do you use for data-in ? Is there a pull-up or pull-down to ensure proper levels ?

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tessa and Tina, You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

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

Plons wrote:
I think your problem lies in the way you clock data in: a debounced switch *without* a schmitt-trigger following the RC will give slow rising- end falling-edges. And that drives the 595 nuts.
Since the days I started using AVR's, I let an AVR take care of the debounce action. And use one pin of the AVR as the output.

Nard

edit: and toggle the clock-pin only when data is stable. What do you use for data-in ? Is there a pull-up or pull-down to ensure proper levels ?

Ok thanks!! Ill add in a schmitt trigger if I have, or maybe an op amp comparator.

Heres how I connect the Load and CLK lines (See attached). (The output high after the filter is 4.97V)

Attachment(s): 

Just a noob in this crazy world trying to get some electrons to obey me.

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

If your PC has a printer port I'd just hook it up to that and get it working that way. That's how I tested my hardware when I first built it. I now use the PCB I made for debugging SPI code on MCUs like the AVR.

Leon

Leon Heller G1HSM

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

I tried the op amp comparator, but I still get the same results. Even that crazy look mess up there, I got the exact same pattern.

It seems, any high bit at the start is slowly shift into a Low within one or two shifts, and a high is always shifted in.

Thats a clever idea with the printer port Leon, but my laptop doesnt have one.

Do any of you guys think the ULN2803 driver afterwards isnt messing it up (See attached)? Its actually a circuit board, and I cant disconnect the driver to see if it is it.

Attachment(s): 

Just a noob in this crazy world trying to get some electrons to obey me.

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

Heres another chart

Attachment(s): 

Just a noob in this crazy world trying to get some electrons to obey me.

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

I don't think that the drivers for the leds disturb the pattern.

How did you implement the opamp-comparator ?

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tessa and Tina, You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

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

I take it you are giving a low to high transition on the Load input to transfer the shift register to the output register? It's edge triggered, not transparent, and it needs a fairly short rise time. If you just hold it high, nothing happens.

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

Plons wrote:
I don't think that the drivers for the leds disturb the pattern.

How did you implement the opamp-comparator ?

Yes I agree with you.
Heres the op amp part

Attachment(s): 

Just a noob in this crazy world trying to get some electrons to obey me.

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

peret wrote:
I take it you are giving a low to high transition on the Load input to transfer the shift register to the output register? It's edge triggered, not transparent, and it needs a fairly short rise time. If you just hold it high, nothing happens.

Thanks for the input.

If you look at the patterns, you can see theres are some shifting going on. The storage register is being updated.

I even tied the CLK And Load lines together and clocked them with a 1Hz square wave from a frequency generator, with the data pin held low (and measured low), and it still clocked in highs as shown but the diagrams.

Just a noob in this crazy world trying to get some electrons to obey me.

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

The OpAmp comparator as drawn will not help in debouncing.

What typenumber is your OpAmp ? And what is the value of the components in your schematic ?
And have you by any chance access to 74HC14, ,74HCT14, or 74HC04 ?
How long is the wire between the clock-pin and your debounced switch ?

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tessa and Tina, You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

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

Hi Plons, those are all valid points. You are correct. When I clocked it with a frequency generator I was getting alot more sensical data than with the OP Amps. With the frequency generator it always clocked correctly, however always clocked a high in. After alot of reluctant hacking, drilling, and killing pads, I replaced the first shift register, and now it works perfectly. I must of blown the pin when soldering it in.

Thanks for all your help everyone!

Thanks for all you suggestions, I really appreicate it, and I will remember your points in future debugging adventures!

Just a noob in this crazy world trying to get some electrons to obey me.

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

Good to hear you fixed it. But for next time I attached two ways to debounce a switch. The 74HC14 is the easiest to implement, but with an OpAmp with positive feedback it can also bo done.

Nard

Attachment(s): 

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tessa and Tina, You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

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

Fever,

Nard's suggestion for modifying your op-amp circuit achieves hysteresis whereby the switch over voltage for the comparator is changed so that there is no extra pulse generated for slowly changing inputs. It is worth understanding for future projects if you do not have a 74C14.

Cheers,

Ross

Ross McKenzie ValuSoft Melbourne Australia