Scoreboard rebuild from discrete components to PIC

MCU88

Joined Mar 12, 2015
358
MCUU8, please don't go anywhere, a rolling message is my next project. The soccer club have asked if I can add that as a separate item and I know it's possible. I even have my local voluntary fire brigade that I'm part of asking if I can make one for them to put on the fire station tilt up door. We don't have the money to buy one.
Have had thoughts about doing another one based around an 16F877a PIC, and the messages programmed in via and hand-controller with LCD, buttons and an rotary control (turn to select chrs) -- rather than connecting to an computer for upload of the messages through the serial port. This would make the system standalone. If I did make it connect to an computer, then I would have to make the Windows software in C# .net I really do not wanna do this, since it would not be an USB device, and these USB to serial converters on modern operating systems I hear have big dramas. The drivers are outdated and refuse to work on 64-bit machines.

Big job.
 

MMcLaren

Joined Feb 14, 2010
861
MMcLaren said:
In your new non-multiplexed design, you could connect all of the TPIC6B595 output enable pins together and drive them with one of the Arduino PWM outputs for brightness control.
Sounds promising, but sorry for my ignorance, are these the "drain" pins in my case (pins 4 to 7 and 14 to 17)? If so, do you mean all the pin 4s together, then the pin 5s, etc, then somehow multiplex? I think I need to try research a bit more and forward a sketch as a question. The Arduino PWM output I do understand.
'G' (pin 9) is the output enable...
 

Wendy

Joined Mar 24, 2008
23,415
Do you remember all the work we put into the dimmer? It still applies. That means the only real problem is the latch and hold for the digit segments.

I just did a quick review of the old thread. Load have mercy was it long and deep!!!

So what problem to tackle first? Dimming, Latch and hold, other?
 

elec_mech

Joined Nov 12, 2008
1,500
Chris,

I'm a little confused. You refer to PIC several times but say you want to use an Arduino? Both a PIC and an Arduino are microcontrollers, each made by a different company. Perhaps when you say PIC you simply mean microcontroller (uC)?

Most microcontrollers including the Arduino can only sink/source up to a max of 30mA. You won't be able to drive your segments directly from the uC. Even if current wasn't an issue, a uC could not handle sinking beyond 5V whereas you need 24V. You'll need some type of transistor between the segments and the uC.

I missed MMcLaren's suggestion earlier of daisy-chaining the TPIC6B595's together. If we're confident the current rating is sufficient, I think this accomplishes the task with the fewest parts. However, you pointed out the 150mA rating is at 25°C. Typically, the current rating goes down as temperature goes up. Being outdoors, I'd worry about getting too close the limits of this part. Since you've used the ULN2003's and know they work reliably, I'd suggest sticking with them. They're relatively cheap and work well.

Fifteen digits means 105 segments and thus 105 I/O pins plus a temperature sensor, inputs to change the scores, and dimming. You'd need at least three Mega's (assuming enough pins can be configured for outputs) and at $17 USD apiece for the IC, you're at $51 USD for the uC solution alone.

If you decide that ULN2003's will be okay, you can increase the I/O size of any uC with the I/O expander I mentioned earlier or another one of your choosing. This is less expensive and less work than trying to buy large uC's with high pin count and writing separate programs for each. Going this route: $4 ATMega328P (Arduino Uno IC) + 7x $1.50 MCP23017 = <$15USD.
 

Thread Starter

chrischrischris

Joined Feb 18, 2012
313
Do you remember all the work we put into the dimmer? It still applies. That means the only real problem is the latch and hold for the digit segments.
Yes that old thread was long. I went through it all on Sunday as well. Yes, all the work we did on the dimmer did work. It was a clever setup, thanks again. However, this time I'm thinking of using as much code as possible to make things happen (more detail below)
I'm a little confused. You refer to PIC several times but say you want to use an Arduino? Both a PIC and an Arduino are microcontrollers
What I started to do is to use an Arduino microcontroller to write the code via my laptop and drive all the inputs / outputs via that development board. I did start a thread a while back in this forum called "PIC vs Arduino". This was to work out for me what would be the "simplest" way for me to run a microcontroller. In the end I chose the PIC due to the relatively cheap price, setup, libraries available, code available and relatively easy language. I've had stacks of fun writing different code to date (even traffic lights!).

