Reply by "Pet...@gmail.com [msp430]" July 12, 20142014-07-12
On Sat, Jul 12, 2014 at 6:11 AM, f...@yahoo.com [msp430] <
m...> wrote:

> Do you NEED 12 keys? Suppose you stay in the 0001ms-9999ms range, then
you could have 2 spin-buttons (UP/DOWN) for each digit, for a total of 8
time-setting buttons. Add one for START and you have a 3x3 matrix.

You could probably keep it even simpler still with a single pot on an A-D
channel.

-p.

Beginning Microcontrollers with the MSP430

Reply by "flo...@yahoo.com [msp430]" July 12, 20142014-07-12
Do you NEED 12 keys? Suppose you stay in the 0001ms-9999ms range, then you could have 2 spin-buttons (UP/DOWN) for each digit, for a total of 8 time-setting buttons. Add one for START and you have a 3x3 matrix.
Reply by "One...@bigpond.net.au [msp430]" July 12, 20142014-07-12
When I need to economically drive LEDs I drive them from 2 pins, and
multiplex them so that only 1 led is ever on at any given time, and each
LED that needs to be on is serviced 64 times a second (a convenient
value for simplifying testing and counting). If you don't need to save
current you could handle 1 segment per display in each cycle. I have
done this with as many as 60 LEDs. This doesn't save on pin count, you
still need 11 pins, but it does allow you to drive them without external
transistors or drivers. with an adequate current limit resistor. If you
decide on external drivers the 74LVTH573, an octal latch, has decent pin
drive current and is cheap in terms of space and cost. There are other
similar types without the additional pins to handle enable and latching.

The 28 pin version of the 2553 has 22 I/O pins, assuming that you need
the crystal pins for accurate timing.

11 for the display
7 for the keyboard
1 for the relay driver
1 for the button

2 spares

Al

On 12/07/2014 6:33 AM, Peter Johansson r...@gmail.com [msp430]
wrote:
> On Fri, Jul 11, 2014 at 3:21 PM, Jon Kirwan j...@infinitefactors.org
> [msp430] wrote:
>
>> [ ... ]
>> Entirely within the I/O of the G2553. Lines to spare.
> Which can be critical as the 2553 is the highest pin-count part
> available in thru-hole and TI has no SMD MSP430 parts with 0.8mm
> pitch. If you want more than 28 pins you need to step down to 0.5mm
> pitch parts.
>
>> I think you may not be able to escape the external
>> transistors for the common display lines. Even with a display
>> designed for 2mA segments, you are talking about perhaps
>> 5-8mA for the muxed segment current (you need more) and with
>> 7 segments all on at once the common current would be 35-56mA
>> and that exceeds any rational idea for direct common line
>> driving straight from the output ports.
> This is going to be more critical as TI recommends you shouldn't pull
> more than 6 mA per pin.
>
> -p.
>
> Posted by: Peter Johansson
>
>
>
>
Reply by "Jon...@infinitefactors.org [msp430]" July 11, 20142014-07-11
On Fri, 11 Jul 2014 17:41:33 -0700, you wrote:

> Thank you very much for the reference to Coxeter. I plan to
> buy a copy.

I bought Coxeter's book on the recommendation of a physicist
when I first started to grapple with string theory. I also
got two books by Gilmore from the late 1960's or so -- one
called Lie Groups and Algebras (good book) and another called
"Catastrophe Theory."

> For the spot welding timer I'm leaning towards a design I
> did 30+ years ago using a 555 and slide switches to input
> the time in binary. Dead simple and cheap. Also less risk
> of getting twisted off debugging welder noise problems.
> Selecting the pulse time is going to be trial and error
> anyway unless I happen to be doing a lot of welds w/ the
> same material which seems unlikely. Mostly I just need
> consistency. It only took a few welds using a toggle switch
> to convince me that that was not a good method.

Got it. Darn. I think I need a spot welder, too. I've been
learning MIG and TIG, lately, and love it. (Really should
have learned decades ago...)

> I plan to continue the '430 adventure but am giving a lot of
> thought to figuring out an economical user interface for
> small controllers. RS-232/SPI/I2C is looking more and more
> attractive w/ a single interface system talking to multiple
> controllers.

