| Electronics > Beginners |
| Can I multiplex a 2-digit 7-segment display one segment at a time? |
| << < (5/7) > >> |
| Nusa:
Defining ON as whichever state for each pin is required to light the segment. OFF as either the other state or tri-state, as appropriate. Segment A ON, Anode 1 ON, Anode 2 ON = segment A lit on both digits. Segment A ON, Anode 1 OFF, Anode 2 ON = segment A lit on digit 2 only Segment A ON, Anode 1 ON, Anode 2 OFF = segment A lit on digit 1 only Segment A ON, Anode 1 OFF, Anode 2 OFF = segment A off on both digits. Four possibilities for each cycle. Get it now? |
| Peabody:
--- Quote from: Nusa on December 02, 2018, 06:09:28 pm ---Defining ON as whichever state for each pin is required to light the segment. OFF as either the other state or tri-state, as appropriate. Segment A ON, Anode 1 ON, Anode 2 ON = segment A lit on both digits. Segment A ON, Anode 1 OFF, Anode 2 ON = segment A lit on digit 2 only Segment A ON, Anode 1 ON, Anode 2 OFF = segment A lit on digit 1 only Segment A ON, Anode 1 OFF, Anode 2 OFF = segment A off on both digits. Four possibilities for each cycle. Get it now? --- End quote --- Yes. I do. Thanks for spelling it out for me. Sorry to be so dense. The coding would be more complicated, but it would indeed update both at the same time. It's kinda like charlieplexing in a way. Thanks very much. |
| ogden:
--- Quote from: Peabody on December 02, 2018, 06:05:19 pm ---As I just said to Nusa, I don't see how I can do what you're suggesting if the segments on the two digits are connected to the same I/O pin. Perhaps you could explain how I would do that. --- End quote --- Ok. I'll try to explain. Default/off state of two anode pins is '1' and 7 cathode pins '0'. You just loop through all the segments by setting according anode pin to '1. After anode pin set done, you check if digit "A" segment needs to be lit - if yes, then you change it's cathode pin state to '0 otherwise set it '1'. You do the same with cathode pin of digit "B" as well. Same logic for more than two segments digits. Dunno if it explains or not - but be my guest anyway. |
| Peabody:
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. |
| Nusa:
--- 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. |
| Navigation |
| Message Index |
| Next page |
| Previous page |