How to connect 14-3 character  display to MCU - Page 1
Forum section: electronics / general

author: sangar
author_rank: Regular Contributor
timestamp: May 26, 2017, 11:18:45 am
content: Hi,Our project require 14-3 character display (BA56-12SRWA -Part number). Each 3 character display consumes 11 GPIO pins.For 14, it requires 154 pins . So,Q1:Should I go with MCU have 154 GPIO pins?Q2:(Or) There is something which will make design much more easier?Thanks,Muthu

author: AndreasF
author_rank: Frequent Contributor
timestamp: May 26, 2017, 11:51:44 am
content: No, you don't need an MCU with 154 pins.What you need to do is called "multiplexing" - effectively this means you need to light up each digit/character, one at a time, but simply do it fast enough so that it appears (to the human eye) as if the characters are lit up at the same time.With 14 of those it'll probably get tricky to do it fast enough, so you may need a slightly more complex arrangement.

author: newbrain
author_rank: Super Contributor
timestamp: May 26, 2017, 12:27:15 pm
content: Multiplexing is a given, as the specified display is already multiplexed (3 common anodes and 8 segments = 11).14x3 = 42 digits: serial multiplexing would impose rather serious limits on brightness, assuming the flicker would be bearable, as the maximum duty cycle qould only be 1/42 ~= 2.4%There are other options:Grouping: Have, e.g., 5 separate groups of 3 displays (9 digits each, last one would only have 6) multiplexed: the number of IOs needed would be 8x5 for the segments plus 9 for the common anodes (they can be shared) = 49. Still a lot of pins.The main problem then becomes the amount of current needed to drive all those LEDs with a decent brightness, I don't think any MCU can manage it, so drivers are a must in any case.At this point, one can think of directly using LED drivers ICs with serial inputs, such asMAX6954: note that this IC is common cathode and no common anode version exists, so another display should be used (or some other chip...)

author: ealex
author_rank: Frequent Contributor
timestamp: May 26, 2017, 04:16:40 pm
content: maybe you can use a small micro for each module ?just enough cpu power to do the multiplexing locally and implement some sort of spi or other communication protocol ?that will allow you to make some "complex" functions as well - dimming / some test modes to help you install the thing, maybe even power sequencing if neededMAX6954 costs more than a F4 series mcu ... you can get 5-6 small atmega / pics / 8051 based mcu's for the price of one.http://ro.mouser.com/Search/Refine.aspx?Keyword=MAX6954vshttp://ro.mouser.com/ProductDetail/Microchip-Technology/PIC16LF1575-I-P/?qs=sGAEpiMZZMu9ReDVvI6axz8JhCmDpjG%2fyAs%252baLjPBcxSCf65hEWPow%3d%3d

author: Ian.M
author_rank: Super Contributor
timestamp: May 26, 2017, 07:09:10 pm
content: Quote from: newbrain on May 26, 2017, 12:27:15 pmBuy the common cathode version of the display BC56-12SRWA.http://www.kingbrightusa.com/images/catalog/SPEC/BC56-12SRWA.pdf

author: senso
author_rank: Frequent Contributor
timestamp: May 26, 2017, 09:37:56 pm
content: Use a couple 595's per display, them pump data at 8Mhz or more, latch, done, you can even PWM the outputs using the OE pin.