So I'm still not sure the terminology difference. I'm talking about Arduino (microcontroller that has a ATmega328 processor?) or a "Mega" that has a ATmega2560 for more IOs. Secondly I'm talking about the shift registers (TPIC6B595) that have the letter "PIC" in their name. I suppose these are not microcontrollers regardless of their name - correct?
Most microcontrollers including the Arduino can only sink/source up to a max of 30mA
Yes, this is reason for running the common anode displays with a unit such as the 595 in order to handle the current for sinking. It seems daisy-chaining will do the trick for my project.

In answer to Bill, I'd like to now progress to carry out as much logic as possible in the uC which drives the shift registers. This would include the PWM as it's "realatively" quite easy to produce code in the uC to create a PWM based on an LDR (which can then also be used to drive the shift registers.
However, you pointed out the 150mA rating is at 25°C. Typically, the current rating goes down as temperature goes up. Being outdoors, I'd worry about getting too close the limits of this part

I'm not sure if the above is the correct figure to look at for the current vs temperature (as it also deals with outputs. However it looks as though the 120mA max that I have is around 60°C (140°F) if all 8 segments are on (i.e. the number 8 is the only time this is the case). I just looked up the spec sheets and instead of the max 150mA per output shift register above, there is also a 20 pin TPIC6A596N which has a max 350mA output. So if the others showed signs of overheating, I suppose I could use these (but they cost around $5'sh(AU) each vs $2'sh each).
 

Attachments

elec_mech

Joined Nov 12, 2008
1,500
chrischrischris said:

Secondly I'm talking about the shift registers (TPIC6B595) that have the letter "PIC" in their name. I suppose these are not microcontrollers regardless of their name - correct?.
No, those are not microcontrollers, they just happen to have the letters PIC in their name. Typically, PIC is used on the forum to refer to the Microchip brand of microcontrollers. If you want to refer to the TPIC6595 in short-hand, one way is '595. In this way we'll know you're referring to that IC and not a microcontroller.

So the answer is you want to use an Arduino as your microcontroller for this project, correct? I'm seeing conflicting statements, so I just want to be sure we're all on the same page.

Yes, looking at Figure 10, it appears you'd be okay. I think most of us prefer a part rated for at least double the needed current as a factor of safety, hence our reluctance to say yes to the '595.

I attempted to re-read portions of the original post this one references, but I didn't come across a final schematic in the last couple of pages. If you can post that, complete with the dimming circuit, I think we can could up with a design much faster.
 

Thread Starter

chrischrischris

Joined Feb 18, 2012
313
No, those are not microcontrollers, they just happen to have the letters PIC in their name. Typically, PIC is used on the forum to refer to the Microchip brand of microcontrollers.
Yes, that was confusing. So the PIC I'm proposing is the Mega328 (or Mega 2560).

As for the 595's, the TPIC6B595 can handle 150mA per segment (with a peak of 500mA if pulsed), and the TPIC6595 can handle 250mA per segment continuous (with 750 max). So if looking at the double safety margin (which I agree with) then the later would be better. However these are around $5.30 per unit vs $2.30 (AU). The pin configuration looks exactly the same, so if things end up ever heating, I could simply swap them over with the 250mA units (as I'm planning on inserting them in IC sockets.

As for the schematics, I'll be getting some of the 595s today so I can start bread boarding to test these out with some small 1/2 inch 7 segment displays to start with and the relevant code in the 328...
 

elec_mech

Joined Nov 12, 2008
1,500
As for the schematics, I'll be getting some of the 595s today so I can start bread boarding to test these out with some small 1/2 inch 7 segment displays to start with and the relevant code in the 328...
If you can swing it, I meant the schematics from your hardware only scoreboard you've already built. If we can see a complete schematic with the dimming circuit, we can better design/make suggestions for new uC-based circuit. Sometimes it's easier to work from an existing design than to start from scratch.
 

Thread Starter

chrischrischris

Joined Feb 18, 2012
313
I agree that "Programmable Intelligent Computer" does not roll off the tongue. But it must have sounded OK to a marketing guy in 1977...
I would have guessed "Programmable Integrated Circuit" - that make more sense. So these are "Programmable Intelligent Computers" what would a PUC be? "Programmable Unintelligent Computer!???" Hmm, weird name.
If you can swing it, I meant the schematics from your hardware only scoreboard you've already built. If we can see a complete schematic with the dimming circuit, we can better design/make suggestions for new uC-based circuit. Sometimes it's easier to work from an existing design than to start from scratch.
Sure. See attached. However, again realise, I am sort of starting this from scratch because what I'm looking at doing is:
  • Replacing the existing 5 circuit boards with a single one
  • This will be made up of 15 x 595's daisy chained to control the digit display
  • Given I'm using common anode digits (which have the resistors already built in, I'll be connecting the 7 cathodes of each digit directly to it's corresponding shift register
  • The anodes of each I'm looking at connecting to my 24V
  • On the circuit board I'll either just "stick on" an Arduino board, or if I can, I'll build it as well so it's all inclusive.
  • The code in the PIC will control the digits counting, forward, backwards, temperature, pausing, restarting, resetting, etc
  • The Arduino can also now control the digit intensity via an LDR (analog signal converted to digital and fed directly to the 595's.
This means any "changes" I want to make to the board end up simply being program changes. For example, members of the soccer club have asked if it's possible to change the count down timer to "count up" instead of down. Possible with some re-wiring right now, but easier with a program change. I can then also add things like: initially set the count down time, start the timer, it starts from 00:00, then when it reaches the finish of the first half (say 45:00), it flashes but keeps counting (for extra time). Hope that all makes sense.
 

Attachments

kgstewar

Joined Apr 5, 2012
152
Great project! I went through a similar evolution: first built a scoreboard using cmos 4000, etc. and then switched to a uC. Went from 4 big vero boards with miles of wire to one tiny PCB. Sure is easier to debug software than it is hardware :).

I also needed to run displays that required more current than the uC could handle. I went with a MAX7219/AS1106 feeding a ULN2003 (up to 500mA sink per pin) and UDN2981/TD62783 (up to 500mA source, per pin) as described in this thread. Not sure if that would work for you. MAX7219 takes three pins from your uC and if you daisy chain the MAX7219s, you can control up to 64 individual 7-seg digits or 512 individual LEDs. MAX7219s are expensive, but you can also use the equivalent AS1106 , which is slightly cheaper. Haven't tried the Chinese "MAX7219" that are only $1 each.

I considered using the Arduino, but ended up using the MSP430 Launchpad (msp-exp430g2). Much cheaper than Arduino and for my project, the chips had plenty of I/O and RAM. Programming the MSP430 chip can be done using C+ or you can also use Energia, which is basically Arduino for the MSP430 chips. Super easy to use and you can use the Arduino libraries (for instance, the LEDCONTROL library for Arduino makes it trivial to interface the MSP430 and the MAX7219). Also, you can program the MSP430 chip in the launchpad then pop it into your completed PCB (or program in circuit).

For my scoreboard, I have a variety of 7-segment digits (1.5" and 2.3"), 16 total (8 digits on each side of a two-sided scoreboard). Power is 16V. I'm using one AS1106 and a 14-pin MSP430. The uC has 10 I/O pins and I'm using 3 for the displays, and 4 for the inputs (4 bits so that I have up to 16 different button functions). Other MSP430s that work with the launchpad msp-exp430g2 have 16 or 24 I/O pins.

I confess to not having read through the earlier posts in detail, so my experience may not be applicable to your situation, but thought I'd throw this out in case it's helpful.

Kevin
 

dl324

Joined Mar 30, 2015
16,846
Hi chrischrischris,
[snip] I'm trying to steer away from multiplexing. I'm not willing to sacrifice longevity of the LEDs by pulsing higher than 20mA current at 1/10 duty cycle / 0.1ms pulse width.
When you're multiplexing, you have to pulse at higher current to get reasonable brightness; but it can be done without sacrificing longevity. You just need to follow the max power dissipation data for the LED. HP published an optoelectronics book that discusses the limitations on array size with multiplexed displays; I'll see if I can find a reference...

Don't let drive strength of your microcontroller limit you; just add external drivers.

BR,
Dennis
 

Thread Starter

chrischrischris

Joined Feb 18, 2012
313
Great project! I went through a similar evolution: first built a scoreboard using cmos 4000, etc. and then switched to a uC. Went from 4 big vero boards with miles of wire to one tiny PCB. Sure is easier to debug software than it is hardware :).
Yes, my scoreboard seems to be holding up well, however repair or change would be a little difficult (even though I've built spare circuit boards). I've done the hard yards and now it's time for programming instead.
...I went with a MAX7219/AS1106 feeding a ULN2003 (up to 500mA sink per pin) and UDN2981/TD62783 (up to 500mA source, per pin) as described in this thread. Not sure if that would work for you. MAX7219 takes three pins from your uC and if you daisy chain the MAX7219s, you can control up to 64 individual 7-seg digits or 512 individual LEDs.
I did check out your thread and linked wiring layout - looks relatively simple. Interestingly enough, over the past year I've been playing around with different Arduino code / projects (via an online manual I found). I actually did buy a MAX7219, and I used it on an 8 x 8 dot matrix display, trying to create a scrolling message. I haven't used the 1106 however.

I've just bought some TPIC6B595's to start fiddling with, but do you know what's funny...every time you come up with a solution and start, something else (like your suggestion) comes up that is simpler!!! Kevin, I am however getting more comfortable with Arduino programming and will go down the track on the 595's, but thanks for the suggestion.
When you're multiplexing, you have to pulse at higher current to get reasonable brightness; but it can be done without sacrificing longevity. You just need to follow the max power dissipation data for the LED. HP published an optoelectronics book that discusses the limitations on array size with multiplexed displays; I'll see if I can find a reference... Don't let drive strength of your microcontroller limit you; just add external drivers. Dennis
Thanks Dennis. I did do some experiments earlier on multiplexing - trying to see how intense I could comfortably go. For example, I found that for some small 7 segment leds I had, the spec sheet said the max was 160mA at 1/10 duty cycle and 0.1mS pulse width. I did push close to this limit and got close to matching the intensity. But now I think, why bother when there are chips available that can avoid you pushing to these extremes. If I can run the segments (leds) at less than 20mA 24/7, I'd rather do that if there is "any chance" the leds will last longer on my scoreboard as mentioned by MMcLaren and Mech_elec earlier.
 

Thread Starter

chrischrischris

Joined Feb 18, 2012
313
Just following up on this thread, I ended up opting to rebuild the controller for my scoreboard with an Arduino Uno and TPIC6B595 shift registers daisy chained. "Link" to my original project - it's pretty long!

Given it's based on Arduino, I posted my queries in that forum for the programming (see link).

I'm now almost ready to build the circuit board and am just asking for feedback on any issues anyone could see. I have done so in the Arduino forum as well, but I do value the feedback I've had from a number of valued members in this forum. As a heads up, I'm currently checking my trace sizes for power (???) and re-drawing to have a ground plane on my circuit board with a star configuration to all grounds.

Below is attached a copy of the latest schematic, and circuit board layout. I can't seem to load the Arduino file however (and I don't want to attach it as code here as it's around 800 lines worth with comments.

(just added the ino file as a zip in case anyone would like to use it one day)...

Chris.
 

Attachments

Last edited:

Wendy

Joined Mar 24, 2008
23,415
I misunderstood some things in our PMs. Mostly I missed this thread being here again.

You can always use compression (zip) to upload long documents, though I suspect most folk won't bother reading it. It is up to you,

I'll review it a bit more in detail when I get a chance.
 
Top