Path: EDN Asia >> Design Ideas >> Test & Measurement >> Counter works with common anode or common cathode
Test & Measurement Share print

Counter works with common anode or common cathode

03 Jun 2015  | Charaf Laissoub

Share this page with your friends

A classical design for directly driving eight seven-segment LED displays requires as many as 15 I/O lines. Previous articles have described many approaches for using a maximum number of LEDs with a minimum number of I/O lines (references 1 through 5). The following idea reuses one of these approaches to drive a maximum number of seven-segment LED displays, and it may be useful in designing a lowcomponent- count, low-power, and lowcost LED-display module for a 24bit frequency meter, for example.

Figure: This circuit can be used to replace classical designs for digital counters that use transistor-transistor logic or CMOS ICs.

You can use the circuit in the figure to replace classical designs for digital counters that use transistor-transistor logic (TTL) or CMOS ICs. The single microcontroller is less expensive and readily available. By using conditional assembly in your programming, you can choose between common-anode and commoncathode configurations.

The algorithm uses double multiplexing, driving one digit at a time, segment by segment. This technique suits battery-powered designs because the circuit consumes a constant current of less than 2 mA when using superbright, seven-segment LED displays, such as KingBright's SC52-11EWA, and 270Ω resistors R0 to R7. Assembling the eight digits, DS7, DS6, DS5, DS4, DS3, DS2, DS1, and DS0, on a PCB (printed-circuit board) involves linking their corresponding pins A7, B6, C5, D4, E3, F2, G1, and CA0 to the I/O line, RB0. Figure 1 shows the connections.

This circuit uses the Microchip PIC16F628A for test purposes. You can use this assembly code with any PICmicro midrange family, providing that a full 8bit port is available.

1. Anonymous, "Microcontroller provides low-cost analogue-to-digital conversion, drives seven-segment displays," EDN, May 10, 2007, pg 80.

2. Raynus, Abel, "Squeeze extra outputs from a pin-limited microcontroller," EDN, Aug 4, 2005, pg 96.

3. Jayapal, R, "Microcontroller's single I/O-port line drives a bar-graph display," EDN, July 6, 2006, pg 90.

4. Lekic, Nedjeljko, and Zoran Mijanovic, "Three microcontroller ports drive 12 LEDs," EDN, Dec 15, 2006, pg 67.

5. Gadre, Dhananjay V, and Anurag Chugh, "Microcontroller drives logarithmic/ linear dot/bar 20-LED display," EDN, Jan 18, 2007, pg 83.

About the author
Charaf Laissoub is with Valeo Interior Controls in Créteil France.

This article is a Design Idea selected for re-publication by the editors. It was first published on July 15, 2010 in

Want to more of this to be delivered to you for FREE?

Subscribe to EDN Asia alerts and receive the latest design ideas and product news in your inbox.

Got to make sure you're not a robot. Please enter the code displayed on the right.

Time to activate your subscription - it's easy!

We have sent an activate request to your registerd e-email. Simply click on the link to activate your subscription.

We're doing this to protect your privacy and ensure you successfully receive your e-mail alerts.

Add New Comment
Visitor (To avoid code verification, simply login or register with us. It is fast and free!)
*Verify code:
Tech Impact

Regional Roundup
Control this smart glass with the blink of an eye
K-Glass 2 detects users' eye movements to point the cursor to recognise computer icons or objects in the Internet, and uses winks for commands. The researchers call this interface the "i-Mouse."

GlobalFoundries extends grants to Singapore students
ARM, Tencent Games team up to improve mobile gaming

News | Products | Design Features | Regional Roundup | Tech Impact