Well, there are lots of differences in those. RS-232 is an
electrical interface more than anything about transferring
data. You could put RS-232 drivers onto SPI (though that may
seen a little weird.) SPI is really good in the sense that
you can effectively do SPI with old 7400 series chips -- the
idea of clocking data in and then latching the shift register
across to a parallel output is just about an exact fit. The
I2C is really a minimalist's approach to serial
communications and it even supports multi-mastering, though
you will have a hard time finding GOOD sites discussing it in
full detail. (If anyone knows of a REALLY GOOD programmer
tutorial for implementing I2C multi-mastering in the face of
clock stretching... please inform me.) When I faced doing my
own multi-master interface, before I2C existed (or that I
knew about anyway), I came up with something rather similar
in hindsight. I suppose when you are this constrained, all
design roads lead to similar places.

> There are a bunch of things I want to do, but
> not if I have to spend $30 each time for a user interface.

Oh, don't do that.

But do keep in mind that what makes a transistor large is
that we have to handle them. And what makes an IC large is
that we have to handle them (including what makes the die
large is that the bond pad circuits need to handle static
zaps from people and worse as well as totally unknown
attached circuits..) And what makes a circuit board large is
all those "user interface" things like switches and lights
and so on. Things could be 1000 times smaller if they just
didn't have to interface with us bio types! ;)

But spend just enough to make it right to use!

> One interface shared by multiple controllers is OK. It's
> really the old $1 of electronics in a $10 box problem in
> different dress.

So you kind of want to make some kind of display/keyboard
thing that you can attach to other things as an interface?
Like hauling around an ADM-3A, for example?

Sounds like you need one of those message texting things
(fancy, nice display and keyboard, $20 or so) as your generic
human I/O. Too bad all the low speed interfaces have turned
into USB 3.0, bluetooth, wifi, and the like. Makes adding a
CHEAP connection a real pain for each unit you want to attach
to. A simple RS-232 interface is cheap and works well
(tolerates lots of noise.) 4-20mA would be nice, too. You'd
think every smart phone would include one or the other. But
everyone who remembers them is either dead or nearly so like
the two of us. It's not a selling point for the makers. So it
doesn't exist. I guess it's time to hack one.

> I can't see any reason why glitching the display during a
> button press should be a problem. Might not be acceptable
> in a commercial product, but I'm trying to find an
> affordable option for one off projects, e.g. an EDM machine,
> reflow oven, etc. One can fling PC hardware at such things,
> but that takes a lot of space and tends to be fragile.

> I had assumed transistors for the digit select lines as 4 is
> not too big a burden. Having to buffer every pin would not
> be attractive though. I'd been assuming 10 mA per pin as a
> limit, but w/o a sound basis which is why I raised the
> question.

I stay under 8mA sink, 6mA source. And even when that close
to the edge I spend a little more time making sure about it
before going even that high. But if you get those 7-seg
displays that use 2mA max per segment you might be able to
skirt things using around 5mA or so. You'd have to check the
display to see if it were sufficiently visible, muxed. But it
would save a part that way. Do look at the 7447, though. It's
not bad. But it's another chip. Sinks LOTS of current. Nice
that way. So if you decide you need extra current handling,
then maybe its an okay choice.

> Thanks again for the reference to Coxeter. I have little
> doubt that I'll find a number of uses for that. There's a
> lot of computational geometry that ties in to that. I had
> to look to see that I didn't have it. I might, but I didn't
> find it. I'd never thought about that in this context, so I
> was really surprised when you brought it up.

Well, his book covers a LOT MORE. It's a great segue into
string theory which uses ADEX theory. A-D-E Coxeter
graphs are important. Mathematicians (such as V. I. Arnold)
assume that each mathematical object (or category) classified
by the A-D-E graphs provides a different window into some
mysterious underlying object. John McKay's short paper, "A
Rapid Introduction to ADE Theory," is available here:

http://math.ucr.edu/home/baez/ADE.html

Anyway, best wishes in all this. And very nice talking!

Jon

Posted by: Jon Kirwan




Reply by "Reg...@yahoo.com [msp430]" July 11, 20142014-07-11
Thank you very much for the reference to Coxeter. I plan to buy a copy.