author: cv007
author_rank: Frequent Contributor
timestamp: May 27, 2017, 02:37:05 am
content: There are many solutions to your problem, but I would consider treating each display as one 'problem'. Then take your 'solution' and multiply it by then number of displays needed (14). Your problem is now reduced to a single 3 digit display. When you can get one working, you just need to create 13 more of the same.Of course, you will have to also think about how to communicate with these 'individual' displays, or how to link them together.Here is something I created recently-https://goo.gl/photos/rTCwusquFnb8AfQE6I am using minimal parts- a PIC16F1578, a couple caps, a couple pnp to drive the 2 common cathodes (I'm driving the cathodes a little differently, but for a reason). The circuit board fits exactly to a 2 digit 14 segment display, and I can connect as many displays as needed, in any arrangement I want. Each digit has its own 'address' which I send serial data to via a simple protocol (which allows for 126 digits to be addressed). The board has 3 connections- power, ground, serial in. Each board uses the same connections, and they all see the same serial data. I'm driving the anodes (led segments) directly from the microcontroller pins and the brightness I'm getting is not a problem (the bigger problem is how to control the brightness to a very low level, which is easy in this case as the PIC has a 16bit pwm of which I'm using 12 bits, to drive the common cathodes). The PIC16F1578 is a 20 pin micro, and I need 2 common cathodes, 14 segments (+ decimal point), and serial in- that's 18 pins I'm using and with the pps feature it is possible (the reset pin becomes the serial in). I'm pushing the current capabilities of the PIC a little bit, but have been running a number of them on a breadboard at max brightness and at 5volts for quite a while without a problem.If I was doing the same thing for your display, I would just switch to a PIC16F1574 (14 pin version- 3 common drivers, 7 segments + decimal point, serial in = 12 pins). It's $1.07 in single quantities. I'm using less than half the flash space, and a quarter of the ram, so no need for larger flash.There are other ways to drive the displays (shift registers), but in any case you will be multiplexing the displays (no way around that unless you use individual single digit displays).

author: ebclr
author_rank: Super Contributor
timestamp: May 28, 2017, 05:53:07 am
content: If you want a simple cheap and flexible solution, take a look on TM1638 from Titan Micro,

author: sangar
author_rank: Regular Contributor
timestamp: May 29, 2017, 07:24:24 am
content: Hi All,We decided to go with MAX6954. I read that One MAX6954 support up to 16 digits. My requirement is 42 digits. So, My application needs 3 MAX6954.Can anyone share reference design and sample code for MAX6954?Thanks,Muthu

