Prop and a 74HC595 driving a single 7 segment display.
eagletalontim
Posts: 1,399
Hello to all once again! I am tinkering with another project and have a question about the 74HC595. Is there a way maximum distance the serial data can be pushed to the 595? The reason why I ask is because my main circuit will be tucked away in a closet, but I would like to have the display mounted somewhere outside the closet, probably about 4 feet away from the main brain. I am making a circuit board that will have a surface mount 14 pin socket that will hold the display and on the opposite side, I need some sort of standard jack that will be plugged up via a standard data cable of some sort. I was hoping to use a USB cable, but I want to make sure it will work before I order some USB jacks. All I need is 5 wires and a standard USB has 4 internal plus the common shield which I hope to use as the ground.
Comments
try to use the wires in an order that if someone by mistake plug in a real usb host nothing bad happens
Cat5 is a wire type not a connector type. But I think I know what you mean. Most ethernet cable has the same wire order on the connectors. There are exceptions (I think one is a crossover wire) but most ethernet cables use the same wire order on both connectors.
There's also the possibility of using six wire phone line.
SparkFun sells sockets for both RJ-45 and the phone connectors (I don't recall the RJ number).
In my mood enhancing LED project I used ethernet cable to carry the Prop's 3.3V logic about ten feet. I'm pretty sure others on the forum have used it to carry 3.3V much further.
Edit: It was a 9 foot cable. Here's some discussion about using Cat5 to carry Prop logic.
BTW, this kind of distance is no problem really but make sure the 595 has a decoupling capacitor and add one to the clock line, just a small 100pf or so to filter out any transients from upsetting the display.
I'd think you'd be better off using the latch rather than the enable to avoid the flashing LEDs. Using the enable, you'll end up turning all the leds off during the transition while the latch would let you change from one set of LEDs to the next without flashes or having it turn off.
On the other hand, having control of the enable can be useful if you want to control the brightness of the display. You can use PWM on the enable pin to control the brightness. If you use the enable to control brightness then I'd stick with your current configuration but if you're going to leave the LEDs at full brightness, then use the latch pin to control your transitions.
By using a faster driver, you should be able to use the latch as Peter suggests without seeing any noticeable flashes.
Only time is of you multiplex and you want a all-off in between each plex as sometimes the common cathode switching creates a bleed over.
And as the Prop is so fast you could use a 74HC164 that don't have a latch and only 2 wires is needed,
you clock the 8 bits out fast (in less than 1ms) and it will not be visible to the human eye that the whole sequence went thru all the segments.
Btw, the display is a common Anode.
A shift register is already a register (latched), the output latch is only there to capture the state of the register once it's done shifting. While PWM is "nice" it isn't really necessary is it? Just get it working.
**** EDIT : The PWM would be very nice as a red display is not as bright as a blue display and I would like to dim the display according to the surrounding area lighting. If it is a dark room, a super bright LED display is not necessary. It is not a MUST have, but this is something I have not dabbled with and is a great opportunity for some hands on learning
No need to tie up a cog, the data will stay solid after the last clk pulse sent on the hc164.
And because you always send 8 clks, no need to use master reset as any "bad" data will be shifted out fast.
But the 595's latch is nicer if you have the pins available.
PWM dimming could be done in two ways,
a master dimming of common anode/cathode with a mosfet or use enable on the 595, though using a single counter pdm could be to fast.
So may have to use both counters overlapping each other with slower square wave with a result of a 0% to 50% range. (OE is active low)
Second options is sending zero (clear) data 60 times second and the pause lenght from the last real data sent will set the brightness desired.
The last option will tie up a cog as timings can not vary to much, but plenty of free time in between for the cog to do other things.
This code was used in a neat animatronics project by my friend Matt (Character Dynamics)
-- http://www.youtube.com/watch?feature=player_detailpage&v=K6V8QTdXo08&list=PLwex4JXm4a3HzJNkk9fYquGB6PTHGNYwG
The radio (in foreground, left side of screen) has a Propeller-based controller that runs the Nixie tubes and does LED control with the 595 PWM driver.