ShiftOut 74HC595 Hello World example problem

Hello,

I tried the example 1.1 provided on this tutorial : http://www.arduino.cc/en/Tutorial/ShiftOut

The leds blink when the counter increment, they are very bright and the led connected to Q0 is acting crazy.

If I remove the connection from IC pin 8 to ground, the counter is ok, the leds are very bright and you can see them blink for every increment.
If I remove the connection from IC pin 16 to 5v, the order becomes random, Q0 acts mad, but the led are not that bright any more.
If I remove IC 8 + IC 16, it seems to work as expected, no more blinking when counter increments, and brightness is smooth.

Now I have nothing connected to pin 8 and 16, but I am not sure this is how it supposed to work.
And I can't think that the example would be faulty, nobody else seems to be complaining.

Any advice would be welcome.

Regards,
Philippe

Ok first thing - which chips and how is it connected?

Don't just say like in the example - often people wire something wrong and don't realise.

Oh - and get rid of the cap - it's really not necessary.

The chip is 74HC595N.
I bought it very recently.
I have been looking for the datasheet but all links I found are for 74HC595.
Can I assume they are the same ?

I have reviewed the circuit several times to match exactly the example.
As I have several of these chips, I tried with all of them, same result.

I will post a picture of the circuit on my Picasa account this evening and post the link.

Thank you for your time.

Philippe

Yes I'm pretty sure they have exactly the same functionality.

Very bright led maybe missing current-limiting resistors? We'll see what is wrong after you get a picture online.

In the tutorial this line is utter rubbish:-

Notice the 0.1"f capacitor on the latchPin, if you have some flicker when the latch pin pulses you can use a capacitor to even it out.

Including this capacitor could damage your arduino.
Take that capacitor and put it between pins 8 and 16, the power rails, it will actually do some good in that position.

Also don't go disconnecting the power and ground (Pins 8 and 16) from a chip while feeding signals into the other lines. This could damage the chip.

Other that than anything else that doesn't work is down to you.

I rebuilt the circuit in order to have a clear picture, and it's doing the thing now :blush:
It's a shame I didn't take a picture before redoing it, I would have understood what went wrong.
I even tried to 'rebug' it without success :fearful:
What I learned ?
Don't feel confident and take pictures of your circuits before they are gone, it might be useful afterwards, for yourself and for others.
Thank you so much for the checkpoints.
I feel so ashamed now, could you delete this post forever :zipper_mouth_face: ?
Philppe

Btw,
nice blog mowcius, I've enjoyed reading your articles.
Also Grumpy_Mike which I have seen contributing and helping in almost every thread.
And the others of course.

nice blog mowcius, I've enjoyed reading your articles.

Blog? Did you mean to put liudr there?

Hmm, well looks good to me - do you have more than one chip you could test?

I tested the others and they work too.
I guess this is the expected result, smooth and bright, unless you tell me otherwise :wink:
I just put the pictures as an extra, maybe it helps someone one day.
And it helps me reminding these wild moments ;))
Just kidding ***
Thank you for your time.
I might be back soon as it was the first step for a 7*5 led module, that I want to drive with this chip + ULN2805.
For which I will pay extra attention when building the circuit.
Regards

Thanks for the compliment on my blog. You are using 100Ohm resistors, quite large. 5V/0.1KOhm=50mA. I don't think the 595 can sink 50mA on each pin, let alone when you turn on all the leds, that's 400mA.

It sources the current but I had not looked at the resistors being used - I can't remember the specs but if that's what happens on all the chips then perhaps liudr is right.

I just looked online at a Philips 74HC595N, it sinks 35mA per channel and is rated at 0.5W max. If the current you have is near 50mA (I don't know the voltage rating of your LED), the channels may get damaged or not work, and the total power is more than 5V0.05A8=2W, also too much to dissipate from the chip. Suggest you reduce current by increasing resistor value to at least 200 Ohm to stay within both the current per channel and total power rating. I also use this type of setup for a persistence of vision display, where the LEDs are quite bright but they also drop 3.xV of voltage so I guess I didn't go over the rating while doing this:

it sinks 35mA per channel

So that means that you connect the LED to +5V, then the resistor and finally to the shift register output. This chip can sink much more current than it can source so you must drive it like this. Now a zero will turn on the LED and a one will turn it off.

I didn't change my setup, still sourcing.
I used my multimeter to check current and here the results :

  • 100 ohm resistor : 17,72 mA
  • 220 ohm resistor : 10,65 mA

if R = I / C
then I = C * R

  • 100 ohm resistor : 100 * 0,018 = 1,8V
  • 220 ohm resistor : 220 * 0,011 = 2,42V

Even if I substract drop voltage from 5v, how is it possible to have different values at the end ?

Because you are not getting 5V out when sourcing current. You are asking too much of the output and so the voltage sags and ohms law appears not to work. Try measuring the output voltage under load.

I am not sure I understand the request, I made the measuring with all leds on while sourcing.

The datasheet says :

IO output source or sink current VO = ?0.5 V to VCC + 0.5 V
Q7’ standard output ? ±25 mA
Qn bus driver outputs ? ±35 mA
ICC, IGND VCC or GND current ? ±70 m

which I don't understand very much.

http://www.nxp.com/documents/data_sheet/74HC_HCT595.pdf

it sinks 35mA per channel and is rated at 0.5W max.

So this one sinks?

I would say it's unlikely that the LEDs are more than 35mA...