Skip to main content

AN-CM-282 4xN LED Driver

Contents

Terms and Definitions

LED Light Emitting Diode
ASM Asynchronous State Machine
DFF D Flip Flop
I2C Inter-Integrated Circuit Serial Communication

References

For related documents and software, please visit:

https://www.dialog-semiconductor.com/configurable-mixed-signal

Download our free GreenPAK™ Designer software [1] to open the .gp files [2] and view the proposed circuit design. Use the GreenPAK development tools [3] to freeze the design into your own customized IC in a matter of minutes. Dialog Semiconductor provides a complete library of application notes [4] featuring design examples as well as explanations of features and blocks within the Dialog IC.

  1. GreenPAK Designer Software, Software Download and User Guide, Dialog Semiconductor
  2. AN-CM-282 4xN LED Driver.gp, GreenPAK Design File, Dialog Semiconductor
  3. GreenPAK Development Tools, GreenPAK Development Tools Webpage, Dialog Semiconductor
  4. GreenPAK Application Notes, GreenPAK Application Notes Webpage, Dialog Semiconductor
  5. SLG46537, Datasheet, Dialog Semiconductor.
  6. AN-1092, I2C Controlled State Machine, Application Note, Dialog Semiconductor.

Author: Krupa Bhavsar

Introduction

LED displays are widely used in systems ranging from digital clocks, counters, timers, electronic meters, basic calculators, and other electronic devices capable of displaying numerical information. Figure 1 depicts an example of a 7-segment LED display which can show decimal numbers and characters. As each segment on the LED display can be controlled individually, this control can require a lot of signals, especially for multiple digits. This application note describes a GreenPAK - based implementation to drive multiple digits with a 2-wire I2C interface from an MCU.

Figure 1: 7-segment LED Display

Background

The LED displays are divided into two categories: Common Anode and Common Cathode. In a common anode configuration, the anode terminals are internally shorted together as shown in Figure 2. To turn ON the LED, the common anode terminal is connected to the system supply voltage VDD and the cathode terminals are connected to ground through current limiting resistors.

Figure 2: Common Anode Configuration

A common cathode configuration is similar to a common anode configuration except the cathode terminals are shorted together as shown in Figure 3. To turn ON the common cathode LED display, the common cathode terminals are connected to ground and the anode terminals are connected to the system supply voltage VDD through current limiting resistors.

Figure 3: Common Cathode Configuration

An N-digit multiplexed LED display can be obtained by concatenating N individual 7-segment LED displays. Figure 4 portrays an instance of a 4x7 LED display obtained by combining 4 individual 7- segment displays in a common anode configuration.

Figure 4: 4 x 7-segment LED Display

As seen in Figure 4, each digit has a common anode pin / backplane that can be used to individually enable each digit. The cathode pins for each segment (A, B, …G, DP) should be shorted together externally. To configure this 4x7 LED display, the user requires only 12 pins (4-common pins for each digit and 8-segment pins) to control all the 32 segments of the multiplexed 4x7 display.

The GreenPAK design, detailed below, shows how to generate the control signals for this LED display. This design can be extended to control up to 4 digits and 16 segments. Please see the References section for a link to the GreenPAK design files available on Dialog's website.

GreenPAK Design

Figure 5: GreenPAK Design

The GreenPAK design displayed in Figure 5 includes both the segment and digit signal generation in one design. The segment signals are generated from the ASM and the digit selection signals are created from the DFF chain. The segment signals are connected to the segment pins through current limiting resistors, but the digit selection signals are connected to the common pins of the display.

Digit Signal Generation

As described in section 4, each digit on a multiplexed display has an individual backplane. In GreenPAK, the signals for each digit are generated from the internal oscillator-driven DFF chain.

These signals drive the common pins of the display. Figure 6 displays the digit selection signals.

Channel 1 (Yellow) – Pin 6 (Digit 1)

Channel 2 (Green) – Pin 3 (Digit 2)

Channel 3 (Blue) – Pin 4 (Digit 3)

Channel 4 (Magenta) – Pin 5 (Digit 4)

Figure 6: Digit Selection Signals

Segment Signal Generation

The GreenPAK ASM generates different patterns to drive the segment signals. A 7.5ms counter cycles through the ASM states. As the ASM is level sensitive, this design utilizes a control system that avoids the possibility of rapidly switching through multiple states during the high period of the 7.5ms clock. This specific implementation relies on consecutive ASM states controlled by inverted clock polarities. Both the segment and digit signals are generated by the same 25kHz internal oscillator.

ASM Configuration

Figure 7 describes the state diagram of the ASM. State 0 automatically switches to State 1. A similar switch occurs from State 2 to State 3, State 4 to State 5, and State 6 to State 7. Data from State 0, State 2, State 4, and State 6 are instantly latched using DFF 1, DFF 2, and DFF 7 as shown in Figure 5, before the ASM transitions to the next state. These DFFs latch the data from the even states of the ASM, which enables the user to control an extended 4x11/4xN (N up to 16 segments) display using GreenPAK's ASM.

Each digit on a 4xN display is controlled by two states of the ASM. State 0/1, State 2/3, State 4/5, and State 6/7 respectively control Digit 1, Digit 2, Digit 3, and Digit 4. Table 1 describes the ASM states along with their respective RAM addresses to control each digit.

Each state of the ASM RAM stores one byte of data. So, to configure a 4x7 display, three segments of Digit 1 are controlled by State 0 of the ASM and five segments of Digit 1 are controlled by State 1 of the ASM. As a result, all segments of each digit on the LED display are obtained by concatenating

Figure 7: ASM State Diagram

the segments from their corresponding two states. Table 2 describes the location of each of Digit 1's segments in the ASM RAM. In a similar way, ASM's State 2 through State 7 respectively include the segment locations of Digit 2 to Digit 4.

Table 1: ASM RAM correspondence with 4x7 LED Display
ASM State#
ASM RAM Address
LED Digit Location
State 0
0xD0
Digit 1
State 1
0xD1
Digit 1
State 2
0xD2
Digit 2
State 3
0xD3
Digit 2
State 4
0xD4
Digit 3
State 5
0xD5
Digit 3
State 6
0xD6
Digit 4
State 7
0xD7
Digit 4

As seen from Table 2, OUT 3 to OUT 7 segments of State 0 and OUT 0 to OUT 2 segments of State 1 are unused. The GreenPAK design in Figure 5 can control a 4x11 display by configuring the OUT 0 to OUT 2 segments of all odd states of the ASM. This design can be further expanded to control an extended 4xN (N up to 16 segments) display by using more DFF logic cells and GPIOs.

Table 2: Digit 1 segment connection with ASM RAM
ASM RAM
OUT 7
OUT 6
OUT 5
OUT 4
OUT 3
OUT 2
OUT 1
OUT 0
State 0
x
x
x
x
x
SEG C
SEG B
SEG A
State 1
SEG DP
SEG G
SEG F
SEG E
SEG D
x
x
x

Testing

Figure 8 shows the test schematic used to display decimal numbers on the 4x7-segment LED display. An Arduino Uno is used for I2C communicating with the GreenPAK's ASM RAM registers. For more information on I2C communication, please refer to [6]. The common anode pins of the display are connected to the digit selection GPIOs. The segment pins are connected to the ASM through current limiting resistors. The current-limiting resistor sizing is inversely proportional to the brightness of the LED display. The user can select strength of the current limiting resistors depending on the maximum average current of GreenPAK GPIOs and maximum DC current of the LED display.

Figure 8: Circuit Schematic

Table 3 describes decimal numbers 0 through 9 in both binary and hexadecimal format to be displayed on the 4x7 display. 0 indicates that a segment is ON and 1 indicates that the segment is OFF. As shown in Table 3, two bytes are required to display a number on the display. By correlating Table 1, Table 2, and Table 3, the user can modify the ASM's RAM registers to display different numbers on the screen.

Table 3: ASM RAM Configuration
Decimal Number
LED Segments
Data Byte (Hex)
DP
G
F
E
D
C
B
A
0
1
1
1
1
1
0
0
0
0xF8
1
1
0
0
0
1
1
1
0xC7
1
1
1
1
1
1
0
0
1
0xF9
1
1
1
1
1
1
1
1
0xFF
2
1
1
1
1
1
1
0
0
0xFC
1
0
1
0
0
1
1
1
0xA7
3
1
1
1
1
1
0
0
0
0xF8
1
0
1
1
0
1
1
1
0xB7
4
1
1
1
1
1
0
0
1
0xF9
1
0
0
1
1
1
1
1
0x9F
5
1
1
1
1
1
0
1
0
0xFA
1
0
0
1
0
1
1
1
0x97
6
1
1
1
1
1
0
1
0
0xFA
1
0
0
0
0
1
1
1
0x87
7
1
1
1
1
1
0
0
0
0xF8
1
1
1
1
1
1
1
1
0xFF
8
1
1
1
1
1
0
0
0
0xF8
1
0
0
0
0
1
1
1
0x87
9
1
1
1
1
1
0
0
0
0xF8
1
0
0
1
0
1
1
1
0x97

Table 4 describes the I2C command structure for Digit 1 on the 4x7 LED display. The I2C commands require a start bit, control byte, word address, data byte, and stop bit. Similar I2C commands can be written for Digit 2, Digit 3, and Digit 4.

Table 4: I2C Structure
Information
Data (Hex)
Start Bit
START
Control Byte/Slave Address
0x50
Word Address/ RAM 8 outputs for ASM-state 0
0xD0
Data for ASM-State 0
Digit 1
Data for ASM-State 1
Digit 1
Stop Bit
STOP

For example, to write 1234 on the 4x7 LED display, following I2C commands are written.

[0x50 0xD0 0xF9 0xFF]

[0x50 0xD2 0xFC 0xA7]

[0x50 0xD4 0xF8 0xB7]

[0x50 0xD6 0xF9 0x9F]

By repeatedly writing all eight bytes of the ASM, the user can modify the displayed pattern. As an example, a counter code is included in the ZIP file of this application note on Dialog's website.

Conclusions

The GreenPAK solution described in this application note enables the user to minimize cost, component count, board space, and power consumption.

Most of the times MCUs have limited number of GPIOs, so offloading the LED driving GPIOs to a small and inexpensive GreenPAK IC enables the user to save IOs for additional functionalities.

Moreover, GreenPAK ICs are easy to test. The ASM RAM can be modified with a click of a few buttons in the GreenPAK Designer Software, which indicates flexible design modifications. By configuring the ASM as described in this application note, the user can control four N-segment LED displays with up to 16 segments each.