Electronics > Beginners
Can I multiplex a 2-digit 7-segment display one segment at a time?
<< < (6/7) > >>
Peabody:

--- Quote from: Nusa on December 02, 2018, 10:00:14 pm ---
--- Quote from: Peabody on December 02, 2018, 08:02:54 pm ---Yes, I understand now.  Thanks very much.  And this method has the advantage that you can have any number of digits without changing the timing or inducing flicker.  And still only one resistor per common A or C pin.  So yes, this is better.  I guess it should have been obvious, but it wasn't.

--- End quote ---

The number of digits would be limited by how much current your segment pins can sink/source (usually they can sink more than they can source) with the resistor value chosen for the anodes/cathodes. And of course by how many pins are available to use.

--- End quote ---

Yes, I guess that's right.  Anything above maybe four digits might run up against current limits on the segment driver pins.  So no free lunch.

It's amazing to me that neither my version nor the odgen/Nusa version of segment multiplexing appears anywhere on Youtube, or anywhere else that I can find.  I may not be searching for the right thing, but everything I see on multiplexing 7-segment displays switches one full digit at a time, either directly from the MCU  with all the resistors and transistors, or through various decoders or shift registers.  I think Dave should do a video on this.  :-)

Nusa:
Search for "Led matrix multiplexing" for the concepts.

7-segment digits are just a bunch of LED's with one of the matrix dimensions enforced in the package.

You can do the same thing for input with a switch matrix.
Peabody:
I finished coding this for the TI MSP430G2452 and breadboarded the circuit for testing, and it works well.  I used the ogden-Nusa method of multiplexing two segments at a time.  With a 488 Hz (2ms) interrupt rate, that makes the refresh rate about 70 Hz, which is more than enough to prevent any flicker.

So as described earlier, I have no resistors on the segment lines, and a 470 ohm resistor on each common cathode line.  Using Vishay's TDSR1360 displays produces bright segments, but at 3.3V and the displays reading "88", current is only 2.5ma per common cathode line, or 5ma in total to drive the displays, which I think is quite good.  The Vishay displays appear to be very high efficiency red.  I tried using old normal displays, and they are considerably less bright.

I was going to enable each segment line via the direction register, but that would have left all the unselected pins floating, and enabling pullups might cause problems.  So in the end I just left all the segment pins as outputs, with all but one being low at any time, which was no more difficult to code.

I was planning for the code to determine whether the displays are CA or CC, so that one software version would support both automatically.  But I couln't figure out a way to do that without adding hardware.

ogden:

--- Quote from: Peabody on December 07, 2018, 07:01:29 am ---With a 488 Hz (2ms) interrupt rate, that makes the refresh rate about 70 Hz, which is more than enough to prevent any flicker.

--- End quote ---

Congrats! Also thank you for update - it is always good to know final results.


--- Quote ---I was planning for the code to determine whether the displays are CA or CC, so that one software version would support both automatically.  But I couln't figure out a way to do that without adding hardware.

--- End quote ---

Right. It would be easy if voltage drop of indicator LED's would be <=0.5V or so, but it is not. You can try this (not verified) idea: Take one segment pin with ADC input capabilities (from port P1), configure it as input with pull-up and enable ADC operation on this pin as well. Set common pin to '1' and measure voltage, set to '0' and measure again. If voltage follows common pin state - you got common cathode. If it's state does not follow then you either decide that indicator is common anode or faulty. You may repeat with pull-down to be sure that you got common cathode. [disclaimer] I am never used ADC on input with pull-up/down enabled, but IMHO it shall work according to Port1 schematics in DS.
Peabody:

--- Quote from: ogden on December 07, 2018, 12:28:12 pm ---You can try this (not verified) idea: Take one segment pin with ADC input capabilities (from port P1), configure it as input with pull-up and enable ADC operation on this pin as well. Set common pin to '1' and measure voltage, set to '0' and measure again. If voltage follows common pin state - you got common cathode. If it's state does not follow then you either decide that indicator is common anode or faulty. You may repeat with pull-down to be sure that you got common cathode. [disclaimer] I am never used ADC on input with pull-up/down enabled, but IMHO it shall work according to Port1 schematics in DS.

--- End quote ---

Yes, I think that would probably work for the TI chips, but this will probably end up on an Atmel, or maybe even something else, so I'd like to keep the logic as general as possible at this point.  But I may take another look at this idea when it gets to its final home.

 
Navigation
Message Index
Next page
Previous page
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod