Problem in driving two segment together

Discussion in 'Embedded Systems and Microcontrollers' started by Vindhyachal Takniki, Feb 28, 2016.

  1. Vindhyachal Takniki

    Thread Starter Member

    Nov 3, 2014
    349
    6
    1. I have attached two pic 1 & 2. Driving together two segment as in circuit attached.
    Since segment pins are drived from same data pins, so I have done multiplex them using bc557.
    2. problem is when I display two different character on segments, there is shadow of each segment on another segment. Foe example in pc1, 12 is displayed. First segment as 1 on it & second segment has 2 on it. As can be seen, there is shadow of 2 on segment 1 ans 1 on segment 2.
    3. I dont know why it it is happening. Pic2 shows 11 displayed on it which is correct probably because both overshadow each other.
    4. Ckt attached shows thee segment & MCU is powered by +5V. BC557 base is driven by MCU open drain pins at T1 & T2. Code is while 1 loop where eac segment is refreshed every 1ms. I have also increased time to 10ms, but same result. 1.png 2.png ckt.png
     
  2. bertus

    Administrator

    Apr 5, 2008
    15,649
    2,348
    Hello,

    It looks like the one transistor is not in complete off state when the other transistor is active.
    Try a resistor of 2 - 10 K from the base to the +5 Volts of each transistor.

    Bertus
     
  3. John P

    AAC Fanatic!

    Oct 14, 2008
    1,634
    224
    You can't drive a transistor that way, and you might damage your processor. What you're doing is turning the transistors on without a current-limiting resistor whenever the processor pin goes low. This will cause a very large current flow, and there may be interaction between two outputs. Put the 1K resistors between the transistor bases and the processor pins, and put larger resistors from the bases to +5 in place of R1 and R2; 22K would be about right.
     
  4. JohnInTX

    Moderator

    Jun 26, 2012
    2,348
    1,029
    What the others have said plus be sure your code turns off the active digit drive before changing the segment pattern to the new digit. Turn on the new digit driver only after the new segment pattern has been written.
     
  5. dannyf

    Well-Known Member

    Sep 13, 2015
    1,830
    365
    1. slow that down to something more reasonable, like 100Hz;
    2. connect the bases of the transistors to the mcu through R1/R2 -> don't connect them to 5v.
     
  6. bertus

    Administrator

    Apr 5, 2008
    15,649
    2,348
    Hello,

    I missed the points T1 and T2.
    Better drive it as followed as the driver is open collector:

    Vind_ckt.png

    Bertus
     
  7. John P

    AAC Fanatic!

    Oct 14, 2008
    1,634
    224
    JohnInTx is making a good point--you'll see that ghosting effect if the digit selection and segment selection overlap in time. If you can't change all the outputs simultaneously, turn off both digit drivers T1 and T2, then set up the segment drive for the other digit, then turn T1 or T2 on.
     
  8. Vindhyachal Takniki

    Thread Starter Member

    Nov 3, 2014
    349
    6
    Modified the circuit as attached.
    Also code is bit changed. I had enabled segment first & then data was written.
    Now have put data & then enabled segment.Now it is working fine. Thanks for help.
    Untitled.png
     
    ErnieM likes this.
Loading...