Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
November 24, 2020, 06:57:29 06:57


Login with username, password and session length


Pages: [1]
Print
Author Topic: Reducing port count needed to drive 7-segment display  (Read 3765 times)
0 Members and 1 Guest are viewing this topic.
ajith
Inactive

Offline Offline

Posts: 3

Thank You
-Given: 9
-Receive: 2


« on: July 12, 2020, 08:00:36 08:00 »

I was looking for options to reduce uC port usage to drive 7-segment displays. While the typical standard for reducing port count needed to drive LEDs is charlieplexing, it requires being able to drive both ends of each LED to one of 3 states. I had difficulty in trying to reconcile that with the common-anode or common-cathode design of available 7-segment displays.

Found this nice instructable which made me realize that i was perhaps overthinking the problem. While it is not strictly charlieplexing, it allows one to work with the common anode or cathode configuration. Ref: https://www.instructables.com/id/Charlieplexing-7-segment-displays/

The code is attached in the instructable but i expect it would be trivial for most people on here once the schematic makes sense.

In the event that instructable gets take down due to lack of traffic, here is the web archive link : https://web.archive.org/web/20190417170756/https://www.instructables.com/id/Charlieplexing-7-segment-displays/





Needless to say, I claim no credit to any of this. Just sharing this in the hope this is useful to others trying to solve a similar problem.

P.S. : This is my first post. Any errors are unintentional. Feedback appreciated.
Logged
madhan7710
Junior Member
**
Offline Offline

Posts: 64

Thank You
-Given: 38
-Receive: 136


« Reply #1 on: July 12, 2020, 08:55:20 08:55 »

 You can use a simple ultra low cost display driver ic to drive 7segment displays. Just 3 or 2 wires enough. Check for TM1616 or TM1650 to drive up to 4 digits. It takes care of all the scanning and you no need to refresh the display untill you update its value. No current limiting resistors, no transistors, 8 level brigtness control.. excellent chip. I have personally used it and very much satisfied.
Logged
ajith
Inactive

Offline Offline

Posts: 3

Thank You
-Given: 9
-Receive: 2


« Reply #2 on: July 12, 2020, 09:01:47 09:01 »

Agreed. The price one pays for the lower part count is design and code time and reduced brightness. Sometimes this approach is more compelling, at other times, using a driver makes more sense.
Logged
kripton2035
Newbie
*
Offline Offline

Posts: 31

Thank You
-Given: 9
-Receive: 89


« Reply #3 on: July 12, 2020, 10:48:18 10:48 »

+1 for cheap led driver. TM1638 if for driving up to 8 digits and a keyboard simultaneously.
I would use direct transistor drive only for less than 4 digits.
Logged
jzaghal
Active Member
***
Offline Offline

Posts: 163

Thank You
-Given: 471
-Receive: 51



« Reply #4 on: July 12, 2020, 11:23:33 11:23 »

Why not use the 74HC595 serial to parallel shift register??
Logged
sadman
Hero Member
*****
Offline Offline

Posts: 527

Thank You
-Given: 1383
-Receive: 1784



« Reply #5 on: July 12, 2020, 01:54:10 13:54 »

Why not use the 74HC595 serial to parallel shift register??

charliplexing when you want to keep your design tidy or you never want to add any chip
Logged
ratovarius
Junior Member
**
Offline Offline

Posts: 94

Thank You
-Given: 1044
-Receive: 177


« Reply #6 on: July 13, 2020, 01:31:24 13:31 »

Another good display driver is HT16K33 from Holtek - https://www.holtek.com/productdetail/-/vg/16K33
Logged
pushycat
Senior Member
****
Offline Offline

Posts: 444

Thank You
-Given: 187
-Receive: 1417



« Reply #7 on: July 13, 2020, 05:47:40 17:47 »

Why not use the 74HC595 serial to parallel shift register??
Yes i would suggest the same. Just using shift register behind every display and any number of displays can be driven with just 5 pins including power. For reference, have a look at this shared project

https://www.pcbway.com/project/shareproject/W14332ASZ1_Project_Outputs_for_7segment_Shift.html
Logged
comlekciler
Newbie
*
Offline Offline

Posts: 34

Thank You
-Given: 41
-Receive: 34

Ph.D.


« Reply #8 on: July 14, 2020, 08:40:53 08:40 »

I think I understand, the key point is to make "high impedance" leds that will not give light.
Can we formulate this method as follows? N*(N-1) leds can be controlled with N number of pins. Roll Eyes
Logged

...none...
odessa
Newbie
*
Offline Offline

Posts: 21

Thank You
-Given: 92
-Receive: 15


« Reply #9 on: July 16, 2020, 06:58:05 18:58 »

Doesn't get much cheaper or easier than the 74HC595, I've just made a 6 x 7 segment display using them. Dead easy to drive too.
Logged
madhan7710
Junior Member
**
Offline Offline

Posts: 64

Thank You
-Given: 38
-Receive: 136


« Reply #10 on: July 17, 2020, 02:49:36 14:49 »

In my opinion using a dedicated TM1616 like chip is much better than using shift register because the load on the microcontroller is zero. There is no need for scanning every n mS which you can use for other major tasks. A single chip can drive 4 (even 8 based on the chip ) displays whereelse you need 4 shift register ic's to drive 4 displays.
Logged
Ahmad_k
SCG Moderator
Hero Member
*****
Offline Offline

Posts: 726

Thank You
-Given: 165
-Receive: 1212



« Reply #11 on: July 17, 2020, 04:41:56 16:41 »

For me the MAX7219 is the best solution. With one chip you can drive 8 7segments display through SPI connection. very good brightness and very cheap , arround 0.15$ in bulk
Logged
GeneralMadDog
V.I.P
Junior Member
*****
Offline Offline