author: mariush
author_rank: Super Contributor
timestamp: May 29, 2017, 09:16:49 am
content: Why wold you pay 15-20$ for a single MAX6954 when you could just use a microcontroller and some led driver?Maxim parts are expensive and hard to buy and often not on stock, forget about them.You can buy proper led drivers at cheap prices , for example here's a nice 24 channel led driver :PCA9956BTWYOnce you have it, it's up to you if you use a single one or if you use multiple ones to make your overall display show multiple digits at a time instead of multiplexing them and risk having more flickerHere's an example for 9 digits using a single such led driver .. you'd basically require 3 pins to enable digits (you'd enable 3 digits at a time , 1 out of 3 digits from each 3 digit display) and two pins (i2c communication to led driver to tell it which channels should be on or off.You can go wide and simply add led drivers by giving each led driver a unique i2c address (this particular led driver chip can handle up to 125 devices on the same i2c bus) but for 42 digits, you'd probably use 5 such chips ( 5 x 3 x 3 = 45 digits and just leave the digits 43, 44, 45 unused).You will still need only 3 pins to enable digits and only 2 pins for i2cex .. for 18 digits :send 48 x 1 byte (one for each channel) to connect the 48 cathodes you want to ground.send voltage on digits 1, 4 , 7 , 10, 13 and 16 (a single i/o pin connected to the base of a transistor or mosfet) and then the output of that transistor or mosfet sends power into those digitswait some timedisable the led drivers to turn off all channelssend 48 x 1 byte (one for each channel)send voltage on digits 2 , 5, 8, 11, 14 , 17wait some timedisable led drivers to turn off all channelssend 48 x 1 byte (one for each channel)send voltage on digits 3 , 6, 9, 12, 15 , 18wait some timedisable led drivers to turn off all channelsso unless i'm too tired to think straight, you'd need a simple microcontroller with 3 output pins and 2 data pins (i2c)Your microcontroller simply has to convert numbers to segments in order to figure out which channels to be turned on or off and enable the digits you want ... fairly simple to do even with a 1-2$ microcontroller.

author: sangar
author_rank: Regular Contributor
timestamp: May 29, 2017, 10:23:02 am
content: Hi mariush,Ok. Each display(3 character display) have 3 control pins. For, 16 display, it will become 48. If I am right, these control pins has to be controlled from Micro-controller not from LED drivers like PCA9956.How should I multiplex so that only 3 pins from microcontroller controls 16 display?Thanks,Muthu

author: mariush
author_rank: Super Contributor
timestamp: May 29, 2017, 10:36:08 am
content: No, you won't have 48 pins... unless you really want to.Each led driver has 24 channels, so it can turn on or off 24 segments. At any point in time, you only turn on one digit out of each 3 digit display so you connect the 24 channel led driver to 3 separate 3 digit displays.Therefore, you can use 3 i/o pins to send power to digits, to 3 digits at any point (first digit from each 3-digit display). One pin will enable digits 1-1 , 2-1, 3-1 , 2nd pin will enable digits 1:2,2:2,3:2 , 3rd pin will enable digits 1:3,2:3,3:3At any point, only one of those 3 i/o pins is 1 and the others are 0, so you actually have to use a loop in the source code of the microcontroller to show a third of the digits for a period of time, then the next 1/3 of digits (each center digit from the 3 x 3digit displays) then the last third set of digits and if you do it fast enough your eyes will see all digits turned on.If you use multiple 24 channel drivers, 3 i/o pins should be enough because you just scale it .. and you have the 2 or 3 pins required for i2c and optional enable/disable chip pinYou can use more than 3 io pins to send power to digits and then you may be able to lower the number of individual led driver chips, but everything becomes more complex and you may have more flicker on the display because you turn on and off digits more often and you have to push more bytes or bits through the i2c busFor example you can connect the 2 cathodes from each set of 3 x 3 digit displays on a led driver chip channel and then use 6 i/o pins to enable digits differently, for example in the picture below you send power to digits 1,4,7 using one io pin , then another io pin for digits 10,13,16 , then another io pin for digits 2,5,8, then another pin for digits 11,14,17 and so on ... 6 pins to enable 2 x 3 digits at any particular time.You save a led driver but you turn on and off digits twice as often, and that can introduce flicker .. and can also make the circuit board harder (because you have all those connections between cathodes before the wires go to the led driver

author: sangar
author_rank: Regular Contributor
timestamp: May 29, 2017, 11:03:27 am
content: Hi,Now, I understood. Digit pins in 3- character display are Dig-1,Dig-2 and Dig-3.My application needs 16 displays. So 16display's Dig-1 has to be connected to GPIO-1 Micro-controller.Then, all 16 display's Dig-2 pins has to be connected to GPIO-2 of Micro-controller and Dig-3 pins of all 16 displays for GPIO-3 of Microcontroller.Am I right?Thanks,Muthu

author: mariush
author_rank: Super Contributor
timestamp: May 29, 2017, 11:24:20 am
content: Yes, pretty much.But you don't connect directly to microcontroller pin , because a microcontroller i/o pin can typically only output around 25-50mA (and depending on microcontroller, some can only output up to 100-150mA on ALL output pins).As an example, you would probably configure the segments to use around 5mA or some value below 10mA at max brightness .. so if a digit displays "8" (all segments but the dot are lit), then your digit would use 7x5mA = 35mA .. if you multiply that by 16 you have 560mA to show 8 on 16 digits at one time.Personally, if i configure the segment current to 5mA, i'd allow for 5mA x 8 segments x 16 digits = 640mA + about 10% for safety, so around 800mA.I'd use a transistor with a minimum hFe (amplification/gain/whatever) of let's say 200 and then I'd know that if the transistor receives 5mA on the base pin from the micro, there will be at least 1000mA of current allowed to flow between collector and emitter of the transistor which is above our minimum desired value of 800mA (we use the transistor as a switch)so i/o pin -> [ small value resistor, example 10ohm ] - > base pin of transistor5v ---- [[ collector pin of transistor ---- base pin to resistor and then micro ----- emitter (about 4.3..4.6v) ]] ---- digit anoderesistor on base pin of transistor is important, without it you can damage the transistor by pushing too much current in it.mosfets are voltage devices, they'll turn on when voltage on the gate pin goes above a threshold and turns off when the voltage goes below a threshold. You typically need a resistor between the gate and ground to quickly discharge the gate capacitance and turn off the mosfet , without one the mosfet could need a long time (milliseconds) to turn off, like a fade out... so you'd have "ghosting" on the display digits

author: Nusa
author_rank: Super Contributor
timestamp: May 29, 2017, 11:25:50 am
content: Right, but via a transistor that can handle the current involved. You're way over what the data pin can handle directly.

author: sangar
author_rank: Regular Contributor
timestamp: May 29, 2017, 12:00:08 pm
content: Hi,I got it. I have one more question.Though multiple digits powered up when GPIO-1 is high, I can use the specific digit which I want to display?.for example, first digits of 16 displays will be enabled when GPIO-1 high. But, I want to display only 8 digits out of it. At that time, all other 8 digits should be turned off and it should not show anything which is unwanted.I think that this is purely programming related. Writing the specific LED register so that LED segments output available for that particular digit which I want to display.Am I right?

author: mariush
author_rank: Super Contributor
timestamp: May 29, 2017, 12:07:16 pm
content: Sure, yes.You control each segment of each digit , so in order for one digit to be fully off you simply set all the segments to off (0) for that digit. Then even if you enable a digit by sending power to it, no cathodes are connected to ground by the led driver IC so the segments won't light up.

author: Jeroen3
author_rank: Super Contributor
timestamp: May 29, 2017, 12:26:54 pm
content: If you are going to use a mosfet, which you probably are, you will need anP-channelmosfet since you will need to switch thehigh-sideof the segments. (5V to Common Anode)An P-channel mosfet turnsoffwhen Gate ishigher or equalto Source.An P-channel mosfet turnsonwhen Gate ismore thanVgs below Source.image source

author: cv007
author_rank: Frequent Contributor
timestamp: May 29, 2017, 03:16:12 pm
content: QuoteQuoteThis is why I suggested treating each display separately, as the number of displays needed will most likely be a moving target.Also consider this--when treating each display separately, you have only one small pcb design to make, duplicated n times (n appears to be changing)-with a single micro for each display, it will contain its own multiplexing and require minimal outside connections (since it does its own multiplexing it will continue to display the info without any further outside assistance)-a pic micro can be had in dip/so/ssop packages, so you can breadboard one display to design/test-a micro can be found anytime, in many configurations, with no worries about a 'specialty' chip that may be hard to find in the future (possibly near future)-the same program would be used for each display, so only one program needs to be developed (same as using a specialty chip, as you will need to develop one program for control)-connections between each board will be minimal- power, ground, signal (or could use other comm methods which require more pins- spi/i2c/etc)-each digit can be controlled separately (with its own brightness setting)here is a parts list for a micro solution, for each display-1ea pic16f1574, 14pin micro (dip,so, or ssop)1ea 3digit display3ea pnp transistor (or npn, depends on display)1ea 100n cap (micro bypass)1ea 10uF cap (micro supply)Here is what I would do (if you wanted to use a micro for each display)-get a micro in dip package, get a display, some transistors and caps, wire it up on a breadboard and just start to get a display working with multiplexing. Once that is done (which is quite easy), the rest just becomes a matter of fine tuning, handling how you want the communications protocol to work, etc.Maybe my ideas are odd, but I just like as simple as possible (minimal parts, minimal connections, minimal everything).

author: sangar
author_rank: Regular Contributor
timestamp: May 30, 2017, 12:42:17 pm
content: Hi,I wanted to go with PCA9956 but My colleague ordered three quantities on MAX6954. Eventually,for Pilot production, I will go with parts like PCA9956 in order to minimize cost.Ok. Coming to MAX6954, in the datasheet, it says that how to interface 8 two digit display (totally 16 digit). I am wondering to connect 5- 3 digit display to MAX6954. Have anyone had experience on this?Q1: How to interface 5-three digit display to MAX6954?three digit display-BC56-12SRWA.Thanks,Muthu

author: newbrain
author_rank: Super Contributor
timestamp: May 30, 2017, 04:11:09 pm
content: Quote from: sangar on May 30, 2017, 12:42:17 pmPlease, understand that my suggestion for MAX6954 was just an example to show that specialized drivers exist, I've never personally used that IC!At most 4 3 digits displays can be connected per IC, as the common cathode drivers are only 8 and each has to serve 2 digits with a different set of segment drivers.Page 8, table 4 shows the connections: one display will have its 3 cathodes connected to CC0-2 and the segments to 1a-1f, the second will still use CC0-2 but with segments 2a-2f. Same for another couple of displays, using CC3-5.If you want to use the remaining positions (CC6 and 7), single or double displays are needed.