For the spot welding timer I'm leaning towards a design I did 30+ years ago using a 555 and slide switches to input the time in binary. Dead simple and cheap. Also less risk of getting twisted off debugging welder noise problems. Selecting the pulse time is going to be trial and error anyway unless I happen to be doing a lot of welds w/ the same material which seems unlikely. Mostly I just need consistency. It only took a few welds using a toggle switch to convince me that that was not a good method.

I plan to continue the '430 adventure but am giving a lot of thought to figuring out an economical user interface for small controllers. RS-232/SPI/I2C is looking more and more attractive w/ a single interface system talking to multiple controllers. There are a bunch of things I want to do, but not if I have to spend $30 each time for a user interface. One interface shared by multiple controllers is OK. It's really the old $1 of electronics in a $10 box problem in different dress.

I can't see any reason why glitching the display during a button press should be a problem. Might not be acceptable in a commercial product, but I'm trying to find an affordable option for one off projects, e.g. an EDM machine, reflow oven, etc. One can fling PC hardware at such things, but that takes a lot of space and tends to be fragile.

I had assumed transistors for the digit select lines as 4 is not too big a burden. Having to buffer every pin would not be attractive though. I'd been assuming 10 mA per pin as a limit, but w/o a sound basis which is why I raised the question.

Thanks again for the reference to Coxeter. I have little doubt that I'll find a number of uses for that. There's a lot of computational geometry that ties in to that. I had to look to see that I didn't have it. I might, but I didn't find it. I'd never thought about that in this context, so I was really surprised when you brought it up.

Reg
--------
On Fri, 7/11/14, Jon Kirwan j...@infinitefactors.org [msp430] wrote:

Subject: Re: [msp430] Rank beginner question
To: "MSP430 List"
Date: Friday, July 11, 2014, 5:46 PM


 









On Fri, 11 Jul 2014 17:03:22 -0400, you wrote:



>On Fri, Jul 11, 2014 at 3:21 PM, Jon Kirwan
j...@infinitefactors.org

>[msp430] wrote:

>

>> [ ... ]

>> Entirely within the I/O of the G2553. Lines to
spare.

>

>Which can be critical as the 2553 is the highest
pin-count part

>available in thru-hole and TI has no SMD MSP430 parts
with 0.8mm

>pitch. If you want more than 28 pins you need to step
down to 0.5mm

>pitch parts.



If one uses resistors to limit currents and can accept
the

idea that if someone holds down a key that it may
somewhat

screw up the display for a moment... then by turning off
all

the four common driver outputs, it may then be possible
to

share the 7 segment output lines with the keyboard
scanning.

If the scanning is done quite quickly and doesn't
represent

much time relative to the display output scanning period,

anyway. That would cut another 6 lines off of, so now only
12

I/O required. (7 segments shared with keyboard, 4 common

drivers, and relay output.) Downside is that hitting a
key

_may_ cause display problems while pressed.



There are other ideas, using some of the LED segments as

diodes as part of the scanning process to reduce pins, too.
I

need to think about that one a little more, though,
because

I've never considered it before now. Seems viable to me
right

now, but I need to think more about it before I'm sure.
Might

be worthless. And besides, now we start comparing the
segment

diode drops vs the MSP430 power rail.



>> I think you may not be able to escape the
external

>> transistors for the common display lines. Even with
a display

>> designed for 2mA segments, you are talking about
perhaps

>> 5-8mA for the muxed segment current (you need more)
and with

>> 7 segments all on at once the common current would
be 35-56mA

>> and that exceeds any rational idea for direct
common line

>> driving straight from the output ports.

>

>This is going to be more critical as TI recommends you
shouldn't pull

>more than 6 mA per pin.



Yeah. I was looking at the curves. Shows what happens out
to

20mA and more. But I've always kept in my mind that an
MSP430

is no good for sourcing more than 6mA or sinking more
than

8mA. Been years since I came up with those numbers,
though.



Jon











#yiv1153938791 #yiv1153938791 --
#yiv1153938791ygrp-mkp {
border:1px solid #d8d8d8;font-family:Arial;margin:10px
0;padding:0 10px;}

#yiv1153938791 #yiv1153938791ygrp-mkp hr {
border:1px solid #d8d8d8;}

#yiv1153938791 #yiv1153938791ygrp-mkp #yiv1153938791hd {
color:#628c2a;font-size:85%;font-weight:700;line-height:122%;margin:10px
0;}

#yiv1153938791 #yiv1153938791ygrp-mkp #yiv1153938791ads {
margin-bottom:10px;}

#yiv1153938791 #yiv1153938791ygrp-mkp .yiv1153938791ad {
padding:0 0;}

#yiv1153938791 #yiv1153938791ygrp-mkp .yiv1153938791ad p {
margin:0;}

#yiv1153938791 #yiv1153938791ygrp-mkp .yiv1153938791ad a {
color:#0000ff;text-decoration:none;}
#yiv1153938791 #yiv1153938791ygrp-sponsor
#yiv1153938791ygrp-lc {
font-family:Arial;}

#yiv1153938791 #yiv1153938791ygrp-sponsor
#yiv1153938791ygrp-lc #yiv1153938791hd {
margin:10px
0px;font-weight:700;font-size:78%;line-height:122%;}

#yiv1153938791 #yiv1153938791ygrp-sponsor
#yiv1153938791ygrp-lc .yiv1153938791ad {
margin-bottom:10px;padding:0 0;}

#yiv1153938791 #yiv1153938791actions {
font-family:Verdana;font-size:11px;padding:10px 0;}

#yiv1153938791 #yiv1153938791activity {
background-color:#e0ecee;float:left;font-family:Verdana;font-size:10px;padding:10px;}

#yiv1153938791 #yiv1153938791activity span {
font-weight:700;}

#yiv1153938791 #yiv1153938791activity span:first-child {
text-transform:uppercase;}

#yiv1153938791 #yiv1153938791activity span a {
color:#5085b6;text-decoration:none;}

#yiv1153938791 #yiv1153938791activity span span {
color:#ff7900;}

#yiv1153938791 #yiv1153938791activity span
.yiv1153938791underline {
text-decoration:underline;}

#yiv1153938791 .yiv1153938791attach {
clear:both;display:table;font-family:Arial;font-size:12px;padding:10px
0;width:400px;}

#yiv1153938791 .yiv1153938791attach div a {
text-decoration:none;}

#yiv1153938791 .yiv1153938791attach img {
border:none;padding-right:5px;}

#yiv1153938791 .yiv1153938791attach label {
display:block;margin-bottom:5px;}

#yiv1153938791 .yiv1153938791attach label a {
text-decoration:none;}

#yiv1153938791 blockquote {
margin:0 0 0 4px;}

#yiv1153938791 .yiv1153938791bold {
font-family:Arial;font-size:13px;font-weight:700;}

#yiv1153938791 .yiv1153938791bold a {
text-decoration:none;}

#yiv1153938791 dd.yiv1153938791last p a {
font-family:Verdana;font-weight:700;}

#yiv1153938791 dd.yiv1153938791last p span {
margin-right:10px;font-family:Verdana;font-weight:700;}

#yiv1153938791 dd.yiv1153938791last p
span.yiv1153938791yshortcuts {
margin-right:0;}

#yiv1153938791 div.yiv1153938791attach-table div div a {
text-decoration:none;}

#yiv1153938791 div.yiv1153938791attach-table {
width:400px;}

#yiv1153938791 div.yiv1153938791file-title a, #yiv1153938791
div.yiv1153938791file-title a:active, #yiv1153938791
div.yiv1153938791file-title a:hover, #yiv1153938791
div.yiv1153938791file-title a:visited {
text-decoration:none;}

#yiv1153938791 div.yiv1153938791photo-title a,
#yiv1153938791 div.yiv1153938791photo-title a:active,
#yiv1153938791 div.yiv1153938791photo-title a:hover,
#yiv1153938791 div.yiv1153938791photo-title a:visited {
text-decoration:none;}

#yiv1153938791 div#yiv1153938791ygrp-mlmsg
#yiv1153938791ygrp-msg p a span.yiv1153938791yshortcuts {
font-family:Verdana;font-size:10px;font-weight:normal;}

#yiv1153938791 .yiv1153938791green {
color:#628c2a;}

#yiv1153938791 .yiv1153938791MsoNormal {
margin:0 0 0 0;}

#yiv1153938791 o {
font-size:0;}

#yiv1153938791 #yiv1153938791photos div {
float:left;width:72px;}

#yiv1153938791 #yiv1153938791photos div div {
border:1px solid
#666666;height:62px;overflow:hidden;width:62px;}

#yiv1153938791 #yiv1153938791photos div label {
color:#666666;font-size:10px;overflow:hidden;text-align:center;white-space:nowrap;width:64px;}

#yiv1153938791 #yiv1153938791reco-category {
font-size:77%;}

#yiv1153938791 #yiv1153938791reco-desc {
font-size:77%;}

#yiv1153938791 .yiv1153938791replbq {
margin:4px;}

#yiv1153938791 #yiv1153938791ygrp-actbar div a:first-child {
margin-right:2px;padding-right:5px;}

#yiv1153938791 #yiv1153938791ygrp-mlmsg {
font-size:13px;font-family:Arial, helvetica, clean,
sans-serif;}

#yiv1153938791 #yiv1153938791ygrp-mlmsg table {
font-size:inherit;font:100%;}

#yiv1153938791 #yiv1153938791ygrp-mlmsg select,
#yiv1153938791 input, #yiv1153938791 textarea {
font:99% Arial, Helvetica, clean, sans-serif;}

#yiv1153938791 #yiv1153938791ygrp-mlmsg pre, #yiv1153938791
code {
font:115% monospace;}

#yiv1153938791 #yiv1153938791ygrp-mlmsg * {
line-height:1.22em;}

#yiv1153938791 #yiv1153938791ygrp-mlmsg #yiv1153938791logo {
padding-bottom:10px;}


#yiv1153938791 #yiv1153938791ygrp-msg p a {
font-family:Verdana;}

#yiv1153938791 #yiv1153938791ygrp-msg
p#yiv1153938791attach-count span {
color:#1E66AE;font-weight:700;}

#yiv1153938791 #yiv1153938791ygrp-reco
#yiv1153938791reco-head {
color:#ff7900;font-weight:700;}

#yiv1153938791 #yiv1153938791ygrp-reco {
margin-bottom:20px;padding:0px;}

#yiv1153938791 #yiv1153938791ygrp-sponsor #yiv1153938791ov
li a {
font-size:130%;text-decoration:none;}

#yiv1153938791 #yiv1153938791ygrp-sponsor #yiv1153938791ov
li {
font-size:77%;list-style-type:square;padding:6px 0;}

#yiv1153938791 #yiv1153938791ygrp-sponsor #yiv1153938791ov
ul {
margin:0;padding:0 0 0 8px;}

#yiv1153938791 #yiv1153938791ygrp-text {
font-family:Georgia;}

#yiv1153938791 #yiv1153938791ygrp-text p {
margin:0 0 1em 0;}

#yiv1153938791 #yiv1153938791ygrp-text tt {
font-size:120%;}

#yiv1153938791 #yiv1153938791ygrp-vital ul li:last-child {
border-right:none !important;
}
#yiv1153938791


Posted by: Reginald Beardsley




Reply by "Jon...@infinitefactors.org [msp430]" July 11, 20142014-07-11
On Fri, 11 Jul 2014 17:03:22 -0400, you wrote:

>On Fri, Jul 11, 2014 at 3:21 PM, Jon Kirwan j...@infinitefactors.org
>[msp430] wrote:
>
>> [ ... ]
>> Entirely within the I/O of the G2553. Lines to spare.
>
>Which can be critical as the 2553 is the highest pin-count part
>available in thru-hole and TI has no SMD MSP430 parts with 0.8mm
>pitch. If you want more than 28 pins you need to step down to 0.5mm
>pitch parts.

If one uses resistors to limit currents and can accept the
idea that if someone holds down a key that it may somewhat
screw up the display for a moment... then by turning off all
the four common driver outputs, it may then be possible to
share the 7 segment output lines with the keyboard scanning.
If the scanning is done quite quickly and doesn't represent
much time relative to the display output scanning period,
anyway. That would cut another 6 lines off of, so now only 12
I/O required. (7 segments shared with keyboard, 4 common
drivers, and relay output.) Downside is that hitting a key
_may_ cause display problems while pressed.

