Maker Pro
Maker Pro

Driving a 12 pins LED display

sanyibacsi

Sep 15, 2015
6
Joined
Sep 15, 2015
Messages
6
Hi There,

First post on this forum, any idea would help.

I have an controller board with two 74HC595 shift registers serial connected and a 12 pins 8 segments cathode LED display. My board is complete now and the multiplexing segments work (4 positioning, 8 for segments).

But, something is wrong. If I set the position to high then it does not show the number, if I set it to low, it shows the number. That feels like a little glitch. Still okay.
But the pain is that I can show only one kind of number (like 0 OR 8, not different ones like 0 AND 8). The numbers are displayed in the proper position but when I would like to write another number to the LED display, the previous gets deleted.

So basically what happens:
1. Write 0b0011 and 0b11111111 to get first two characters set to 8.8.
2. Then write 0b1101 and 0b00000011 to get third character to 1
But, the second write makes also 8.8. disappear.

How can it be done (so different values are written to different characters via those shift registers in a way that previous are not cleared)?

I found specs for the LED display here, page 35-36.
http://datasheet.sparkgo.com.br/LD3361BS.pdf

Many thanks... :)
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
The issue is most probably not with the LEDs but with the controller board. Do you have a schematic and/or manual of the controller board? Mainly we need to see how the shift registers are connected to the data input and to the LEDd segments.
 

sanyibacsi

Sep 15, 2015
6
Joined
Sep 15, 2015
Messages
6
This is how I got it connected. (The display is just one piece, 4 digits, 8 segments, 12 (2x6) pins so the drawing of the LED is panel is just an illustration).

I post also this code in case if there is something obviously wrong there.
I tried to move
digitalWrite(LATCH_PIN, LOW); and digitalWrite(LATCH_PIN, HIGH);
into the Show function before and after shiftOut (LOW before, HIGH after) but that did not help at all.

Now I am really clueless.

Code:
const int CLOCK_PIN = 2;
const int LATCH_PIN = 3;
const int DATA_PIN = 4;

void setup() {
  // Arduino ports
  pinMode(CLOCK_PIN, OUTPUT);
  pinMode(LATCH_PIN, OUTPUT);
  pinMode(DATA_PIN, OUTPUT);
}

void Show(int Digit1, int Digit2, int Digit3, int Digit4, int Num1, int Num2) {
  if (Digit1 > 0) {
  Num1 |= 0b00100000;
  }
  if (Digit2 > 0) {
  Num1 |= 0b00000100;
  }
  if (Digit3 > 0) {
  Num1 |= 0b00000010;
  }
  if (Digit4 > 0) {
  Num2 |= 0b00000001;
  }

  delayMicroseconds(5);
  shiftOut(DATA_PIN, CLOCK_PIN, LSBFIRST, Num1);
  delayMicroseconds(5);
  shiftOut(DATA_PIN, CLOCK_PIN, LSBFIRST, Num2);
}

void loop() {
  // Just make it '8.'
  int Out1 = 0b00011001;
  int Out2 = 0b00111110;

  digitalWrite(LATCH_PIN, LOW);

  // Clear LCD, 1 = no show, 0 = show
  Show(1, 1, 0, 0, Out1, Out2); // Generates <empty> <empty> 8. 8. on the LED display
  Show(0, 1, 0, 1, Out1, Out2); // 8. <empty> 8. <empty>
//  Show(1, 1, 1, 1, Out1, Out2); // <empty> <empty> <empty> <empty>

  digitalWrite(LATCH_PIN, HIGH);

  delay(5000);
}

View attachment 21983
 

Attachments

  • board_12_pin_4_digits.png
    board_12_pin_4_digits.png
    161.8 KB · Views: 216
Last edited:

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
I'm not particularly fond of deciphering a circuit from a setup as shown (I'll admit that you posted a neat drawing). Do you have a real schematic (something like shown here)?
 

davenn

Moderator
Sep 5, 2009
14,254
Joined
Sep 5, 2009
Messages
14,254
This is how I got it connected. (The display is just one piece, 4 digits, 8 segments, 12 (2x6) pins so the drawing of the LED is panel is just an illustration).

as Harald hinted at, we need the real circuit of your circuit
What you have shown us isn't even complete for what it is
and it tells us nothing about your actual circuit

cheers
Dave
 

TedA

Sep 26, 2011
156
Joined
Sep 26, 2011
Messages
156
I think it's a bit harsh to say that the linked pictorial diagram provides no information. In conjunction with the LED display datasheet, also linked, one might figure out what's going on. One would also have to look up the 74HC595, as well as the controller board. The real point is that the forum members with enough idle time to do this may not be the ones with the best answers.

An ideal original post would have included a "real" schematic, plus links to specifications for all significant components. If you don't have one or another of these things, an appeal for help with documentation would be reasonable.

I'm not sure, but perhaps the problem is all in how the code works with the multiplexed display. I will not claim to have analyzed your code, but it seems too simple to do everything it has to do.

Since all four digits are multiplexed together, usually only one digit should be lit up at once. If you want to see more than a single digit, the multiplexing must cycle through all the digits quickly enough that the eye perceives them to all be lit at once, even though each one is off 3/4 of the time.

So the good news is that your hardware is likely working correctly. The bad news is that you have a non-trivial coding task, and that the controller board will be pretty busy keeping all the balls in the air at once. When the controller stops serving up new bits to the display, the display stops working.

Ted

PS A few power supply bypass capacitors would not be a bad thing.

And did you see this, on pg. 38 of the display data:

Absolute Maximum Rating (Ta = 25°C)...
Reverse Voltage 3 V ... Reverse biasing of the dot matrix is not recommend, will cause damage to the leds

With 5V powering the CMOS shift registers, you will exceed the 3V limit.

Open drain shift registers are to be had, even ones with current limited outputs to eliminate the resistors. Or you might use isolation diodes, at least for long wavelength colors.

If this is a one-off project, you might just ignore the reverse voltage rating; at worst , the display croaks.

Ted
 

BootLeg

Oct 27, 2015
2
Joined
Oct 27, 2015
Messages
2
On each 74HC595 is pin 13 (-OE) tied to ground? I'm guessing it is and your diagram just doesn't show it, but I had to ask.
 

TedA

Sep 26, 2011
156
Joined
Sep 26, 2011
Messages
156
I believe you are correct. Pin 13 cannot be left adrift.

There are other problems with this design, starting with the choice of a 74HC595 to drive the display. If that's your application, you might want to use another part.

It seemed that the original poster lost interest, or perhaps he was put off by some of our replies back in September.

If you are working on a similar project, you might want to tell us more about it.

Ted
 

cl10Greg

Mar 20, 2014
25
Joined
Mar 20, 2014
Messages
25
Hello,

So aside from the clock problem (that may still be the problem) I have a new issue. So I was able to get the control to work for the first shift register just fine and wired up the 2nd one. I am sending (bit banging) 32 bits across the register with a raspberry pi using 5V as the source and sinking through the SR. I have a problem with i send a bit to set the 7th channel of the first register or the 1st channel of the daisy chained 2nd register, 00000001 and 000000001. It results in both of them lighting up at the same time. It could still be a clock problem but all the other bits after the first one on the second register worked perfect. It almost seems like the bits get messed up or the clock is shifting twice in the time it takes to try and set one. Any ideas? I plan on probing the system when I get home but I wanted to get a head start since it's bugging me now. I will also hook up the 3rd shift register to see if that first channel problem exists on the first register of each chained chip.
 

cl10Greg

Mar 20, 2014
25
Joined
Mar 20, 2014
Messages
25
Update 00000001 turn on channel 7 of the first register and channel 0 of the second register. 000000001 turns on channel 1 of the second register (so it skips channel 0).
 

cl10Greg

Mar 20, 2014
25
Joined
Mar 20, 2014
Messages
25
Nevermind...as per my first post. I added a resistor because the clock was acting weird so I took it back out now and no issues. Probably some coding problems too that I resolved. Ugh shoot me in the face. o_O
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
Have you ensured you have a common ground?

I think that was a suggestion in what I think was the first part of this thread.

I would have replied earlier, but starting a nee thread without a pointer to the old one meant I wad unsure what the first part was (and as I'm using a mobile device its a bit harder to look up your other threads).
 

TedA

Sep 26, 2011
156
Joined
Sep 26, 2011
Messages
156
It is indeed bad form to run multiple threads for the same topic. Perhaps a moderator will do some amalgamation.

What we need to start:

Two threads, same topic:

Driving a 12 pins LED display

https://www.electronicspoint.com/threads/driving-a-12-pins-led-display.275486/#post-1668994

74HC595 Part 2

https://www.electronicspoint.com/threads/74hc595-part-2.280252/

Data Sheet:

http://www.ti.com/lit/ds/symlink/sn74hc595.pdf


The sensitivity of your circuit to the exact timing of the clock line for the shift registers makes me suspect you are not providing long enough setup and hold times for the 74HC595. These are specified on page 7 of the TI data sheet.

The gist of these specifications is that the 74HC595 clock edges should not occur just as the data line is changing.


I think this applies to both edges of the clock signal. You might see if you can figure this out from the data sheet, but it may be easier to just assume that you must never allow the data bit to change when the clock bit is being changed.

This requires more code, making more writes to I/O pins.

Make sure your code sets the data bit where it needs to be, then changes the clock bit. The shift register is fast enough that just writing the data bit then writing the clock bit as soon as you can will allow plenty of time.

This is the sort of problem that can drive you crazy, because if you are doing it wrong, it may still almost work. Some of the time.

It is also possible that the problem stems from poor grounds, poor power supply bypassing, or long wires connecting things together, as already suggested.

Ted
 
Top