From WikiChip
Editing seven-segment display

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

This page supports semantic in-text annotations (e.g. "[[Is specified as::World Heritage Site]]") to build structured and queryable content provided by Semantic MediaWiki. For a comprehensive description on how to use annotations or the #ask parser function, please have a look at the getting started, in-text annotation, or inline queries help pages.

Latest revision Your text
Line 11: Line 11:
 
There are two basic configurations of seven-segment displays: common cathode (CC) and common anode (CA).  
 
There are two basic configurations of seven-segment displays: common cathode (CC) and common anode (CA).  
 
=== Common Anode ===
 
=== Common Anode ===
A '''common anode seven-segment display''' is one where the anode leads of all the LEDs are tied together. In a CA SSD, power must be supplied to anode that is common to all the segments. Appropriate segments can be lit up by applying ground to them.
+
A '''common anode seven-segment display''' is one where the anode leads of all the LEDs are tied together. In a CA SSD, power must be supplied to anode that is common to all the segments. Appropriate segments can be lit up by applying ground to them. In this setup a [[pull-down resistor]]
  
 
=== Common Cathode ===
 
=== Common Cathode ===
Line 18: Line 18:
 
{{clear}}
 
{{clear}}
 
== Basics ==
 
== Basics ==
{{further|/representing letters|l1=Representing Letters}}
+
[[File:7 segment display labeled.svg|thumb|200px|right|The individual segments of a seven-segment display.]]
The various numbers (and [[/representing letters|possibly A-F]]) can be displayed by simply powering the correct segments by either connecting GND or Vcc depending on your configuration. The usage of displaying various words on a 7-segment display [[/representing letters|is possible]] but is generally highly discouraged.
+
The various numbers (and possibly A-F) can be displayed by simply powering the correct segments by either connecting GND or Vcc.
 
 
{| class="wikitable" style="text-align: center;"
 
!rowspan="2" | Digit !! colspan="4" | [[BCD]] !! colspan="7" | 7-Segments !! rowspan="2" | abcdefg !! rowspan="2" | gfedcba !! rowspan="2" | Display !! rowspan="2" | Reference
 
|-
 
! D !! C !! B !! A !!      a !! b !! c !! d !! e !! f !! g
 
|-
 
| 0 || 0 || 0 || 0 || 0 || 1 || 1 || 1 || 1 || 1 || 1 || 0 || 0x7E || 0x3F || {{7seg|0|10}} || rowspan="16" | [[File:7 segment display labeled.svg|200px]]
 
|-
 
| 1 || 0 || 0 || 0 || 1 || 0 || 1 || 1 || 0 || 0 || 0 || 0 || 0x30 || 0x06 || {{7seg|1|10}}
 
|-
 
| 2 || 0 || 0 || 1 || 0 || 1 || 1 || 0 || 1 || 1 || 0 || 1 || 0x6D || 0x5B || {{7seg|2|10}}
 
|-
 
| 3 || 0 || 0 || 1 || 1 || 1 || 1 || 1 || 1 || 0 || 0 || 1 || 0x79 || 0x4F || {{7seg|3|10}}
 
|-
 
| 4 || 0 || 1 || 0 || 0 || 0 || 1 || 1 || 0 || 0 || 1 || 1 || 0x33 || 0x66 || {{7seg|4|10}}
 
|-
 
| 5 || 0 || 1 || 0 || 1 || 1 || 0 || 1 || 1 || 0 || 1 || 1 || 0x5B || 0x6D || {{7seg|5|10}}
 
|-
 
| 6 || 0 || 1 || 1 || 0 || 1 || 0 || 1 || 1 || 1 || 1 || 1 || 0x5F || 0x7D || {{7seg|6|10}}
 
|-
 
| 7 || 0 || 1 || 1 || 1 || 1 || 1 || 1 || 0 || 0 || 0 || 0 || 0x70 || 0x07 || {{7seg|7|10}}
 
|-
 
| 8 || 1 || 0 || 0 || 0 || 1 || 1 || 1 || 1 || 1 || 1 || 1 || 0x7F || 0x7F || {{7seg|8|10}}
 
|-
 
| 9 || 1 || 0 || 0 || 1 || 1 || 1 || 1 || 1 || 0 || 1 || 1 || 0x7B || 0x6F || {{7seg|9|10}}
 
|-
 
| A || X || X || X || X || 1 || 1 || 1 || 0 || 1 || 1 || 1 || 0x77 || 0x77 || {{7seg|A|10}}
 
|-
 
| b || X || X || X || X || 0 || 0 || 1 || 1 || 1 || 1 || 1 || 0x1F || 0x7C || {{7seg|b|10}}
 
|-
 
| C || X || X || X || X || 1 || 0 || 0 || 1 || 1 || 1 || 0 || 0x4E || 0x39 || {{7seg|C|10}}
 
|-
 
| d || X || X || X || X || 0 || 1 || 1 || 1 || 1 || 0 || 1 || 0x3D || 0x5E || {{7seg|d|10}}
 
|-
 
| E || X || X || X || X || 1 || 0 || 0 || 1 || 1 || 1 || 1 || 0x4F || 0x79 || {{7seg|E|10}}
 
|-
 
| F || X || X || X || X || 1 || 0 || 0 || 0 || 1 || 1 || 1 || 0x47 || 0x71 || {{7seg|F|10}}
 
|}
 
 
 
In-code decoding can be done easily using a simple [[lookup table]] such as the one below:
 
<source lang="C">
 
const unsigned char seven_seg_digits_decode_abcdefg[16]=
 
{
 
/*  0    1    2    3    4    5    6    7    */
 
    0x7E, 0x30, 0x6D, 0x79, 0x33, 0x5B, 0x5F, 0x70,
 
/*  8    9    A    B    C    D    E    F    */
 
    0x7F, 0x7B, 0x77, 0x1F, 0x4E, 0x3D, 0x4F, 0x47
 
};
 
const unsigned char seven_seg_digits_decode_gfedcba[16]=
 
{
 
/*  0    1    2    3    4    5    6    7    */
 
    0x3F, 0x06, 0x5B, 0x4F, 0x66, 0x6D, 0x7D, 0x07,
 
/*  8    9    A    B    C    D    E    F    */
 
    0x7F, 0x6F, 0x77, 0x7C, 0x39, 0x5E, 0x79, 0x71
 
};
 
</source>
 
 
 
== Hardware Decoders/Drivers ==
 
{{empty section}}
 
  
 
[[Category:display devices]]
 
[[Category:display devices]]

Please note that all contributions to WikiChip may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see WikiChip:Copyrights for details). Do not submit copyrighted work without permission!

Cancel | Editing help (opens in new window)