There are other ideas, using some of the LED segments as
diodes as part of the scanning process to reduce pins, too. I
need to think about that one a little more, though, because
I've never considered it before now. Seems viable to me right
now, but I need to think more about it before I'm sure. Might
be worthless. And besides, now we start comparing the segment
diode drops vs the MSP430 power rail.

>> I think you may not be able to escape the external
>> transistors for the common display lines. Even with a display
>> designed for 2mA segments, you are talking about perhaps
>> 5-8mA for the muxed segment current (you need more) and with
>> 7 segments all on at once the common current would be 35-56mA
>> and that exceeds any rational idea for direct common line
>> driving straight from the output ports.
>
>This is going to be more critical as TI recommends you shouldn't pull
>more than 6 mA per pin.

Yeah. I was looking at the curves. Shows what happens out to
20mA and more. But I've always kept in my mind that an MSP430
is no good for sourcing more than 6mA or sinking more than
8mA. Been years since I came up with those numbers, though.

Jon

Posted by: Jon Kirwan




Reply by "Pet...@gmail.com [msp430]" July 11, 20142014-07-11
On Fri, Jul 11, 2014 at 3:21 PM, Jon Kirwan j...@infinitefactors.org
[msp430] wrote:

> [ ... ]
> Entirely within the I/O of the G2553. Lines to spare.

Which can be critical as the 2553 is the highest pin-count part
available in thru-hole and TI has no SMD MSP430 parts with 0.8mm
pitch. If you want more than 28 pins you need to step down to 0.5mm
pitch parts.

> I think you may not be able to escape the external
> transistors for the common display lines. Even with a display
> designed for 2mA segments, you are talking about perhaps
> 5-8mA for the muxed segment current (you need more) and with
> 7 segments all on at once the common current would be 35-56mA
> and that exceeds any rational idea for direct common line
> driving straight from the output ports.

This is going to be more critical as TI recommends you shouldn't pull
more than 6 mA per pin.

-p.

Posted by: Peter Johansson




Reply by "Jon...@infinitefactors.org [msp430]" July 11, 20142014-07-11
On Fri, 11 Jul 2014 12:33:42 -0700, I wrote:

>4D

5D, I meant.

Jon

Posted by: Jon Kirwan




Reply by "Jon...@infinitefactors.org [msp430]" July 11, 20142014-07-11
On Fri, 11 Jul 2014 12:21:18 -0700, I wrote:

>But you could consider using the 2D shadow of a simplex
>topology. In algebraic topology, a line segment is 1-dim
>simplex, a triangle is 2-dim, a tetrahedron is 3-dim, and so
>on. So to make the shadow just take any polygon and connect
>all the vertices together to all the other vertices. For a
>4-sided polygon (a square will do), you have to cross-connect
>the opposing corners so you have six lines connecting four
>vertices. Make sense? (This simplex square is just a shadow
>image of the tetrahedron.)

Imagine tilting the tetrahedron over in such a way that it's
shadow cast onto a 2D plane yields the square with the cross
connected lines. If you use your imagination well, you can
"see" how this works.

Coxeter has a great book on polytropes called "Regular
Polytropes" that is important (if written in a stilted, older
style of writing.) I have a copy on my shelf. The connected
hexagon is a 5-simplex, or hexateron, and a 2D shadow of a
regular 4D object that takes a bit to imagine well. Doesn't
matter. You can go look at this page for some basic info:

http://en.wikipedia.org/wiki/5-simplex

Jon

Posted by: Jon Kirwan




Reply by "Jon...@infinitefactors.org [msp430]" July 11, 20142014-07-11
On Fri, 11 Jul 2014 06:49:39 -0700, you wrote:

> I'm embarking on my first real project, a one shot
> millisecond resolution timer to control a spot welder.
> All prior embedded work has been eval board demo stuff.
> So I'm expecting to get myself in trouble.
>
> For this I need:
>
> a 4 digit display output
> a 12 button keypad input
> relay output
> trigger button input
>
> I would like to use a G2553 part for this.
>
> If I multiplex the display and keypad on the same pins I
> will have a problem when it tries to drive the LED segments
> w/ a dead short through the keypad. Obviously this can be
> solved using tristate buffers to toggle between the display
> and the keypad, but that seems a bit inelegant.
>
> Is it reasonable to use 10-20k resistors to limit the
> current through the keypad when the LED segments are being
> driven? The power loss is not an issue, just the MSP430
> current limits. Is there another method for doing this
> besides tristate buffering? Am I being unrealistic trying
> to multiplex input and output on the same pins? Other
> comments?
>
>Thanks,
>Reg