Posts: 74

Thank You
-Given: 35
-Receive: 89


« Reply #12 on: July 18, 2020, 08:10:24 08:10 »

I also use MAX7219 / 7221. Good availability and cheap, ready to use displays available. But where can you get the parts so cheap?  Shocked
Logged
Wizpic
Global Moderator
Hero Member
*****
Offline Offline

Posts: 1130

Thank You
-Given: 394
-Receive: 396



« Reply #13 on: July 18, 2020, 09:02:46 09:02 »

I've also used the Max7219 and the TM1367 to build a new volt and amp meter for my power supply, The only trouble with the MAX7219 I could only get the .31" displays modules off E-bay which is cheaper than buying the chip it's self. I could get the TM1367 modules with .56" display. I used the MAX7219 to build my DRO for my digital calipers as  it was a new design. I did try the MAX7219 modules in my PSU but it did not look right.
Logged

When you think, "I can't do anymore. I need a break," that is the time to challenge yourself to keep going another five minutes. Those who persevere for even an extra five minutes will win in life..
Ahmad_k
SCG Moderator
Hero Member
*****
Offline Offline

Posts: 726

Thank You
-Given: 165
-Receive: 1212



« Reply #14 on: July 18, 2020, 06:38:58 18:38 »

I also use MAX7219 / 7221. Good availability and cheap, ready to use displays available. But where can you get the parts so cheap?  Shocked
We have multiple dealers in my country that import electronics from china.
Logged
bobcat1
Active Member
***
Offline Offline

Posts: 233

Thank You
-Given: 2981
-Receive: 58


« Reply #15 on: July 19, 2020, 07:41:49 07:41 »

The question that should be asked is : "what is more expensive to use 9 uc pins or 5(or less) uc(micro controller) pin's"
The answer is depend on what is the requested final result " whether you plan to manufacture 10000 pcs of a new device or system - cost is very important or you just going to produce few hobby PCB?

All the best

Bobi
Logged
pickit2
Moderator
Hero Member
*****
Offline Offline

Posts: 4400

Thank You
-Given: 758
-Receive: 3254


There is no evidence that I muted SoNsIvRi


« Reply #16 on: July 19, 2020, 09:33:32 09:33 »

at my place of work we moved away from 7 seg displays that used 7 pins plus 1 pin for each digit displayed.
we started using LCD displays 7 pins then we started using LCD and PCF8574 2pins.
the way the product developed at each stage there was better information displayed and the cost went down.
All of the above was in black and the option of a back light, and tried a few colour back lights.
Today they use TFT displays with so much for information to the user.
I think that's one of the reasons there is so many cheap 7 seg displays & driver chips on the Chinese market.
I even think in my old workplace stores there are still lots in there, mostly kept for repairing units out on sites.

so even a a hobby project I would use a TFT display, using 4 or 5 data & control pins.
and if pins are that tight use a Nextion display borrowed from the works storeroom.
 
Logged

Note: So you have Not made a Post in the Forum. Without Posts we have No Forum, That's ok Can I Mute you now sir
jzaghal
Active Member
***
Offline Offline

Posts: 163

Thank You
-Given: 471
-Receive: 51



« Reply #17 on: July 24, 2020, 05:08:34 17:08 »

Hi,
You mean TM1637 ??
Logged
Wizpic
Global Moderator
Hero Member
*****
Offline Offline

Posts: 1130

Thank You
-Given: 394
-Receive: 396



« Reply #18 on: July 24, 2020, 07:54:19 19:54 »

Hi,
You mean TM1637 ??
Yeah sorry, fingers to fast for my brain
Logged

When you think, "I can't do anymore. I need a break," that is the time to challenge yourself to keep going another five minutes. Those who persevere for even an extra five minutes will win in life..
anotherandrew
Junior Member
**
Offline Offline

Posts: 59

Thank You
-Given: 478
-Receive: 18


« Reply #19 on: July 25, 2020, 09:49:31 21:49 »

Your schematic will not work well with NPN transistors for common anode displays. base must be able to 0.7V above emitter and with led on emitter you add 1-3V to amount of voltage base must be to turn on transistor. Just use PNP and select with LOW not high and it will work better, but you may need second (NPN) transistor to turn on PNP if display voltage is above MCU pin voltage.
Logged
max
Senior Member
****
Offline Offline

Posts: 251

Thank You
-Given: 1224
-Receive: 37


« Reply #20 on: July 27, 2020, 08:26:02 08:26 »

Hi,

See the attached files for single n dual pin interface of hc595.

Regards
Logged

Fate arrived and made the conscious unconscious It silenced the activity of life.
PeteBee
Inactive

Offline Offline

Posts: 5

Thank You
-Given: 1
-Receive: 1


« Reply #21 on: August 22, 2020, 07:06:12 07:06 »

I'm using the MAX6951 for charliplexing in a design that can drive either 8x7 segment displays or up to 64 discrete LEDs.  The MAX6951 is driven from the microcontroller using SPI, so only 3 I/O pins used, plus chip select if you have more than one device on SPI (One version of my design has 2xMAX6951 for up to 128 LEDs or 16x7 seg displays). Another advantage of using Charliplexing with discrete LEDs is that you can use 2 pin bi-colour LEDs, as the drive in each direction produces one of the two colours.
Logged
sadman
Hero Member
*****
Offline Offline

Posts: 527

Thank You
-Given: 1383
-Receive: 1784



« Reply #22 on: September 13, 2020, 03:25:30 15:25 »


Complete guidance how use and configure max72xx 

https://playground.arduino.cc/Main/MAX72XXHardware/
Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC