Why am I not able to drive this 6 digit segmetns display using 74HC595?

Thread Starter

floxia

Joined Mar 7, 2023
12
I have reverse-engineered some existing circuit that was given to me, which consists of multiplexed 6 digits 7 segments displays driven by 2 Darlington arrays and BD227 transistors.

The original circuit had an AT89 driving all the segments and digits on individual pins and used to receive data from an MAX232; I wanted to connect the displays to an Arduino so as to be able to drive the digits myself.

This is the circuit:

bA3gs.png


I have by manged to drive all the digits and DP connecting each segment pin and each digit directly to the Arduino pins utilising the SevSeg library. The code works very well, with no flickering, high brightness and no ghosting.


Hardware config set to N_TRANSISTORS.


I am now trying to attempt to drive the display using two 74HC595 and the SevSegShift library, a fork of SevSeg that adds support for shift registers, although I have not had great luck so far.


I have also tried the hybrid configuration (digits connected directly to Arduino and segments driven by the shift register) as listed on the library's git, but with the same results.


I can light up each digit, although I am not able to control each segment; all I am getting are the eight segments always light up. I have tried to add a delay in the loop to see if some segments were sequenced, but all I'm getting is all the segments on or off altogether.


I have tried all the HardwareConfig settings:


COMMON_CATHODE COMMON_ANOODE N_TRANSISTORS P_TRANSISTORS NP_COMMON_CATHODE NP_COMMON_ANODE


However, I do not see any difference besides all the segments being full brightness or slightly dimmed.


My question is, could it be something to do with the Darlington arrays interfering with the logic?

This is my shift register schematic:

KyNHQ.png

And this is the code I am using:

C:
#include "SevSegShift.h"

#define SHIFT_PIN_DS   13 /* Data input PIN */
#define SHIFT_PIN_STCP 12 /* Shift Register Storage PIN */
#define SHIFT_PIN_SHCP 11 /* Shift Register Shift PIN */

//Instantiate a seven segment controller object (with Shift Register functionality)
SevSegShift sevsegshift(
                  SHIFT_PIN_DS,
SHIFT_PIN_SHCP,
SHIFT_PIN_STCP,
1, /* number of shift registers there is only 1 Shiftregister
used for all Segments (digits are on Controller)
default value = 2 (see SevSegShift example)
                        */
true /* Digits are connected to Arduino directly
default value = false (see SevSegShift example)
                        */
                );

void setup() {
  byte numDigits = 5;
  byte digitPins[] = {2,3,4,5,6}; // Arduino pins
  byte segmentPins[] = {0, 1, 2, 3, 4, 5, 6, 7}; // 74HC595 pins
  bool resistorsOnSegments = true; // 'false' means resistors are on digit pins
  byte hardwareConfig = N_TRANSISTORS; // See README.md for options
  bool updateWithDelays = false; // Default 'false' is Recommended
  bool leadingZeros = false; // Use 'true' if you'd like to keep the leading zeros
  bool disableDecPoint = false; // Use 'true' if your decimal point doesn't exist or isn't connected

  sevsegshift.begin(hardwareConfig, numDigits, digitPins, segmentPins, resistorsOnSegments,
  updateWithDelays, leadingZeros, disableDecPoint);
  sevsegshift.setBrightness(0);
}

void loop() {
  sevsegshift.setChars("Hello");
  sevsegshift.refreshDisplay();
}
 
Last edited:

sarahMCML

Joined May 11, 2019
353
Nothing to do with your code, but if you could substitute an Allegro UDN2980 series IC for the ULN2803, you could get rid of all the transistors and associated circuitry.
And aren't the 10 Ohms series resistors letting rather a large current through the displays, even with multiplexing?
 

Thread Starter

floxia

Joined Mar 7, 2023
12
Nothing to do with your code, but if you could substitute an Allegro UDN2980 series IC for the ULN2803, you could get rid of all the transistors and associated circuitry.
And aren't the 10 Ohms series resistors letting rather a large current through the displays, even with multiplexing?
Thanks for you reply, unfortunately this is not a circuit that I have designed and the board is already existing, what I am doing is to tap in into the circuit where once there was an AT89 driving the displays. Also in regards to the 10ohm resistors I had the same impression when I was reverse engineering the circuit and I have measured them quite few times but that is what they had installed.

I am able by pulling the digits high and the segments low to drive the displays using the Arduino pins directly, therefore I am considering to try with 16bit I/O expanders such as MCP23017, PCF8575 or similar over I2C hopefully will be fast enough to drive the multiplexed displays, I have a MCP23008 laying around and I will give it a go over the next few days, I could use the Arduino pins directly but I would prefer to use 2 pins over 14.
 
Top