Well, you almost talked enough. Some thoughts.

The 4 digit display, if a 7-seg LED type, will need 7+4 or 11
outputs there. Depending on the current requirements for each
segment, chances are that the drivers for the common lines
will require external transistors and possibly even the
segment lines, too. You could use a 4-to-7 decoder IC (7447)
to both reduce the output pin count to 4 and to provide
segment driver lines. And you could consider using a 2-to-4
decoder too to reduce the common line outputs to 2. So with
both of those, you'd be down to 6 output lines for the
display. But that's about it. Or you could use a separate
microcontroller to operate the display and drop the lines
down to almost nothing at all. Micros are cheap and easy to
use, once you've bought the tools and the learning curve
using them. So it's not an unreasonable option when compared
against other external ICs. But you still may have current
problems for at least the common lines. So... well, just some
thoughts.

The 12 button keypad really depends. If you don't expect to
handle N-key rollover and to disambiguate multiple,
simultaneous key presses, then a simple 4x4, or 8 I/O lines
will cover it.

But you could consider using the 2D shadow of a simplex
topology. In algebraic topology, a line segment is 1-dim
simplex, a triangle is 2-dim, a tetrahedron is 3-dim, and so
on. So to make the shadow just take any polygon and connect
all the vertices together to all the other vertices. For a
4-sided polygon (a square will do), you have to cross-connect
the opposing corners so you have six lines connecting four
vertices. Make sense? (This simplex square is just a shadow
image of the tetrahedron.)

For 12 keys, you could consider such a cross-connected
hexagon. Draw a hexagon and cross connect all the vertices.
This gives you a total of 15 lines. Now imagine that each of
these lines is a connected switch, instead. That's 15
switches. More than enough to handle your 12. Connect the
I/O lines to the vertices. Now, you can scan the switches by
activating one and only one I/O line as an output, one at a
time, and "seeing" which of the other five inputs show a
connection. You can actually detect some combinations of two
switches being depressed this way. But it takes some effort
to maximize that ability.

In general, you get (N^2-N)/2 switches with N I/O lines with
no extra parts. You can use the same topology, with two
oppositely arranged LEDs along each line or edge and with
small valued resistors going from each I/O line to a vertex
in order to selectively control up to (N^2-N) LEDs, as well.
This is good if you only need one of them ON at a time, so
that trick doesn't help much with the display you have. But
you can do multiplexing tricks along with enabling multiple
edges at a time to get some interesting effects for some
other project, I suppose.

Anyway, it might work with just 6 I/O instead of 8. AND you
would also be able to add your trigger button in there, as
well, since you have 15 possibilities and only needed 12 for
the keyboard.

The relay one is obvious. So another 1.

So, with a 7447 IC for the 7-seg (you may be able to get away
without using the blanking inputs or the lamp test, so just 4
outputs here) and four outputs used for the common lines via
four external transistors, you have 8 outputs for the
display. Then another 6 to get all your switches. And one
more for the relay circuit. So 15 lines all together and they
are NOT shared but totally separate.

If you avoid the 7447 IC (and your output pins can handle the
muxed segment current) then you are talking about 18 lines.
Still within the G2553.

Entirely within the I/O of the G2553. Lines to spare.

If you stay simple then 7+4 for the display, another 12 for
the switches, 1 for the trigger and 1 for the relay, for a
total of 25 lines. Which is what forces you to look at
sharing some lines with the G2553.

I think you may not be able to escape the external
transistors for the common display lines. Even with a display
designed for 2mA segments, you are talking about perhaps
5-8mA for the muxed segment current (you need more) and with
7 segments all on at once the common current would be 35-56mA
and that exceeds any rational idea for direct common line
driving straight from the output ports.

Jon

Posted by: Jon Kirwan