0
\$\begingroup\$

I am facing an issue while driving a four digit 7 segment display using a TI MSP430 MCU.

Some digits are overlapped.

Below is the code we are using:

#define SWITCH_DELAY 800000   // 50 msec 
#define SEG_HLD_TIME 50000    // 3 ms

void tlqi_POD_7SEG_Display_time(unsigned char in_ucHourDig1, unsigned char in_ucHourDig2, 
    unsigned char in_ucMinDig1, unsigned char in_ucMinDig2)
{
    /*------------------------Set Hour Digit------------------------*/
    tlqi_POD_display_Digit_Val(in_ucHourDig1);
    GPIO_setOutputHighOnPin(GPIO_PORT_P2, GPIO_PIN7); //digit 1
    __delay_cycles(SEG_HLD_TIME);
    GPIO_setOutputLowOnPin(GPIO_PORT_P2, GPIO_PIN7); //digit 1
    __delay_cycles(SWITCH_DELAY); 

    tlqi_POD_display_Digit_Val(in_ucHourDig2);
    GPIO_setOutputHighOnPin(GPIO_PORT_P3, GPIO_PIN0); //digit 2
    __delay_cycles(SEG_HLD_TIME);
    GPIO_setOutputLowOnPin(GPIO_PORT_P3, GPIO_PIN0); //digit 2
    __delay_cycles(SWITCH_DELAY);

    /*------------------------Set Minutes Digit------------------------*/
    tlqi_POD_display_Digit_Val(in_ucMinDig1);
    GPIO_setOutputHighOnPin(GPIO_PORT_P3, GPIO_PIN1); //digit 3
    __delay_cycles(SEG_HLD_TIME);
    GPIO_setOutputLowOnPin(GPIO_PORT_P3, GPIO_PIN1); //digit 3
    __delay_cycles(SWITCH_DELAY);

    tlqi_POD_display_Digit_Val(in_ucMinDig2);
    GPIO_setOutputHighOnPin(GPIO_PORT_P2, GPIO_PIN0); //digit 4
    __delay_cycles(SEG_HLD_TIME);
    GPIO_setOutputLowOnPin(GPIO_PORT_P2, GPIO_PIN0); //digit 4
    __delay_cycles(SWITCH_DELAY);
}

We are calling this sequence in a continuous loop.

enter image description here

\$\endgroup\$
6
  • \$\begingroup\$ Are you sure that your compiler is reading the second #define value correctly ,and not as a comment ? \$\endgroup\$
    – Nedd
    Commented Apr 4, 2022 at 8:00
  • 1
    \$\begingroup\$ I have difficulties deciphering anything useful from the 13 pixels of your schematics. So completely ignoring the hardware part: why did you add a delay of 50ms + 3ms between driving the individual segments? 53ms is an eternity and will not go unnoticed. \$\endgroup\$
    – Velvet
    Commented Apr 4, 2022 at 8:00
  • \$\begingroup\$ Similar to the comment from Seir, it seems you have a 3ms delay for segments and 50ms for digits, with 4 digits that does start adding up to a lot of overall time. 20hz overall is near a minimum to prevent seeing the flashing of multi-pexed digits. \$\endgroup\$
    – Nedd
    Commented Apr 4, 2022 at 8:04
  • 1
    \$\begingroup\$ Aside: drawing schematics in completely disconnected boxes misses the point of the whole thing completely. The schematic you drew looks like a graphical netlist. A real schematic should guide the eye and the mind in understanding and following the function. For such a simple circuit, a schematic must make sense without a single letter of text. Schematics are a graphical language. If you have to narrate them, they are useless for their primary purpose of communication. \$\endgroup\$ Commented Apr 4, 2022 at 14:40
  • \$\begingroup\$ @Kubahasn'tforgottenMonica: I couldn't disagree more with your bolded claim. Physical location of signals on a microcontroller is meaningless, almost completely so. Pin numbers are a little better, but knowing the name and enabled alt-function of the pin to which signals are connected is absolutely essential to understanding. And that's still true for "simple" circuits where the ICs are low pin-count. \$\endgroup\$
    – Ben Voigt
    Commented Apr 4, 2022 at 16:12

1 Answer 1

-1
\$\begingroup\$

You have an ON Time, but you do not have a sufficient OFF Time. So you are getting previous digit information on subsequent digits as the transistors take their time to turn off.
Use an oscilloscope to look at your muxing collectors, and you'll see that there is still current flowing from the one that is turning off, while the next one is turning on.
Adjust the blanking period and/or your circuit to allow faster turn on/off times, and that should solve your ghosting issue.

I would propose circuit recommendations, but it is currently illegible.

\$\endgroup\$
5
  • \$\begingroup\$ You really think 50 milliseconds isn't long enough? I really think it is. \$\endgroup\$
    – user20574
    Commented Apr 4, 2022 at 16:44
  • \$\begingroup\$ @user253751 It depends on the eyechart of a schematic. I've done this circuit many times over the years. If it's ghosting, then the transistors are not off before the next ones are turned on. This has both to do with circuit speed and software timing. His off time is not sufficient for his circuit. \$\endgroup\$
    – Aaron
    Commented Apr 4, 2022 at 22:58
  • \$\begingroup\$ If 50 milliseconds is not enough, then the problem is not that 50 milliseconds is too short, but the fact the circuit needs more than 50 milliseconds. \$\endgroup\$
    – user20574
    Commented Apr 5, 2022 at 9:19
  • \$\begingroup\$ @user253751 As I said, "His off time is not sufficient for his circuit." \$\endgroup\$
    – Aaron
    Commented Apr 5, 2022 at 13:34
  • \$\begingroup\$ wrong subject/object. "His circuit is not sufficient for his off time" \$\endgroup\$
    – user20574
    Commented Apr 5, 2022 at 15:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.