Floating pins problem with 74HC595 and propeller.
DavidM
Posts: 630
Hi,
I have successfully written some code to control a shift register the 74HC595.
I am using the propeller demo board and a bread board with the shift register on it, I have 8 led's connected to the 595, My program simply turns on the LEDS on and off every second.
I have three lines coming from the propeller, CLOCK , LATCH AND DATA, as well as VSS & VDD ( 5 in total)
PROBLEM..
I have noticed that when I immediately turn on the propellor board that I get a sequence of leds flashing very quickly from 1 to 8 before the propellor code runs!
I have used the schematic from BS2 projects that show demos of the BS2 connected with the 74HC595 chip.
QUESTION..
How can I prevent the FALSE flashing of the outputs ( the LEDS) during power up? I think this has something to do with floating pins!
By the way ( used the code for SHIFTOUT from the BS2 library functions and it had an error , the LATCH pin is not mentioned at all in the code.
regards
David M
I have successfully written some code to control a shift register the 74HC595.
I am using the propeller demo board and a bread board with the shift register on it, I have 8 led's connected to the 595, My program simply turns on the LEDS on and off every second.
I have three lines coming from the propeller, CLOCK , LATCH AND DATA, as well as VSS & VDD ( 5 in total)
PROBLEM..
I have noticed that when I immediately turn on the propellor board that I get a sequence of leds flashing very quickly from 1 to 8 before the propellor code runs!
I have used the schematic from BS2 projects that show demos of the BS2 connected with the 74HC595 chip.
QUESTION..
How can I prevent the FALSE flashing of the outputs ( the LEDS) during power up? I think this has something to do with floating pins!
By the way ( used the code for SHIFTOUT from the BS2 library functions and it had an error , the LATCH pin is not mentioned at all in the code.
regards
David M
Comments
The BS2 SHIFTOUT code does not mention the LATCH pin because it's not part of the SHIFTOUT function. It's not an error. There are many other devices that do not have the latches that the 74HC595 has.
Regarding the latch pin , fair enough, but it had me stumped for hours!
I placed two 10K resistors between the CLOCK & LATCH pins and back to ground.
This SORT OF works.
I slowed down the flashing of the led's so I could turn the POWER OFF when the LEDS were either on or off, I have noticed that if I turned the power off and then on again when all of the led's were off, then your suggestion works ok,
But if the power is turned off when the led's were on, then it seemed to remember the state of the outputs ( i.e all on) until the propeller is ready, So I need some way of resetting the outputs of the 595 to always off during power up! Any ideas
regards
Dave M
There is an output enable (/OE) pin. You could have a pull-up on this and connect it to a Propeller I/O pin. During initialization, the last thing the Propeller would do is to set this pin to a low output which would turn on the 74HC595 output drivers. If you're just driving LEDs, this would leave them unpowered initially. If you're feeding logic inputs, you'd have to have pulldowns on those outputs so the inputs would see a logic low.
Mike's last suggestion of pulling up the OE line and controlling is what we spoke about on the phone.
How many outputs do you want to control .. there may be a better way..??
Ronald
Ok I have it working now! Thanks
I hooked up the enable pin of the 595 using a 10K resistor to 5V+ ( pull up ) and then the same enable pin to a 470R resistor to an extra I/O pin on the prop. I set the ENABLE pin to LOW ( OFF ) at the start of my code and it seems to work.
Does this means that the enable pin is always getting 5V but its not floating?
thanks
dave M
The enable pin of the 595 is pulled to whatever voltage is on the +5V line by the 10K resistor. I say this because it usually takes a few milliseconds for this to actually reach +5V when you turn the power supply on. The 595 input pin and the Propeller input pin are high impedance initially and don't present much of a load on this, so, even though you have a 10K resistor there, the voltage on the enable pin is essentially the same as the +5V line. By definition, the enable pin is not floating because its voltage is always defined (floating = undefined).
Once your code gets around to initializing the pin to an output, the I/O pin overrides the "weak pull-up" since the I/O circuitry in the Propeller connects the enable pin to either roughly +3.0V or 0.3V (logic high or logic low) through a low resistance. The input circuitry of the 595 treats the +3.0V as a logic high so all is well. When the output pin (OUTA) is set to low, the enable pin is effectively grounded.
This is kind of a longish and detailed explanation, but I hope it gives you a bit more insight into what you're doing.
I am slowly understanding this.
The main thing now is that IT WORKS, I will document my breadboard circuit so I can use this info later in my main project.
Having the control of the ENABLE PIN is now a GOOD THING for my project.
Next, I have to work out how to cascade 2 or more 595's.
regards
Dave Metus
Thank you so much for providing a clear and easy to understand reason why to put a pull up or pull-down resistor in an IC to IC connection. I have wondered about this and it briefly comes up in theory articles but it's been a little confusing on when you actually need to do this. Please let me know if this is standard practice in all IC to IC I/O connections? Should I always have a pull-up /down resistor? If so, what formula should i use to calculate optimal resistor values?
I have an IT Informations Systems Degree and Electronics Engineering Assoc. Degree from 15 years ago but i am just now revisiting the electronics area after being in I.T. Infrastructure for the last 20 years(I was banging a kayboard in '84 at 14 and started working for banks at age 20 so I'm old school..LoL...). I am defiantly enjoying it again though for the second time in my life. I am currently integrating the Prop into my products for lighting control and hope to have a new product for my industry soon. I am VERY interested in I2C, Serial, etc.. Shift Registers and Shift-Registers with DC/GS/PWM control and it's been daunting. I'm slowly picking up more advanced skills but it will probably be a while till i can really get down with the prop. Lol.. Your explanations helped out a lot and I hope to read more.
Thanks again for the info!
Jordan
You can use that formula
IF You connect one IC in that chain that have know output state ---> You don't need that resistors.
IF You connect IC's that don't have know states ( Inputs/TriState-In/Out) USE that resistors and place by them that connection is state You prefer (+/-)
that someone has that could show how to drive several of these shift registers chained together ?
A newb question I know, but well, I am a newb LOL
I see a lot of stamp examples but have not found a Prop example yet.
Thx
Here's a shift register object I've used several times.
http://obex.parallax.com/objects/437/
Duane
You simple send the 8 clocks * chips used before doing the latch.
see my code here:
http://forums.parallax.com/showthread.php?129182-New-LED-driver-for-PPDB-Now-Available&p=983421&viewfull=1#post983421
I also made a 1wire version that uses 1.5k ohm, 33k Ohm and two 2.2nF caps to hold serial and latch.
http://forums.parallax.com/showthread.php?134106-Updated-17seg-LED-driver-for-PPDB-now-available.&p=1031110&viewfull=1#post1031110
Robert