Author Topic: Problem in driving two segment together  (Read 1790 times)

0 Members and 1 Guest are viewing this topic.

Offline Vindhyachal.taknikiTopic starter

  • Frequent Contributor
  • **
  • Posts: 487
Problem in driving two segment together
« on: February 28, 2016, 05:10:00 pm »
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.
 

Offline pelule

  • Frequent Contributor
  • **
  • Posts: 513
  • Country: de
  • What is business? It’s other people’s money
Re: Problem in driving two segment together
« Reply #1 on: February 28, 2016, 05:22:58 pm »
If there are "shadows" in a muxed display, possile the display switching sequence is not correct.
Sequence should as following:
- all ports and Qs off
loop:
- U1 data to ports
- switch on Q1 transistor (U1 shows data)
- short wait (depend on the brigthness of the LEDs)
- switch off Q1 transistor
- U2 data to ports
- switch on Q2 transistor (U2 shows data)
- short wait (depend on the brigthness of the LEDs)
- switch off Q2 transistor
goto loop

BR
PeLuLe
You will learn something new every single day
 

Offline newbrain

  • Super Contributor
  • ***
  • Posts: 1719
  • Country: se
Re: Problem in driving two segment together
« Reply #2 on: February 28, 2016, 05:55:12 pm »
An addition to pelule's advice:
you should not be driving the transistors directly from the open drain output of the MCU.

The B-E junction will draw as much current as possible (possibly in the order of tens of milliamperes) when the OD output is set to 0, so you risk damaging either the transistor or the MCU output (or both).
A suitable series resistor should be used.

If you want to keep the 1kohm resistors to +5V (though I would use much weaker pull-ups), 2.2 or 2.7 kohm should be fine, very rough calculation:
  • Vbe ~= 0.7 so (Ohm's law) you'll have 0.7mA through the 1kohm pull up
  • needed collector current (Ohm's law, again): (Vcc-Vled)x7/Rsegment = (5-1.5)x7/510 ~= 50mA
  • hfe for BC557: min 110, so 0.5mA through BE are enough to drive it, let's double it to 1mA
  • V across the series resistence: Vcc-Vbe = 4.3V
  • for 1+0.7=1.7mA (Ohm's law, you've guessed by now!): 4.3V/1.7mA ~= 2.5kohm
Nandemo wa shiranai wa yo, shitteru koto dake.
 

Offline Vindhyachal.taknikiTopic starter

  • Frequent Contributor
  • **
  • Posts: 487
Re: Problem in driving two segment together
« Reply #3 on: February 29, 2016, 12:14:20 pm »
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.

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf