[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/diy/ - Do It Yourself


View post   

File: 789 KB, 3150x2202, 20131125_005643.jpg [View same] [iqdb] [saucenao] [google]
557922 No.557922 [Reply] [Original]

Hey /diy/

Have any of you had any experience driving a 7-segment 3-digit display with two 74HC595's?

At the moment, I have one of the 595's connected such that it drives 3 NPN's to select what segment to display (diagram attached). While the other 595 is used to drive the segments to display the wanted digit. So far I can get a simple all ON/OFF, but am not having any luck with displaying select numbers; the code for this is bellow:

http://pastebin.com/Lw77kBrn

It appears that as soon as I send "shiftOut(dataPin, clockPin, MSBFIRST, 0xFF)", anything besides 0x00 or 0xFF, then I get some strange things displaying.

>> No.557927

What kind of weird things?
What do you see if you first shift in 0x01 and then 0xFE?

>> No.557929
File: 259 KB, 1000x750, IMG_20131125_014450.jpg [View same] [iqdb] [saucenao] [google]
557929

>>557927
I see this, am pretty sure that I have connected everything correctly, have a though its something to do with my code, though not exactly sure what.

>> No.557932
File: 13 KB, 280x195, 1385262118533.jpg [View same] [iqdb] [saucenao] [google]
557932

your 3 digit display segment arrangement is a bit odd. all the 7 seg (any number of digits even single digit ones) was always arranged like this.

>> No.557933

>>557932
Ah, ignore my lettering, could not find a datasheet for the display so had to figure out which pin did what.

>> No.557934
File: 327 KB, 1280x720, IMGA0692.jpg [View same] [iqdb] [saucenao] [google]
557934

I'd need to see your shiftOut function to see where you fucked up. I can already see you have some mistakes in dataArrayNumber. A "0" should light up every LED but the middle one, so its value should not be 0x00.

Pic is a project I did very similar to yours using 74HC164s

>> No.557937

>>557929

Check that
- you're using the right shift clock edge
- your transistors are PNPs like your schematic says

>> No.557950
File: 30 KB, 550x701, ShftOut_Schm2.gif [View same] [iqdb] [saucenao] [google]
557950

set this up. it'll let you see what bits are ending up where. one the bit patterns looks right, put in the 7seg.

>> No.557972 [DELETED] 

you've connected the inputs of both chips in parallel. so how the hell do you manage send diff data to each chip? seems to me you need an extra select input line so your data goes to the right chip.

>> No.558395
File: 46 KB, 398x314, 1385327149769.jpg [View same] [iqdb] [saucenao] [google]
558395

>>557934
Yea, code was fucked, went over the Arduino tutorial for shiftOut, and modified it to this:
http://pastebin.com/a8P1f01P
Seems to work just fine now.

>>557937
Sorry transistors on schematic should have been NPN's, not sure what you mean by shift clock edge, but turns out that both data and bytes should be sent in reverse, modified code to allow for this and it all seems to be working.

>>557950
Man, should have done this right from the start. Did as you said and was super easy to debug the problem.

Thanks guys :D

>> No.558973

why not connect them in series?
having the 8th bit on the first connected to in on the next.
having 3x 74595 and only using 3 pins(common clock and latch).
one bit per segment(including dot)
no multiplexing required!

still, good job.

>> No.558975

>>558973
>why not connect them in series?

But that's exactly what he's doing.
Except that he uses only two registers, since he has a multiplexed display.

>> No.559003

>>558975
ah, i was thinking one per digit.
but i see now that that wouldn't work with display.

my bad.

>> No.559071

>>557922
>electronics
not even fucking once

>> No.559136
File: 134 KB, 740x952, circuit_diagram.png [View same] [iqdb] [saucenao] [google]
559136

>>559071
all day. erry day nigga