Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Can I do this with a uProcessor?

13 views
Skip to first unread message

tempus fugit

unread,
May 20, 2007, 11:22:14 PM5/20/07
to
Hi all;

I currently have a switching system that uses logic like latches and
inverters, along with lots of diodes. I'm thinking about changing some
things in it, and was wondering if I shouldn't just revamp the whole thing
and go to a PIC. Here's what I would like it to do:

I have 14 switches - when any one of them was switched to ground
(momentary), it would cause the PIC to:
1. clear any previous data in the PIC
2. latch a signal to the required output that would ramp up the control
voltage over a few ms.

I have a 15th switch that when switched causes the each switch to activate a
different set of devices (sort of like having 2 different banks). Could I
use a PIC to have the same function, kind of like having it latch that
switch in one position or another, and telling the PIC to execute the proper
instruction?

These switches control 6 different relays to switch in different effects or
effects combinations for my guitar pedalboard. Would I need many PICs to
accomplish this, or would it be possible to set things up with just one?

I suspect these are fairly newb questions, but I don't know what types of
things are possible with the instruction set available with a PIC. I have
downloaded a couple data sheets, but at about 200 or more pages each,
there's a lot to digest, and i don't quite understand it all yet.

Is it possible to do these things with a PIC?

Thanks

Spehro Pefhany

unread,
May 21, 2007, 8:08:12 AM5/21/07
to
On Sun, 20 May 2007 23:22:14 -0400, the renowned "tempus fugit"
<toc...@quitspammingme.ciaccess.com> wrote:

>Hi all;
>
>I currently have a switching system that uses logic like latches and
>inverters, along with lots of diodes. I'm thinking about changing some
>things in it, and was wondering if I shouldn't just revamp the whole thing
>and go to a PIC. Here's what I would like it to do:

PIC is a trade name for several ranges of microcontrollers from one
manufacturer. There are many others.

A microcontroller is essentially a microprocessor with
RAM/ROM/periperals on board (though definitions vary somewhat).

>I have 14 switches - when any one of them was switched to ground
>(momentary), it would cause the PIC to:
>1. clear any previous data in the PIC
>2. latch a signal to the required output that would ramp up the control
>voltage over a few ms.

The ramping up is perhaps best done with some analog circuitry. Since
the switches are manually actuated you could perhaps scan them at,
say, 500Hz rather than deal with them individually (much like your PC
keyboard)

>I have a 15th switch that when switched causes the each switch to activate a
>different set of devices (sort of like having 2 different banks). Could I
>use a PIC to have the same function, kind of like having it latch that
>switch in one position or another, and telling the PIC to execute the proper
>instruction?
>
>These switches control 6 different relays to switch in different effects or
>effects combinations for my guitar pedalboard. Would I need many PICs to
>accomplish this, or would it be possible to set things up with just one?

Probably just one. The main limit is how fast things have to happen,
if a few msec here or there is not important, then you can do some
very complex things with a micro running at a reasonable clock
frequency. The number of I/O may come into play, but there are ways of
expanding the I/O (scanning etc.) and there are lots of micros with
100, 200+ or more 'pins'.

>I suspect these are fairly newb questions, but I don't know what types of
>things are possible with the instruction set available with a PIC. I have
>downloaded a couple data sheets, but at about 200 or more pages each,
>there's a lot to digest, and i don't quite understand it all yet.
>
>Is it possible to do these things with a PIC?
>
>Thanks

From what you have said, most likely yes, however you will have a
learning curve to deal with. Start with something simple like blinking
an LED at a visible frequency and work from there. Be sure to check
out the reference manual for the product line you're looking at too.
It may seem like a lot, but the more detailed information rather than
the skinned down data sheet will be helpful.


Best regards,
Spehro Pefhany
--
"it's the network..." "The Journey is the reward"
sp...@interlog.com Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog Info for designers: http://www.speff.com

MooseFET

unread,
May 21, 2007, 9:27:17 AM5/21/07
to
On May 20, 8:22 pm, "tempus fugit"

<tocc...@quitspammingme.ciaccess.com> wrote:
> Hi all;
>
> I currently have a switching system that uses logic like latches and
> inverters, along with lots of diodes. I'm thinking about changing some
> things in it, and was wondering if I shouldn't just revamp the whole thing
> and go to a PIC. Here's what I would like it to do:

I suggest you say "micro" not "PIC" and consider other types. I'll
explain why as we go through the various requirements.


> I have 14 switches - when any one of them was switched to ground
> (momentary),

You want to have 14 port connections to do this with so we now know
one specification of the micro.

You didn't say how quickly it needs to react. Since a human is
pushing the switch, perhaps 20mS or so should be the required maximum
responce time.

> it would cause the PIC to:
> 1. clear any previous data in the PIC
> 2. latch a signal to the required output that would ramp up the control
> voltage over a few ms.

This sounds like you want a micro with a built in DAC or an external
DAC connected to the micro. How smoothly does it need to ramp and how
linear etc? How many output lines need to be ramped? Does only one
go high at a time?

You can use fairly simple analog circuits to make a ramp. You also
didn't speak about how the signals ever go low again. I assume they
do this also with a ramp.


> I have a 15th switch that when switched causes the each switch to activate a

Opps make the 15 port lines.

> different set of devices (sort of like having 2 different banks). Could I
> use a PIC to have the same function, kind of like having it latch that
> switch in one position or another, and telling the PIC to execute the proper
> instruction?

This is simple code.


> These switches control 6 different relays to switch in different effects or

Ok so now we have a total of 15+6=21 port connections.

> effects combinations for my guitar pedalboard. Would I need many PICs to
> accomplish this, or would it be possible to set things up with just one?
>
> I suspect these are fairly newb questions, but I don't know what types of
> things are possible with the instruction set available with a PIC. I have
> downloaded a couple data sheets, but at about 200 or more pages each,
> there's a lot to digest, and i don't quite understand it all yet.
>
> Is it possible to do these things with a PIC?

Now I'm going to suggest you reconsider the question of which micro.
You could look at the ones at www.cygnal.com as an example of a very
different one. There are lots and lots of chips that can do what you
want.


Eeyore

unread,
May 21, 2007, 9:39:59 AM5/21/07
to

tempus fugit wrote:

Very much so.

I'd code it as a finite state machine actually. The actual processor
instructions barely matter btw. For ease of programming most ppl would use
compilers for a high level language. PICBASIC is simple and only costs $99.95
http://www.melabs.com/products/pbc.htm

Graham

tempus fugit

unread,
May 21, 2007, 10:52:11 AM5/21/07
to
> You didn't say how quickly it needs to react. Since a human is
> pushing the switch, perhaps 20mS or so should be the required maximum
> responce time.
>

It needs to switch a relay quickly enough so that it seems like stomping the
switch instantly causes the effect to go on. I didn't even know that
respsonse time was something that needed consideration (told you I was a
newb).


> > it would cause the PIC to:
> > 1. clear any previous data in the PIC
> > 2. latch a signal to the required output that would ramp up the control
> > voltage over a few ms.
>
> This sounds like you want a micro with a built in DAC or an external
> DAC connected to the micro. How smoothly does it need to ramp and how
> linear etc?

I just want it to take a few ms to ramp up the relay driver before the relay
switches so that any capacitative clicks are avoided. I don't know if that
needs to be linear or smooth or what (help?)


How many output lines need to be ramped? Does only one
> go high at a time?

Well this depends on how many micros I need to do the job. All the outs
would need to be ramped, but if possible, I would like to have 6 outputs -
one to each relay - an probably a max of 4 on at a time.


>
> You can use fairly simple analog circuits to make a ramp. You also
> didn't speak about how the signals ever go low again. I assume they
> do this also with a ramp.

Hopefully yes. They will go low from requirement 1 - clear any previous data
in the PIC.


>
>
> > I have a 15th switch that when switched causes the each switch to
activate a
>
> Opps make the 15 port lines.
>
> > different set of devices (sort of like having 2 different banks). Could
I
> > use a PIC to have the same function, kind of like having it latch that
> > switch in one position or another, and telling the PIC to execute the
proper
> > instruction?
>
> This is simple code.
>

That's what i wanted to hear!

Thankjs for your help Moose - and i'll check out that other site. I'm glad
for any other advice as well.


Don Lancaster

unread,
May 21, 2007, 12:12:46 PM5/21/07
to
It is UNTHINKABLE to NOT use a PIC for this ap.


--
Many thanks,

Don Lancaster voice phone: (928)428-4073
Synergetics 3860 West First Street Box 809 Thatcher, AZ 85552
rss: http://www.tinaja.com/whtnu.xml email: d...@tinaja.com

Please visit my GURU's LAIR web site at http://www.tinaja.com

Gary Tait

unread,
May 21, 2007, 2:39:25 PM5/21/07
to
Eeyore <rabbitsfriend...@hotmail.com> wrote in
news:4651A160...@hotmail.com:

> PICBASIC is simple and only costs $99.95
> http://www.melabs.com/products/pbc.htm
>


I'd use Bacom AVR, which is free for up to 2K code (or at least was last I
used it), and Atmel micros.

Or you get a Basic Stamp.

Gary Tait

unread,
May 21, 2007, 2:48:59 PM5/21/07
to
"tempus fugit" <toc...@quitspammingme.ciaccess.com> wrote in
news:e9837$46510fed$d1d89b9d$31...@PRIMUS.CA:

> Hi all;
>
> I currently have a switching system that uses logic like latches and
> inverters, along with lots of diodes. I'm thinking about changing some
> things in it, and was wondering if I shouldn't just revamp the whole
> thing and go to a PIC. Here's what I would like it to do:
>
> I have 14 switches - when any one of them was switched to ground
> (momentary), it would cause the PIC to:

Could the be muxed, or read with a diode binary convertor?

> 1. clear any previous data in the PIC
> 2. latch a signal to the required output that would ramp up the
> control voltage over a few ms.

You might be able to do the ramp in analog.



> I have a 15th switch that when switched causes the each switch to
> activate a different set of devices (sort of like having 2 different
> banks). Could I use a PIC to have the same function, kind of like
> having it latch that switch in one position or another, and telling
> the PIC to execute the proper instruction?

Simple.

> These switches control 6 different relays to switch in different
> effects or effects combinations for my guitar pedalboard. Would I need
> many PICs to accomplish this, or would it be possible to set things up
> with just one?

Just one.

>
> I suspect these are fairly newb questions, but I don't know what types
> of things are possible with the instruction set available with a PIC.
> I have downloaded a couple data sheets, but at about 200 or more pages
> each, there's a lot to digest, and i don't quite understand it all
> yet.

They are pretty dumb. Just I/Os you need to interface with code.
With the right tools, the code is pretty easy, especially for such a
simple task as yours.

I even have the code in my head (at the BASIC version of what it is).

With extra code, you can have it field programmable, and have a display
and/or indicators.

Eeyore

unread,
May 21, 2007, 2:58:32 PM5/21/07
to

Don Lancaster wrote:

> tempus fugit wrote:
> >
> > Is it possible to do these things with a PIC?
>

> It is UNTHINKABLE to NOT use a PIC for this ap.

You could use a Philips LPC ! That would be my choice in fact as I'm familiar with
the family.

Graham

tempus fugit

unread,
May 21, 2007, 5:57:42 PM5/21/07
to

"Don Lancaster" <d...@tinaja.com> wrote in message
news:5bduo0F...@mid.individual.net...


Do you mean an actual PIC, or any uProcessor?

at http://www.tinaja.com


tempus fugit

unread,
May 21, 2007, 5:59:37 PM5/21/07
to

>
> The ramping up is perhaps best done with some analog circuitry. Since
> the switches are manually actuated you could perhaps scan them at,
> say, 500Hz rather than deal with them individually (much like your PC
> keyboard)

I'm not familiar with this. What do you mean by scan them at 500Hz?

Thanks

Eeyore

unread,
May 21, 2007, 6:05:47 PM5/21/07
to

tempus fugit wrote:

He's thinking of a way of trying to eliminate the effect of switch bounce I
think.

Provided your switches only do 'X' when pressed rather than released, there's a
very simple way of avoiding the issue entirely in software though.

Graham

tempus fugit

unread,
May 21, 2007, 6:09:03 PM5/21/07
to

"Eeyore" <rabbitsfriend...@hotmail.com> wrote in message
news:465217D3...@hotmail.com...


I get it now.

Thanks Graham


tempus fugit

unread,
May 21, 2007, 6:12:47 PM5/21/07
to
> From what you have said, most likely yes, however you will have a
> learning curve to deal with. Start with something simple like blinking
> an LED at a visible frequency and work from there.

I had planned to do that; however, I would like to experiment with the
uProcessor I'll actually need to do the job if that's at all possible, thus
saving time and hopefully money. Is there a model # you'd suggest for this
task? Should I try to find 1 device with 21 port connections, or use a
couple and (if it's possible?) interface them somehow? Most of the tutorials
I've seen on the web are for 20 pin DIPs, which would be easy to experiment
with. I'm not sure how I'd go about trying to experiment with a surface
mount package.

Thanks

Eeyore

unread,
May 21, 2007, 6:13:06 PM5/21/07
to

tempus fugit wrote:

> "Eeyore" wrote:
> >
> > Provided your switches only do 'X' when pressed rather than released,
> > there's a very simple way of avoiding the issue entirely in software though.
>

> I get it now.
>
> Thanks Graham

You're welcome. It's cute isn't it ?

Graham


Eeyore

unread,
May 21, 2007, 6:14:08 PM5/21/07
to

tempus fugit wrote:

> > From what you have said, most likely yes, however you will have a
> > learning curve to deal with. Start with something simple like blinking
> > an LED at a visible frequency and work from there.
>
> I had planned to do that

I have a file here called "blinkled.p51".

It's a handy test.

Graham

Rich Grise

unread,
May 21, 2007, 7:20:49 PM5/21/07
to

That means that the uP is running a program that samples all of its inputs,
one at a time, 500 times per second (for the whole set). This is much
faster than is needed to give a response that looks immediate to the naked
eye, and probably fast enough to do debouncing in software (or firmware,
which is software in FLASH/PROM). 1/500 of a second comes out to 2
milliseconds per sample, which is time enough to take five samples within
10 milliseconds, which was the "bounce time" of some switch that I looked
up, and probably fairly typical.

Hope This Helps!
Rich

MooseFET

unread,
May 21, 2007, 9:52:20 PM5/21/07
to
On May 21, 7:52 am, "tempus fugit"
<tocc...@quitspammingme.ciaccess.com> wrote:
[....]

> > This sounds like you want a micro with a built in DAC or an external
> > DAC connected to the micro. How smoothly does it need to ramp and how
> > linear etc?
>
> I just want it to take a few ms to ramp up the relay driver before the relay
> switches so that any capacitative clicks are avoided. I don't know if that
> needs to be linear or smooth or what (help?)

Ok, so maybe we can strike the DAC out of the specs. A very simple RC
low pass filter will likely do what you need. How high is "high" and
how low is "low"? I'm thinking in terms of using an op-amp if the
signal needs to be bigger than the natural swing of the port pins.


[...]


> Well this depends on how many micros I need to do the job. All the outs
> would need to be ramped, but if possible, I would like to have 6 outputs -
> one to each relay - an probably a max of 4 on at a time.

If you are using an op-amp, they come 4 to a chip. It makes sense to
go up to the next multiple of 4 lines. BTW: Unless I missed
something, we are only talking of one processor to do lets say 24
lines.

[...]


> Thankjs for your help Moose - and i'll check out that other site. I'm glad
> for any other advice as well.

Look up the following parts and look at the datasheets:

LM340
LT1499
LM324
2N2222
1N4004

I'm almost certain the design will have most of those parts in it. I
suggest the LT1499 for a reason I'm about to explain so that others
don't throw too many stones at me.

The LT1499 is the op-amp I could remember had a rail to rail input and
output and also has diodes across the inputs. Here's the circuit I'm
thinking of:

ASCII art:
----!!-----
! !
! V+ !
! ! !
PORT PIN -/\/\----+----!-\ !
! >---+--- RAMP
Vcc/2--------!+/
!
GND

It makes a nice linear ramp up and down.


tempus fugit

unread,
May 21, 2007, 10:38:49 PM5/21/07
to

As for voltages, I have 12, 9 and 5v available to me at present. Hi would be
+5 (to control the relay driver), and lo would be ground I think. If I cant
do it easily in software, I may just go with an RC circuit. The idea is to
rebuild what I currently have with the minimum of parts. What would be ultra
slick would be to use a 13 I/O port device and somehow use it for the 6 ins
and outs, since I only have to control 6 parameters. Some switches, though,
would turn on more than one thing at a time, and I haven't yet figured out a
way to connect the switches so that each switch would only switch what i
wanted it to. For instance, if I have a switch that switches A, and 1 that
switches B, and 1 that switches A and B, I can't figure out a way to wire
that to 3 in pins so that they don't all interact.

Thanks again


Eeyore

unread,
May 21, 2007, 10:51:36 PM5/21/07
to

Rich Grise wrote:

If you're only looking for a momentary make, you don't even need to debounce.

Graham

Eeyore

unread,
May 21, 2007, 10:56:43 PM5/21/07
to

MooseFET wrote:

> If you are using an op-amp, they come 4 to a chip.

Sometimes.

Graham

Spehro Pefhany

unread,
May 22, 2007, 8:36:48 AM5/22/07
to

Suppose you have 14 keys. You have a single 8 bit I/O port. We will
assume that only one key can be pressed at once, otherwise you'll have
a bit more complexity.

So you make half of the pins inputs and the other half outputs.

You drive one of the four outputs (say) low and float the others
(essentially make them inputs). Then read the four inputs at once.
That gives you the states of 4 keys. Repeat 3 more times with a
different output low and you have all 14 (or 16) key states.

VCC
+
|
.-.
| |
| |
'-'
|
input P0 --+---------------------------------
| | | |
VCC \ o \ o \ o \ o
+ \ \ \ \
| \. \. \. \.
.-. o o o o
| | | | | |
| |
'-' P4 P5 P6 P7
|
input P1 -+---------------------------------
| | | |
\ o \ o \ o \ o
\ \ \ \
\. \. \. \.
o o o o
| | | |

P4 P5 P6 P7


etc.

P0..P3 inputs only
P4..P7 are low or float

(For a real design for production we'd probably have some series
resistors on the port pins and the pullups might be built into the
chip)

Debouncing is another issue. It's not that difficult to do for all
cases in software (and get rid of glitches at the same time), but if
you only want the keys to start something you may not even need it.

Eeyore

unread,
May 22, 2007, 7:53:31 AM5/22/07
to

Spehro Pefhany wrote:

> the renowned "tempus fugit" wrote:
> >
> >I'm not familiar with this. What do you mean by scan them at 500Hz?
>
>

> Suppose you have 14 keys. You have a single 8 bit I/O port. We will
> assume that only one key can be pressed at once, otherwise you'll have
> a bit more complexity.
>
> So you make half of the pins inputs and the other half outputs.
>
> You drive one of the four outputs (say) low and float the others
> (essentially make them inputs). Then read the four inputs at once.
> That gives you the states of 4 keys. Repeat 3 more times with a
> different output low and you have all 14 (or 16) key states.

I would so NOT advise key scanning in a sensitive audio product !

It's a bitch trying to get rid of the noise form the scanning. A few more I/O
pins is so simple in comparison.

Graham

MooseFET

unread,
May 22, 2007, 9:18:05 AM5/22/07
to
On May 21, 7:38 pm, "tempus fugit"
<tocc...@quitspammingme.ciaccess.com> wrote:
[....]
>

> > ASCII art:
> > ----!!-----
> > ! !
> > ! V+ !
> > ! ! !
> > PORT PIN -/\/\----+----!-\ !
> > ! >---+--- RAMP
> > Vcc/2--------!+/
> > !
> > GND
>
> > It makes a nice linear ramp up and down.
>
> As for voltages, I have 12, 9 and 5v available to me at present. Hi would be
> +5 (to control the relay driver), and lo would be ground I think. If I cant

A micro running on the 5V and RC filters on the port outputs may be
the best way to go. It certainly is one worth considering. You won't
be able to do much better on the parts count issue.


[....]


> and outs, since I only have to control 6 parameters. Some switches, though,
> would turn on more than one thing at a time, and I haven't yet figured out a
> way to connect the switches so that each switch

You have made an error in thinking here. The switch only informs the
micro that the switch is closed. The micro knows which group of
things to activate for a given switch. This makes the wiring very
simple.

Gary Tait

unread,
May 22, 2007, 11:07:01 AM5/22/07
to
"tempus fugit" <toc...@quitspammingme.ciaccess.com> wrote in
news:c4064$465218e5$d1d89b70$17...@PRIMUS.CA:

You don't need 21, just 5 for input (14 switches in binary, plus the
bank swap, which you could incorporate into the other switches, with
just 4 input lines. 6 for output. Optionally some sort of indicator
output.

mpm

unread,
May 22, 2007, 5:20:07 PM5/22/07
to
On May 21, 2:58?pm, Eeyore <rabbitsfriendsandrelati...@hotmail.com>
wrote:

I'd go with an 8051 before an LPC.
If an LPC, you have to do a kubookie dance to get 'em programmed.

I know I probably spelled that wrong, but you get the idea.
The flash programming documentation on the LPC series is the WORST I
HAVE EVER SEEN!
Plus, you have to keep switching pins in and out of the circuit to
program it. What a hassle!

TF, take a look at the Atmel 89S8253.
Cheap, and will do the job. It has (4) 8-bit bidirectional ports (32
in/out total).
And, you can program it free with the Atmel download software.
You will need a $25 adapter for your PC, but you can't get much
cheaper.

The 8051's are very well supported, so you will find free compilers
(Basic, Assembly, "C", etc..)

The only thing that might be an issue for you is the 8253 port pins
can only drive about 10mA each, and that won't be enough for most
relays directly. -mpm

Eeyore

unread,
May 22, 2007, 6:16:47 PM5/22/07
to

mpm wrote:

> Eeyore wrote:
> > Don Lancaster wrote:
> > > tempus fugit wrote:
> >
> > > > Is it possible to do these things with a PIC?
> >
> > > It is UNTHINKABLE to NOT use a PIC for this ap.
> >
> > You could use a Philips LPC ! That would be my choice in fact as I'm familiar > with
> the family.
>
>

> I'd go with an 8051 before an LPC.
> If an LPC, you have to do a kubookie dance to get 'em programmed.
>
> I know I probably spelled that wrong, but you get the idea.
> The flash programming documentation on the LPC series is the WORST I
> HAVE EVER SEEN!
> Plus, you have to keep switching pins in and out of the circuit to
> program it. What a hassle!
>
> TF, take a look at the Atmel 89S8253.
> Cheap, and will do the job. It has (4) 8-bit bidirectional ports (32
> in/out total).
> And, you can program it free with the Atmel download software.
> You will need a $25 adapter for your PC, but you can't get much
> cheaper.

Yes, you're quite right I was thinking of the LPCs because of newer things I've been
working on but a flash version of an 8051 would be spot on. I used the 89s53 for this
kind of thing for example and it's got plenty of port pins on it too.

Graham

Spehro Pefhany

unread,
May 22, 2007, 8:18:45 PM5/22/07
to

"LPC" may not be the best way to refer to the NXP microcontrollers. It
could refer to an 8051 in an 8-pin package (P89LPC901), an ARM9 in a
320-pin package (LPC3180FEL320) or quite a range of other parts
inbetween.

joseph2k

unread,
May 23, 2007, 12:46:22 AM5/23/07
to
Eeyore wrote:

Not at all. Switch or keyboard scanning means sampling the state of each
switch at some given rate, 500 times a second in this case. Switch / key
debounce is a convenient byproduct of the method.
--
JosephKK
Gegen dummheit kampfen die Gotter Selbst, vergebens.  
--Schiller

joseph2k

unread,
May 23, 2007, 1:15:36 AM5/23/07
to
tempus fugit wrote:

It is much to your advantage to multiplex the inputs, say use 4 "rows" and 4
"columns" to sense your switches (up to 16 of them) on 8 pins of i/o. It
is also to your advantage to drive your outputs individually.
What i do not understand is the idea of using ramps to drive relays, they
work much better with on-off control drive. I also have issues with using
relays at all, electronic switching is faster and quieter.
As for what turns on when for any given switch configuration, just decide
what you want it to do and that becomes part of the micro's program. no
witchy complexities, just a map (list) from inputs to outputs.

Spehro Pefhany

unread,
May 23, 2007, 4:07:24 AM5/23/07
to
On Wed, 23 May 2007 06:00:14 GMT, the renowned Eeyore
<rabbitsfriend...@hotmail.com> wrote:

>
>
>joseph2k wrote:
>
>> Eeyore wrote:
>> > tempus fugit wrote:
>> >
>> >> > The ramping up is perhaps best done with some analog circuitry. Since
>> >> > the switches are manually actuated you could perhaps scan them at,
>> >> > say, 500Hz rather than deal with them individually (much like your PC
>> >> > keyboard)
>> >>
>> >> I'm not familiar with this. What do you mean by scan them at 500Hz?
>> >
>> > He's thinking of a way of trying to eliminate the effect of switch bounce
>> > I think.
>> >
>> > Provided your switches only do 'X' when pressed rather than released,
>> > there's a very simple way of avoiding the issue entirely in software
>> > though.
>>
>>

>> Not at all. Switch or keyboard scanning means sampling the state of each
>> switch at some given rate, 500 times a second in this case. Switch / key
>> debounce is a convenient byproduct of the method.
>

>You really don't want switch scanning waveforms in an audio device. I've seen
>the trouble it creates.
>
>Graham

Sounds like a very bad design.

Eeyore

unread,
May 23, 2007, 8:48:24 AM5/23/07
to

Spehro Pefhany wrote:

> Eeyore wrote:
> >joseph2k wrote:
> >> Eeyore wrote:
> >> > tempus fugit wrote:
> >> >
> >> >> > The ramping up is perhaps best done with some analog circuitry. Since
> >> >> > the switches are manually actuated you could perhaps scan them at,
> >> >> > say, 500Hz rather than deal with them individually (much like your PC
> >> >> > keyboard)
> >> >>
> >> >> I'm not familiar with this. What do you mean by scan them at 500Hz?
> >> >
> >> > He's thinking of a way of trying to eliminate the effect of switch bounce
> >> > I think.
> >> >
> >> > Provided your switches only do 'X' when pressed rather than released,
> >> > there's a very simple way of avoiding the issue entirely in software
> >> > though.
> >>
> >>
> >> Not at all. Switch or keyboard scanning means sampling the state of each
> >> switch at some given rate, 500 times a second in this case. Switch / key
> >> debounce is a convenient byproduct of the method.
> >
> >You really don't want switch scanning waveforms in an audio device. I've seen
> >the trouble it creates.
>
>

> Sounds like a very bad design.

It was a very nice design actually but like all things in the real world was
subject to cost constraints so couldn't be on say a 4 layer board.

Try eliminating electro-statically and electro-magnetically coupled interference
when the audio noise floor is >=110dB below the 5V typical switching voltage. Note
that to be sure of not hearing a discrete tone, the pickup into the audio will need
to be about >=130dB below 5V since single tones are not well masked by wideband
noise.

130dB. Don't forget that.

We used to agonise over the induced click you'd get from a single short trace
switching maybe just a local control voltage. It's astonishing what makes itself
known when you actually *listen* to audio, as opposed to relying on long term
averaged measurements.

Graham

tempus fugit

unread,
May 23, 2007, 8:52:11 AM5/23/07
to

> > Thanks again
> It is much to your advantage to multiplex the inputs, say use 4 "rows" and
4
> "columns" to sense your switches (up to 16 of them) on 8 pins of i/o.

So is the multiplexing done by the micro itself, or is it done with a
separate IC?

> What i do not understand is the idea of using ramps to drive relays, they
> work much better with on-off control drive. I also have issues with using
> relays at all, electronic switching is faster and quieter.

It isn't the relays I want to ramp, it's the relay drivers. I may end up
going to electronic switching in the end (in fact that is what I want to
experiment with, but my existing design would require quite a bit of
modification to do that, which is why I'm thinking about building from
scratch using a micro).

tempus fugit

unread,
May 23, 2007, 8:53:57 AM5/23/07
to
> The only thing that might be an issue for you is the 8253 port pins
> can only drive about 10mA each, and that won't be enough for most
> relays directly. -mpm


No problem there - I'm using relay drivers to drive the relays already, and
may end up going with CMOS switches anyway.

Man, there are a lot of different micros....

Thanks for the tip on the Atmel - it looks promising.


tempus fugit

unread,
May 23, 2007, 8:59:42 AM5/23/07
to

> You have made an error in thinking here. The switch only informs the
> micro that the switch is closed. The micro knows which group of
> things to activate for a given switch. This makes the wiring very
> simple.
>

I understand that, but do I then need 1 input pin for each switch, and 1 for
each output? That would mean 15 ins, plus 6 outs. Since I only have 6
different parameters to control, I was wondering if there was a way to use
only 6 input pins and 6 outs, plus the 1 extra for the bank switch.

The problem lies in the fact that some of the switches will control more
than 1 parameter at a time. That was what I was trying to describe in the
previous post:

a switch that switches A, and 1 that switches B, and 1 that switches A and
B

Thanks

tempus fugit

unread,
May 23, 2007, 9:10:43 AM5/23/07
to
>
> Suppose you have 14 keys. You have a single 8 bit I/O port.

So by 8 bits you mean a total of 8 pins to connect to (I'm still a bit
unsure of all the terminology)?


>We will assume that only one key can be pressed at once, otherwise you'll
have
a bit more complexity.

This is the case, although it is possible that more than one key may get
pressed accidentally...

>
> So you make half of the pins inputs and the other half outputs.

By programming them this way in the software?


>
> You drive one of the four outputs (say) low and float the others
> (essentially make them inputs). Then read the four inputs at once.

Here's where I'm getting lost. How do the ouputs get driven low? I was
thinking that if no switch was activated, that they would be already low, by
design. What do you mean read the 4 inputs at once? I was hoping to control
the micro by momentarily grounding an input with the switch.


>That gives you the states of 4 keys. Repeat 3 more times with a different
output low and you have all 14 (or 16) key states.

So are the output pins sometimes outputs and sometimes inputs? Are the
switches (inputs) then connected to the same pins as the relay drivers
(outputs)?

>but if
you only want the keys to start something you may not even need it.


The switches are indeed just to get something started.

Thanks again.


MooseFET

unread,
May 23, 2007, 9:36:47 AM5/23/07
to
On May 22, 9:46 pm, joseph2k <quiettechb...@yahoo.com> wrote:
[....]
I'm going to jump in here with a somewhat off subject comment about
the scanning of keyboards.

> Not at all. Switch or keyboard scanning means sampling the state of each
> switch at some given rate, 500 times a second in this case. Switch / key
> debounce is a convenient byproduct of the method.

Normally, when you want to scan a keyboard with a micro, you wire the
row connections to one (8 bit) port and the column connections to
another.

You are then going to strobe the column signals one at a time. In the
8051 case, you have the idle state of the ports as high and you strobe
one low at a time. If a switch is closed, the row signal will go low
at the same time.

If the OP has a slowish (or busy) micro to work with, and doesn't need
to worry about the user pressing more than one key at a time, he can
do as follows:

Assuming 4 bits of each are used:

PrevKey = NOKEY;
repeat
RowPort = 0FH
ColPort = 0
KeyNo = NOKEY
if RowPort < 0FH then begin
if (RowPort AND 01H)=0 then KeyNo=0
if (RowPort AND 02H)=0 then KeyNo=1
if (RowPort AND 04H)=0 then KeyNo=2
if (RowPort AND 08H)=0 then KeyNo=3

ColPort = 0AH
if RowPort <0FH then KeyNo = KeyNo + 4
ColPort = 0CH
if RowPort <0FH then KeyNo = KeyNo + 8
end
if (KeyNO <> NOKEY) and (KeyNo = PrevKey) then
report KeyNo
PreKey = KeyNo
end


Because the ColPort lines only change when the key is pressed, there
is less noise created. You have to check the key twice because the
test can come up with the wrong answer on a key bounce.

MooseFET

unread,
May 23, 2007, 9:51:01 AM5/23/07
to
On May 23, 5:59 am, "tempus fugit"

<tocc...@quitspammingme.ciaccess.com> wrote:
> > You have made an error in thinking here. The switch only informs the
> > micro that the switch is closed. The micro knows which group of
> > things to activate for a given switch. This makes the wiring very
> > simple.
>
> I understand that, but do I then need 1 input pin for each switch, and 1 for
> each output? That would mean 15 ins, plus 6 outs. Since I only have 6
> different parameters to control, I was wondering if there was a way to use
> only 6 input pins and 6 outs, plus the 1 extra for the bank switch.

I'm goning to try a bit of ASCII art:


Column Port
0 1 2
! ! !
R ! ! !
o 0---+-------------+------------ !
w ! ! ! ! ! !
P 0 SW 0 0 SW 0 0 SW 0
o ! ! !
r 1---+-------------+------------ !
t ! ! ! ! ! !
0 SW 0 0 SW 0 0 SW 0

A rectangular array of switches connected as shown is how you can
connect them to the ports. You then need to drive the Column Port
bits up and down and see which Row Port bit follows which Column port
bit.

Extending this array, you can do 16 keys with 4+4 = 8 port lines.

Eeyore

unread,
May 23, 2007, 10:01:34 AM5/23/07
to

tempus fugit wrote:

> > It is much to your advantage to multiplex the inputs, say use 4 "rows" and
> > 4 "columns" to sense your switches (up to 16 of them) on 8 pins of i/o.
>
> So is the multiplexing done by the micro itself, or is it done with a
> separate IC?

It's done by writing software to drive the micro's port pins in the required
manner.

Since you're new to all this and key scanning will in any case create an audio
tone that's very likely to break through into your signal, I very strongly
suggest you don't bother and use 1 input or output per port pin.

After all an 80C51 variant such as the 89s53
http://atmel.com/dyn/products/product_card.asp?family_id=604&family_name=8051+Architecture&part_id=1919

is inexpensive, easy to use and has 32 general purpose I/O lines anyway.

Graham

Eeyore

unread,
May 23, 2007, 10:04:53 AM5/23/07
to

tempus fugit wrote:

>
> > What i do not understand is the idea of using ramps to drive relays, they
> > work much better with on-off control drive. I also have issues with using
> > relays at all, electronic switching is faster and quieter.
>
> It isn't the relays I want to ramp, it's the relay drivers.

But what benefit do you expect to get from this ?

Graham

MooseFET

unread,
May 23, 2007, 10:05:06 AM5/23/07
to
On May 23, 5:52 am, "tempus fugit"

<tocc...@quitspammingme.ciaccess.com> wrote:
> > > Thanks again
> > It is much to your advantage to multiplex the inputs, say use 4 "rows" and
> 4
> > "columns" to sense your switches (up to 16 of them) on 8 pins of i/o.
>
> So is the multiplexing done by the micro itself, or is it done with a
> separate IC?

The micro can do the muxing. Hunt around in this thread and you find
a place where I explained the idea of the code that does it. You
still need at least 8 port bits to do the 16 switches.

If you are willing to use douple pole switches, you can do a bit
better:

1 means connected to the switch
0 means not connected

sw connections
no R0-C0 R1-C0 R2-C0 R0-C1 R1-C1 R2-C1
1 0 0 0 0 1 1
2 0 0 0 1 0 1
3 0 0 1 0 0 1
4 0 1 0 0 0 1
5 1 0 0 0 0 1
6 0 0 0 1 1 0
7 0 0 1 0 1 0
8 0 1 0 0 1 0
9 1 0 0 0 1 0
10 0 0 1 1 0 0
11 0 1 0 1 0 0
12 1 0 0 1 0 0
13 0 1 1 0 0 0
14 1 0 1 0 0 0
15 1 1 0 0 0 0

This give 15 switches on only 5 port bits.

MooseFET

unread,
May 23, 2007, 10:05:22 AM5/23/07
to
On May 23, 5:52 am, "tempus fugit"
<tocc...@quitspammingme.ciaccess.com> wrote:
> > > Thanks again
> > It is much to your advantage to multiplex the inputs, say use 4 "rows" and
> 4
> > "columns" to sense your switches (up to 16 of them) on 8 pins of i/o.
>
> So is the multiplexing done by the micro itself, or is it done with a
> separate IC?

The micro can do the muxing. Hunt around in this thread and you find


>

MooseFET

unread,
May 23, 2007, 10:05:27 AM5/23/07
to
On May 23, 5:52 am, "tempus fugit"
<tocc...@quitspammingme.ciaccess.com> wrote:
> > > Thanks again
> > It is much to your advantage to multiplex the inputs, say use 4 "rows" and
> 4
> > "columns" to sense your switches (up to 16 of them) on 8 pins of i/o.
>
> So is the multiplexing done by the micro itself, or is it done with a
> separate IC?

The micro can do the muxing. Hunt around in this thread and you find


>

MooseFET

unread,
May 23, 2007, 10:05:30 AM5/23/07
to
On May 23, 5:52 am, "tempus fugit"
<tocc...@quitspammingme.ciaccess.com> wrote:
> > > Thanks again
> > It is much to your advantage to multiplex the inputs, say use 4 "rows" and
> 4
> > "columns" to sense your switches (up to 16 of them) on 8 pins of i/o.
>
> So is the multiplexing done by the micro itself, or is it done with a
> separate IC?

The micro can do the muxing. Hunt around in this thread and you find


>

MooseFET

unread,
May 23, 2007, 10:05:41 AM5/23/07
to
On May 23, 5:52 am, "tempus fugit"
<tocc...@quitspammingme.ciaccess.com> wrote:
> > > Thanks again
> > It is much to your advantage to multiplex the inputs, say use 4 "rows" and
> 4
> > "columns" to sense your switches (up to 16 of them) on 8 pins of i/o.
>
> So is the multiplexing done by the micro itself, or is it done with a
> separate IC?

The micro can do the muxing. Hunt around in this thread and you find


>

MooseFET

unread,
May 23, 2007, 10:06:05 AM5/23/07
to
On May 23, 5:52 am, "tempus fugit"
<tocc...@quitspammingme.ciaccess.com> wrote:
> > > Thanks again
> > It is much to your advantage to multiplex the inputs, say use 4 "rows" and
> 4
> > "columns" to sense your switches (up to 16 of them) on 8 pins of i/o.
>
> So is the multiplexing done by the micro itself, or is it done with a
> separate IC?

The micro can do the muxing. Hunt around in this thread and you find


>

MooseFET

unread,
May 23, 2007, 10:06:14 AM5/23/07
to
On May 23, 5:52 am, "tempus fugit"
<tocc...@quitspammingme.ciaccess.com> wrote:
> > > Thanks again
> > It is much to your advantage to multiplex the inputs, say use 4 "rows" and
> 4
> > "columns" to sense your switches (up to 16 of them) on 8 pins of i/o.
>
> So is the multiplexing done by the micro itself, or is it done with a
> separate IC?

The micro can do the muxing. Hunt around in this thread and you find


>

Spehro Pefhany

unread,
May 23, 2007, 11:07:59 AM5/23/07
to

Electrostatic shielding can be pretty decent on a cheap 2-layer board
if you use copper pour and housing metal effectively.

>Try eliminating electro-statically and electro-magnetically coupled interference

No much magnetic coupling, it's a keyboard scan not an LED scan. The
latter would be harder to deal with.

>when the audio noise floor is >=110dB below the 5V typical switching voltage. Note
>that to be sure of not hearing a discrete tone, the pickup into the audio will need
>to be about >=130dB below 5V since single tones are not well masked by wideband
>noise.
>
>130dB. Don't forget that.

It's for a *guitar*. What's the signal to noise ratio on the pickup?

>We used to agonise over the induced click you'd get from a single short trace
>switching maybe just a local control voltage. It's astonishing what makes itself
>known when you actually *listen* to audio, as opposed to relying on long term
>averaged measurements.
>
>Graham

MooseFET

unread,
May 23, 2007, 10:08:55 AM5/23/07
to
On May 23, 5:52 am, "tempus fugit"
<tocc...@quitspammingme.ciaccess.com> wrote:
> > > Thanks again
> > It is much to your advantage to multiplex the inputs, say use 4 "rows" and
> 4
> > "columns" to sense your switches (up to 16 of them) on 8 pins of i/o.
>
> So is the multiplexing done by the micro itself, or is it done with a
> separate IC?

The micro can do the muxing. Hunt around in this thread and you find


>

MooseFET

unread,
May 23, 2007, 10:08:58 AM5/23/07
to
On May 23, 5:52 am, "tempus fugit"
<tocc...@quitspammingme.ciaccess.com> wrote:
> > > Thanks again
> > It is much to your advantage to multiplex the inputs, say use 4 "rows" and
> 4
> > "columns" to sense your switches (up to 16 of them) on 8 pins of i/o.
>
> So is the multiplexing done by the micro itself, or is it done with a
> separate IC?

The micro can do the muxing. Hunt around in this thread and you find


>

MooseFET

unread,
May 23, 2007, 10:09:09 AM5/23/07
to
On May 23, 5:52 am, "tempus fugit"
<tocc...@quitspammingme.ciaccess.com> wrote:
> > > Thanks again
> > It is much to your advantage to multiplex the inputs, say use 4 "rows" and
> 4
> > "columns" to sense your switches (up to 16 of them) on 8 pins of i/o.
>
> So is the multiplexing done by the micro itself, or is it done with a
> separate IC?

The micro can do the muxing. Hunt around in this thread and you find


>

MooseFET

unread,
May 23, 2007, 10:09:28 AM5/23/07
to
On May 23, 5:52 am, "tempus fugit"
<tocc...@quitspammingme.ciaccess.com> wrote:
> > > Thanks again
> > It is much to your advantage to multiplex the inputs, say use 4 "rows" and
> 4
> > "columns" to sense your switches (up to 16 of them) on 8 pins of i/o.
>
> So is the multiplexing done by the micro itself, or is it done with a
> separate IC?

The micro can do the muxing. Hunt around in this thread and you find


>

Eeyore

unread,
May 23, 2007, 10:09:40 AM5/23/07
to

Eeyore wrote:

Use the 89S8253 (an update it seems)
http://uk.farnell.com/jsp/Semiconductors/Microprocessors+/+Microcontrollers+&+peripherals/ATMEL/AT89S8253-24PU/displayProduct.jsp?sku=1095746

A mere £2.97 in 1 off from Farnell and available in a DIL package so it's easy to protoytype with for the
hobbyist.

This programmer should be fine with it too but I'd want to be 100% sure of device support before buying.
http://cgi.ebay.co.uk/NSP-Universal-Programmer-Eprom-MCU-PIC-PLD-Flash_W0QQitemZ220114134875QQihZ012QQcategoryZ294QQrdZ1QQcmdZViewItem

http://cgi.ebay.co.uk/TOP2004-USB-Universal-Programmer_W0QQitemZ220114134699QQihZ012QQcategoryZ294QQrdZ1QQcmdZViewItem

Graham

MooseFET

unread,
May 23, 2007, 10:11:21 AM5/23/07
to
On May 23, 5:52 am, "tempus fugit"
<tocc...@quitspammingme.ciaccess.com> wrote:
> > > Thanks again
> > It is much to your advantage to multiplex the inputs, say use 4 "rows" and
> 4
> > "columns" to sense your switches (up to 16 of them) on 8 pins of i/o.
>
> So is the multiplexing done by the micro itself, or is it done with a
> separate IC?

The micro can do the muxing. Hunt around in this thread and you find


>

MooseFET

unread,
May 23, 2007, 10:11:39 AM5/23/07
to
On May 23, 5:52 am, "tempus fugit"
<tocc...@quitspammingme.ciaccess.com> wrote:
> > > Thanks again
> > It is much to your advantage to multiplex the inputs, say use 4 "rows" and
> 4
> > "columns" to sense your switches (up to 16 of them) on 8 pins of i/o.
>
> So is the multiplexing done by the micro itself, or is it done with a
> separate IC?

The micro can do the muxing. Hunt around in this thread and you find


>

Eeyore

unread,
May 23, 2007, 10:17:48 AM5/23/07
to

Spehro Pefhany wrote:

> the renowned Eeyore wrote:
>
> >Try eliminating electro-statically and electro-magnetically coupled interference
>
> No much magnetic coupling, it's a keyboard scan not an LED scan. The
> latter would be harder to deal with.

True enough. The produt I had in mind had some multiplexed loads to but these did have
seperate drivers so the current involved wasn't that large. It was still problematic. I
should perhaps point out that the hardware was designed by someone else but I had to
make it work to a saleable standard.

More to the point though, the poor lad is new to the game and will be struggling on the
learning curve anyway, so why introduce additional complexity when it's *not needed* !

Packing it all into say a 16 pin SMT part is great for volume manufacture but this is
just a hobby for him.

Graham

Eeyore

unread,
May 23, 2007, 10:21:09 AM5/23/07
to

Spehro Pefhany wrote:

> the renowned Eeyore wrote:
> >
> >130dB. Don't forget that.
>
> It's for a *guitar*. What's the signal to noise ratio on the pickup?

You might be surprised just how good it can be.

I'm sorry but the dismissive "it's just a guitar" attitude is typical of non-audio
practicioners who think the task is trivial and is one reason none of them can design
decent quality audio to save themselves.

Tempus fugit has posted many times about his project and it's quite clear to me that
he's very sensitive indeed to little pops and clicks and the like so I expect him to be
working to a high standard of performance.

Graham

tempus fugit

unread,
May 23, 2007, 12:39:47 PM5/23/07
to

"Eeyore" <rabbitsfriend...@hotmail.com> wrote in message
news:465449E4...@hotmail.com...


Well, supposedly a capacitative click can be introduced to the audio when
switching using non-mechanical switches, which in this case I suppose my
relay drivers (darlington pair transistors) technically are. Not being suire
of the limitations of the micros, I thought maybe you could just program a
ramped up voltage as the desired output.

tempus fugit

unread,
May 23, 2007, 12:42:02 PM5/23/07
to
>
> It's for a *guitar*.

ouch that hurts...

tempus fugit

unread,
May 23, 2007, 12:42:48 PM5/23/07
to

>
> Tempus fugit has posted many times about his project and it's quite clear
to me that
> he's very sensitive indeed to little pops and clicks and the like so I
expect him to be
> working to a high standard of performance.
>


Indeed I am, in fact that's why I'm thinking about redesigning in the 1st
place.

Rich Grise

unread,
May 23, 2007, 1:12:02 PM5/23/07
to
On Wed, 23 May 2007 14:21:09 +0000, Eeyore wrote:
> Spehro Pefhany wrote:
>
>> the renowned Eeyore wrote:
>> >
>> >130dB. Don't forget that.
>>
>> It's for a *guitar*. What's the signal to noise ratio on the pickup?
>
> You might be surprised just how good it can be.
>
> I'm sorry but the dismissive "it's just a guitar" attitude is typical of non-audio
> practicioners

s/practicioners/practitioners/
s/practitioners/phools/

I've found that anything below -20 dB is inaudible anyway, except for the
subliminal effects, if any. :-)

Cheers!
Rich

Spehro Pefhany

unread,
May 23, 2007, 2:13:04 PM5/23/07
to

You're fingering it wrong, then.

Eeyore

unread,
May 23, 2007, 1:18:07 PM5/23/07
to

tempus fugit wrote:

> "Eeyore" wrote:
> > tempus fugit wrote:

> > > Joseph2k wrote:
> > >
> > > > What i do not understand is the idea of using ramps to drive relays,
> > > > they work much better with on-off control drive. I also have issues
> with
> > > > using relays at all, electronic switching is faster and quieter.
> > >
> > > It isn't the relays I want to ramp, it's the relay drivers.
> >
> > But what benefit do you expect to get from this ?
> >
> > Graham
>
> Well, supposedly a capacitative click can be introduced to the audio when
> switching using non-mechanical switches,

Like fet switches ? It's 'charge injection' usually. Jfets don't exhibit this
effect like CMOS swiches, although there is another way they can click but this
can be reduced by driving them carefully. Do you recall these were the type I
originally recommended ?


> which in this case I suppose my relay drivers (darlington pair transistors)
> technically are.

Absolutely not. No connection in any way whatever. Transistors themselves won't
click.


> Not being suire of the limitations of the micros, I thought maybe you could
> just program a ramped up voltage as the desired output.

Only if it has a D-A output but you can get a ramp of sorts with an R and a C
anyway.

Beware that relays click too, not just from the contacts opening and closing and
the effect this has on any currents but also as the result of induction from the
magnetic field from the coil. The magnetic field problem *can* be reduced by
ramping the *coil current* though.

Graham


Rich Grise

unread,
May 23, 2007, 1:18:35 PM5/23/07
to
On Wed, 23 May 2007 12:42:02 -0400, tempus fugit wrote:
>>
>> It's for a *guitar*.
>
> ouch that hurts...

Hey, don't be too hasty to condemn - my brother plays guitar
professionally:
http://tamarak.iwarp.com/

My lil' bro is the blond-headed one in the foreground on the CD cover.
Scroll down; he's "Dan Grise". Yes, it's true, I have a nappy-headed ho
in my family. ;-P

BTW, buy their CD, and tell them I sent you. :-)

Cheers!
Rich

Eeyore

unread,
May 23, 2007, 1:19:29 PM5/23/07
to

Rich Grise wrote:

> I've found that anything below -20 dB is inaudible anyway,

Your hearing is shot.

Graham

Rich Grise

unread,
May 23, 2007, 1:24:00 PM5/23/07
to
On Wed, 23 May 2007 09:10:43 -0400, tempus fugit wrote:
>>
>> Suppose you have 14 keys. You have a single 8 bit I/O port.
>
> So by 8 bits you mean a total of 8 pins to connect to (I'm still a bit
> unsure of all the terminology)?
>
>>We will assume that only one key can be pressed at once, otherwise you'll
> have
> a bit more complexity.
>
> This is the case, although it is possible that more than one key may get
> pressed accidentally...
>

I once did a 64-key keyboard scanner with a 6502 - a very nice processor,
as long as you don't push its limits - and I wrote in N-key rollover,
which is really easy to do - just put them into a queue.

And it's true, keystrokes don't need much debouncing. :-)

Of course, if you make an error, you have to correct it, usually by
"backspace". :-)

Cheers!
Rich

Rich Grise

unread,
May 23, 2007, 1:26:24 PM5/23/07
to
On Wed, 23 May 2007 07:11:39 -0700, MooseFET wrote:
>
> If you are willing to use douple pole switches, you can do a bit
> better:
>
> 1 means connected to the switch
> 0 means not connected
...

And you only needed to post the same message fourteen times?

Man, google is getting fucked up.

Thanks,
Rich

Rich Grise

unread,
May 23, 2007, 1:31:30 PM5/23/07
to
On Wed, 23 May 2007 08:59:42 -0400, tempus fugit wrote:
>
>> You have made an error in thinking here. The switch only informs the
>> micro that the switch is closed. The micro knows which group of
>> things to activate for a given switch. This makes the wiring very
>> simple.
>
> I understand that, but do I then need 1 input pin for each switch, and 1 for
> each output? That would mean 15 ins, plus 6 outs. Since I only have 6
> different parameters to control, I was wondering if there was a way to use
> only 6 input pins and 6 outs, plus the 1 extra for the bank switch.

Are you not reading any responses here? People have been explaining
multiplexing for about three days now!

You need ONE output for ANY NUMBER OF ROWS OF SWITCHES, and
ONE INPUT FOR ANY NUMBER OF COLUMNS OF SWITCHES!

Activate one row, and read the state of the columns. If there is an active
input, decode it and put it into your queue. Activate the next row, and
read the state of the columns. If there is an active input, decode it, and
put it into your queue. Activate the NEXT row, read the inputs, and if
one is active, put THAT into your queue. Continue, until you've scanned
all of the rows.

I don't know how much more simply it can be explained, short of actually
doing your homework for you, and I charge $240.00/hour to do that.

Cheers!
Rich

Michael A. Terrell

unread,
May 23, 2007, 2:00:05 PM5/23/07
to
Spehro Pefhany wrote:
>
> On Wed, 23 May 2007 12:42:02 -0400, the renowned "tempus fugit"
> <toc...@quitspammingme.ciaccess.com> wrote:
>
> >>
> >> It's for a *guitar*.
> >
> >ouch that hurts...
>
> You're fingering it wrong, then.


Leave him alone, Sphero. He'll finger it out, sooner or later. ;-)


--
Service to my country? Been there, Done that, and I've got my DD214 to
prove it.
Member of DAV #85.

Michael A. Terrell
Central Florida

Eeyore

unread,
May 23, 2007, 2:11:10 PM5/23/07
to

Rich Grise wrote:

> I don't know how much more simply it can be explained, short of actually
> doing your homework for you, and I charge $240.00/hour to do that.

Who last paid you $240/hour ?

Graham

mpm

unread,
May 23, 2007, 2:33:58 PM5/23/07
to
On May 23, 10:09?am, Eeyore <rabbitsfriendsandrelati...@hotmail.com>
wrote:

> Eeyore wrote:
> > tempus fugit wrote:

> Use the 89S8253 (an update it seems)http://uk.farnell.com/jsp/Semiconductors/Microprocessors+/+Microcontr...

> This programmer should be fine with it too but I'd want to be 100% sure of device support before buying.http://cgi.ebay.co.uk/NSP-Universal-Programmer-Eprom-MCU-PIC-PLD-Flas...

For $26 (US), Digikey sells the Atmel AT89ISP programmer for a USB
port.
You'll still need to connect it to your target board and they suggest
a 10-pin header for that.
- or you can just use temporary wiring. (Pinout is in the
literature.)

The 89S8253 is indeed an upgrade from the '8252.
They added more program memory and in-system programming.
Frankly, given the large number of on-board peripherals, 8K of code
space was a little small for advanced datalogging & reporting
capabilities. The newer '8253 has 12K code space. (50% more room)
Much better now. We actually had one design using the earlier part
that had only 4 or 5 bytes free after optimization. (And those were
probably in the ISR vectors!)

Also, the reason I suggested the '8253 (instead of a more standard
8051) was the '8253 has EEPROM memory on-board. It might be useful to
store setups, etc... Of coruse, you don't have to take advantage of
it, but for the extra thirty cents or so, why not grab it?? And, it's
got 32 I/O ports. (Plenty for the application!)

There are hundreds of micro's to choose from.
The key here, I think, is to get one that's simple and
straightforward.
The learning curve will be steep enough without multiplexing inputs,
outputs, etc...

It's not like the TF's building a million of these..... -mpm

Oh, and I should mention that (at least for us), our 8252 programmer
would not program an 8253.
Not that we would want to, because ISP is so much faster and easier.
Plus, that particular bench-top programmer was (is) a total P-O-S!.

I see the world migrating to USB-type programmers, so I'd personally
shy away from "all-in-one" style EEPROM type programmers. Unless you
buy a good one, they seem to get outdated pretty quickly.

mpm

unread,
May 23, 2007, 2:34:07 PM5/23/07
to
On May 23, 10:09?am, Eeyore <rabbitsfriendsandrelati...@hotmail.com>
wrote:
> Eeyore wrote:
> > tempus fugit wrote:

tempus fugit

unread,
May 23, 2007, 3:10:01 PM5/23/07
to

"Spehro Pefhany" <spef...@interlogDOTyou.knowwhat> wrote in message
news:h01953tsaju0sndo4...@4ax.com...

> On Wed, 23 May 2007 12:42:02 -0400, the renowned "tempus fugit"
> <toc...@quitspammingme.ciaccess.com> wrote:
>
> >>
> >> It's for a *guitar*.
> >
> >ouch that hurts...
>
> You're fingering it wrong, then.
>

ROFL


tempus fugit

unread,
May 23, 2007, 3:17:13 PM5/23/07
to

> Like fet switches ? It's 'charge injection' usually. Jfets don't exhibit
this
> effect like CMOS swiches, although there is another way they can click but
this
> can be reduced by driving them carefully. Do you recall these were the
type I
> originally recommended ?
>
>

I do, and I haven't ruled this out as an option, now that I'm thinking of
redoing everything anyway. When you last gave me that advice, working JFETs
that needed a negative voltage to turn off would've required a lot of
rewiring of my existing design (which is why, if I go to that trouble, I'd
like to have a simper layout).

Thanks

MooseFET

unread,
May 23, 2007, 5:27:16 PM5/23/07
to
On May 23, 10:26 am, Rich Grise <r...@example.net> wrote:
> On Wed, 23 May 2007 07:11:39 -0700, MooseFET wrote:
>
> > If you are willing to use douple pole switches, you can do a bit
> > better:
>
> > 1 means connected to the switch
> > 0 means not connected
>
> ...
>
> And you only needed to post the same message fourteen times?

I only counted 13 times. If it was 14, I'd agree that google is more
screwed up than usual, but since its only 13, its "normal".

tempus fugit

unread,
May 23, 2007, 5:41:33 PM5/23/07
to

">
> Are you not reading any responses here? People have been explaining
> multiplexing for about three days now!
>
> You need ONE output for ANY NUMBER OF ROWS OF SWITCHES, and
> ONE INPUT FOR ANY NUMBER OF COLUMNS OF SWITCHES!
>

I've read each one carefully, and some a number of times actually. Lots of
reading, but I'm still not quite understanding everything yet.

Rich the Newsgroup Wacko

unread,
May 23, 2007, 7:14:58 PM5/23/07
to
On Wed, 23 May 2007 18:00:05 +0000, Michael A. Terrell wrote:
> Spehro Pefhany wrote:
>> On Wed, 23 May 2007 12:42:02 -0400, the renowned "tempus fugit"
>> <toc...@quitspammingme.ciaccess.com> wrote:
>>
>> >> It's for a *guitar*.
>> >
>> >ouch that hurts...
>>
>> You're fingering it wrong, then.
>
> Leave him alone, Sphero. He'll finger it out, sooner or later. ;-)

Twat say? I cunt hear you!


Cheers!
Rich

MooseFET

unread,
May 23, 2007, 9:57:58 PM5/23/07
to
On May 23, 2:41 pm, "tempus fugit"


Draw a bunch of lines on paper, like you are making graph paper.

The vertical lines are wires
The horizontal lines are wires
Every place they cross is a switch.
The wires do not connect to each other other than via a switch.


Eeyore

unread,
May 23, 2007, 10:49:01 PM5/23/07
to

MooseFET wrote:

> "tempus fugit" wrote:
> >
> > I've read each one carefully, and some a number of times actually. Lots of
> > reading, but I'm still not quite understanding everything yet.
>
> Draw a bunch of lines on paper, like you are making graph paper.
>
> The vertical lines are wires
> The horizontal lines are wires
> Every place they cross is a switch.
> The wires do not connect to each other other than via a switch.

Look, he's new to this and frankly his first MCU project doesn't need
keyscanning to save I/O lines and it would likely degrade his background noise
with a nasty buzz.

Graham


MooseFET

unread,
May 24, 2007, 12:02:28 AM5/24/07
to
On May 23, 7:49 pm, Eeyore <rabbitsfriendsandrelati...@hotmail.com>
wrote:

The suggested method I gave elsewhere shows how to do it without a
buzz.

I agree that he really doesn't need scanning. If he was willing to
use double pole switches he could get the higher density without
scanning. If he uses a really good micro like an 8051, he can just
wire the switches straight to the ports as pull downs.

tempus fugit

unread,
May 24, 2007, 8:53:33 AM5/24/07
to

">
> I agree that he really doesn't need scanning. If he was willing to
> use double pole switches he could get the higher density without
> scanning. If he uses a really good micro like an 8051, he can just
> wire the switches straight to the ports as pull downs.
>

Wait a minute....

Is that to say that if i don't use an 8051 I won't be able to wire the
switches straight to the input ports? I was hoping to use the existing
momentary contact switches, connect them straight to the input ports, and
have the input port pulled to ground when I step on the switch, which would
activate that input.

I'm going to look over that wires and switches example you gave me Moose,
and try to make some sense of it (right now no light bulbs are going off),
but, as Graham mentioned, it is my first project with a micro, and I think
I'd be wise to go with a more simple arrangement like the Atmel micro he
suggested. I think this is going to take me a long time to get off the
ground as it is.

Thanks


tempus fugit

unread,
May 24, 2007, 9:16:52 AM5/24/07
to

>
http://atmel.com/dyn/products/product_card.asp?family_id=604&family_name=8051+Architecture&part_id=1919
>
> is inexpensive, easy to use and has 32 general purpose I/O lines anyway.
>

I also found this:
http://www.atmel.com/dyn/resources/prod_documents/2545S.pdf with 23 I/O
which I think would also be enough. So is this basically the same chip as
far as programming goes, except with fewer I/O lines?

MooseFET

unread,
May 24, 2007, 9:23:53 AM5/24/07
to
On May 24, 5:53 am, "tempus fugit"

<tocc...@quitspammingme.ciaccess.com> wrote:
> ">
>
> > I agree that he really doesn't need scanning. If he was willing to
> > use double pole switches he could get the higher density without
> > scanning. If he uses a really good micro like an 8051, he can just
> > wire the switches straight to the ports as pull downs.
>
> Wait a minute....
>
> Is that to say that if i don't use an 8051 I won't be able to wire the
> switches straight to the input ports?

No, that is to say that the 8051 is a wonderful processor and that
nobody in their right mind would ever even consider using anything
else. In other words, I was just lobbing a bomb into the eternal
"which is the best processor" religeous war.

> I was hoping to use the existing
> momentary contact switches, connect them straight to the input ports, and
> have the input port pulled to ground when I step on the switch, which would
> activate that input.

This is the right way to do it. Pulling the pins to ground is the
better way to indicate closed. I believe that this is true even if
you are silly enough to use a PIC. One of the PIC experts will likely
confirm this.

> I'm going to look over that wires and switches example >you gave me Moose,

Don't use the grid of wires. Just use a micro with enough port
connection. You need a port pin for each switch and another for each
output.


> and try to make some sense of it (right now no light bulbs are going off),
> but, as Graham mentioned, it is my first project with a micro, and I think
> I'd be wise to go with a more simple arrangement like the Atmel micro he
> suggested. I think this is going to take me a long time to get off the
> ground as it is.

I would suggest you consider one of the products from www.cygnal.com.
They have a complete PCB with the micro, the development tools and
cables etc for a total of $100.

The Cygnal micros have way more ports than you need. The only down
side to them is that they run on 3V not 5.

There are other good ready made PCBs out there and other good
development kits. You can also get some micros in the 40 pin DIP
version.

The thing you want to avoid is the need to make connections to a small
surface mount part.

I know that the 8051 from Philips is happy if you use wire wrap
construction methods. I even wire wrapped the crystal oscillator
connections ant it worked ok.

There are other processors that have an internal oscillator so this
isn't an issue.


>
> Thanks


Eeyore

unread,
May 24, 2007, 10:00:12 AM5/24/07
to

MooseFET wrote:

> Eeyore wrote:
> > MooseFET wrote:
> > > "tempus fugit" wrote:
> >
> > > > I've read each one carefully, and some a number of times actually. Lots of
> > > > reading, but I'm still not quite understanding everything yet.
> >
> > > Draw a bunch of lines on paper, like you are making graph paper.
> >
> > > The vertical lines are wires
> > > The horizontal lines are wires
> > > Every place they cross is a switch.
> > > The wires do not connect to each other other than via a switch.
> >
> > Look, he's new to this and frankly his first MCU project doesn't need
> > keyscanning to save I/O lines and it would likely degrade his background noise
> > with a nasty buzz.
>
> The suggested method I gave elsewhere shows how to do it without a
> buzz.

It looks like I missed that one. I'm curious how that can work though.


> I agree that he really doesn't need scanning. If he was willing to
> use double pole switches he could get the higher density without
> scanning. If he uses a really good micro like an 8051, he can just
> wire the switches straight to the ports as pull downs.

That's exactly what I do. To save passives if you use ports that have pull-ups built
in you'll even save (primarily the space of) any external resistors.

Graham


Eeyore

unread,
May 24, 2007, 10:12:44 AM5/24/07
to

tempus fugit wrote:

> " I agree that he really doesn't need scanning. If he was willing to
> > use double pole switches he could get the higher density without
> > scanning. If he uses a really good micro like an 8051, he can just
> > wire the switches straight to the ports as pull downs.
>
>
> Wait a minute....
>
> Is that to say that if i don't use an 8051 I won't be able to wire the
> switches straight to the input ports?

No.

You can save adding any external resistors for the control switches if you
connect them to any MCU input that has an internal pull-up. There are plenty of
these on an 8051 family part (check the datasheet to see which ports they are -
some of them may require suitable configuiring in the special function registers
IIRC).

Doubtless other MCUs work like this too but I do very much think a part like the
89S8253 (an 8051 derivative) would be ideal for you.

Graham

Eeyore

unread,
May 24, 2007, 10:18:21 AM5/24/07
to

tempus fugit wrote:

That's an AVR. It's an Atmel specific design AIUI. A different architecture entirely from an 8051 family
part.

The nice thing about 8051 derivatives is that they are sourced by multiple manufacturers with all manner of
various onboard 'goodies' and are also available as 'tiny' parts with limited I/O and memory for
applications that simply want something cheap. It's a good device to learn on. Plus the device is so mature
that you should never be troubled by any undocumented bugs. Additionally there's a truly vast amount of
support and application info for the beast.

Graham


Spehro Pefhany

unread,
May 24, 2007, 11:18:56 AM5/24/07
to

Wiring switches directly to I/O ports is a really bad idea. At least
put some series resistance in there. Then you have to consider the
3:1~10:1 range of typical pull-up current sources.

Eeyore

unread,
May 24, 2007, 10:23:09 AM5/24/07
to

Spehro Pefhany wrote:

> Eeyore wrote:
> >MooseFET wrote:
> >
> >> I agree that he really doesn't need scanning. If he was willing to
> >> use double pole switches he could get the higher density without
> >> scanning. If he uses a really good micro like an 8051, he can just
> >> wire the switches straight to the ports as pull downs.
> >
> >That's exactly what I do. To save passives if you use ports that have pull-ups built
> >in you'll even save (primarily the space of) any external resistors.
>
>

> Wiring switches directly to I/O ports is a really bad idea.

Why so ? They're simply pulling to ground. There's no external connection to worry about
here.

I've lost count of how many tens of thousands of products doing exactly this must have
been made for Studiomaster. Problems, zero.

Graham

MooseFET

unread,
May 24, 2007, 10:23:40 AM5/24/07
to
On May 24, 7:00 am, Eeyore
[...]

> > The suggested method I gave elsewhere shows how to do it without a
> > buzz.
>
> It looks like I missed that one. I'm curious how that can work though.

Until a key is pressed, the entire Column port is held low. Pressing
any key will pull a Row signal low. When a key is pressed, the Column
port is taken through the log2(N) states needed to discover which key
it is.

Spehro Pefhany

unread,
May 24, 2007, 11:44:04 AM5/24/07
to
On Thu, 24 May 2007 14:23:09 GMT, the renowned Eeyore
<rabbitsfriend...@hotmail.com> wrote:

>
>
>Spehro Pefhany wrote:
>
>> Eeyore wrote:
>> >MooseFET wrote:
>> >
>> >> I agree that he really doesn't need scanning. If he was willing to
>> >> use double pole switches he could get the higher density without
>> >> scanning. If he uses a really good micro like an 8051, he can just
>> >> wire the switches straight to the ports as pull downs.
>> >
>> >That's exactly what I do. To save passives if you use ports that have pull-ups built
>> >in you'll even save (primarily the space of) any external resistors.
>>
>>
>> Wiring switches directly to I/O ports is a really bad idea.
>
>Why so ? They're simply pulling to ground. There's no external connection to worry about
>here.

Any kind of ESD through the switch that that doesn't get shunted to
ground can cause a CMOS processor to latch up, and likely die. There
will be fingers on the switches, and static electricity. A 0.1 cent
resistor is cheap insurance. Same deal if there is a difference
between ground potentials, for example caused by a motor-driven volume
control pot).

>I've lost count of how many tens of thousands of products doing exactly this must have
>been made for Studiomaster. Problems, zero.
>
>Graham

Maybe they were properly designed taking into account ESD, or maybe
they were lucky that the design turned out to be okay, or maybe they
didn't analyze the failures.

Eeyore

unread,
May 24, 2007, 11:02:27 AM5/24/07
to

Spehro Pefhany wrote:

> Eeyore wrote:


> >Spehro Pefhany wrote:
> >
> >> Wiring switches directly to I/O ports is a really bad idea.
> >
> >Why so ? They're simply pulling to ground. There's no external connection to >worry about
> here.
>
> Any kind of ESD through the switch that that doesn't get shunted to
> ground can cause a CMOS processor to latch up, and likely die. There
> will be fingers on the switches, and static electricity. A 0.1 cent
> resistor is cheap insurance. Same deal if there is a difference
> between ground potentials, for example caused by a motor-driven volume
> control pot).

There's no practical path for ESD between say a TACT type switch with its mounded on keytop
and the internal circuitry. If someone's sufficiently charged with statis for it find a apth,
a little ressitor isn't going to save anything !


> >I've lost count of how many tens of thousands of products doing exactly this must >have
> been made for Studiomaster. Problems, zero.
>
>

> Maybe they were properly designed

By me !


> taking into account ESD, or maybe they were lucky that the design turned out to be okay, or
> maybe they didn't analyze the failures.

Where's the ESD path ?

It's this kind of switch......
http://uk.farnell.com/jsp/Electrical/Switches+&+Accessories/ITT+CANNON/D6C90LFS/displayProduct.jsp?sku=1201367

The keytop is located in an aperture in a grounded steel panel.


Graham

krw

unread,
May 24, 2007, 11:11:27 AM5/24/07
to
In article <46559AAC...@hotmail.com>,
rabbitsfriend...@hotmail.com says...

>
>
> MooseFET wrote:
>
> > Eeyore wrote:
> > > MooseFET wrote:
> > > > "tempus fugit" wrote:
> > >
> > > > > I've read each one carefully, and some a number of times actually. Lots of
> > > > > reading, but I'm still not quite understanding everything yet.
> > >
> > > > Draw a bunch of lines on paper, like you are making graph paper.
> > >
> > > > The vertical lines are wires
> > > > The horizontal lines are wires
> > > > Every place they cross is a switch.
> > > > The wires do not connect to each other other than via a switch.
> > >
> > > Look, he's new to this and frankly his first MCU project doesn't need
> > > keyscanning to save I/O lines and it would likely degrade his background noise
> > > with a nasty buzz.
> >
> > The suggested method I gave elsewhere shows how to do it without a
> > buzz.
>
> It looks like I missed that one. I'm curious how that can work though.

It's done all the time without problems. My receivers have
multiplexed switch matrix front panels. If you really think it's a
problem, simply use an even number of rows and columns in your
matrix. Always drive an equal number in opposite directions,
simulating a differential pair. Filter/slow edges, if need be. This
really isn't difficult.


>
> > I agree that he really doesn't need scanning. If he was willing to
> > use double pole switches he could get the higher density without
> > scanning. If he uses a really good micro like an 8051, he can just
> > wire the switches straight to the ports as pull downs.
>
> That's exactly what I do. To save passives if you use ports that have pull-ups built
> in you'll even save (primarily the space of) any external resistors.

That's great if your I/O is free or you have only one switch. The
real world ain't often like that.

--
Keith

Mike Monett

unread,
May 24, 2007, 11:37:43 AM5/24/07
to

Spehro Pefhany <spef...@interlogDOTyou.knowwhat> wrote:

> Any kind of ESD through the switch that that doesn't get shunted
> to ground can cause a CMOS processor to latch up, and likely die.
> There will be fingers on the switches, and static electricity. A
> 0.1 cent resistor is cheap insurance.

Latchup is a serious issue, especially with some Analog Devices ics
where they fail to warn you the chip is sensitive and will die, like
some of their DDS chips. So now I use a buffer like a 74LS04 or
2N2222 inverter between the chip and the outside world.

ESD is a big problem, even with parts that are rated for body or
machine discharge. You can always find a discharge that is larger.
For example, walking across a carpet in Colorado in the winter can
easily generate 1 inch sparks.

The voltage is high enough, so wouldn't it simply arc over a small
smd part? What kind of resistor would solve that problem?

[...]

> Best regards,
> Spehro Pefhany

Regards,

Mike Monett

Rich Grise

unread,
May 24, 2007, 12:34:25 PM5/24/07
to
On Thu, 24 May 2007 08:53:33 -0400, tempus fugit wrote:
> ">
>> I agree that he really doesn't need scanning. If he was willing to
>> use double pole switches he could get the higher density without
>> scanning. If he uses a really good micro like an 8051, he can just
>> wire the switches straight to the ports as pull downs.
>
> Wait a minute....
>
> Is that to say that if i don't use an 8051 I won't be able to wire the
> switches straight to the input ports?

No. ANY processor with enough input ports can read the switches directly.

Even an FPGA or CPLD. ;-)

Since you seem to have trouble "getting" how to scan switches, then just
find any processor that has enough inputs, from a manufacturer that
offers some kind of introductory starter/trainer kit. That's the other
thing that the uP lovers fail to mention - the cost of just getting
started, and the time it will take to familiarize yourself with its
programming language. I've heard good things about the "BASIC Stamp",
but haven't used one, so can't comment one way or the other. My favorite
was the 68HC11, which seems to have died on the vine. )-;

Good Luck!
Rich

Rich Grise

unread,
May 24, 2007, 12:37:14 PM5/24/07
to
On Thu, 24 May 2007 06:23:53 -0700, MooseFET wrote:

> I know that the 8051 from Philips is happy if you use wire wrap
> construction methods. I even wire wrapped the crystal oscillator
> connections ant it worked ok.

Wire wrap? Are you H.G.Wells, or what? ;-)

Cheers!
Rich

Eeyore

unread,
May 24, 2007, 12:41:42 PM5/24/07
to

Rich Grise wrote:

> MooseFET wrote:
>
> > I know that the 8051 from Philips is happy if you use wire wrap
> > construction methods. I even wire wrapped the crystal oscillator
> > connections ant it worked ok.
>
> Wire wrap? Are you H.G.Wells, or what? ;-)

My own first expereinces with 8051 were also wire-wrapped ! We got some of the
very first examples of the real 80C31 MCU in CMOS too. That helped a fair bit
with our power budget.

Graham

tempus fugit

unread,
May 24, 2007, 1:15:22 PM5/24/07
to
just
> find any processor that has enough inputs, from a manufacturer that
> offers some kind of introductory starter/trainer kit. That's the other
> thing that the uP lovers fail to mention - the cost of just getting
> started, and the time it will take


Right, that was going to be my next question. I've looked at the parts that
have been mentioned here, but I've got to find someone who will ship to
Canada without a ridiculous minimum order. Newark has the Atmel IC listed,
but it isn't in stock atm, and has a 99 day lead time (!?). Mouser doesn't
appear to have anything, and DigiKey, well - there's that minimum order
problem again.

I also found this http://www.hvwtech.com/products_view.asp?ProductID=370
which i can get here, but don't know much about PICs, and I guess I'd need
to figure out what else I'd need (and how much it'd cost) to program it.
There does seem to be a fair amount of resources on the web for PICs
anyway....


Spehro Pefhany

unread,
May 24, 2007, 3:12:18 PM5/24/07
to
On Thu, 24 May 2007 15:37:43 +0000, the renowned Mike Monett
<N...@email.adr> wrote:

>
> Spehro Pefhany <spef...@interlogDOTyou.knowwhat> wrote:
>
> > Any kind of ESD through the switch that that doesn't get shunted
> > to ground can cause a CMOS processor to latch up, and likely die.
> > There will be fingers on the switches, and static electricity. A
> > 0.1 cent resistor is cheap insurance.
>
> Latchup is a serious issue, especially with some Analog Devices ics
> where they fail to warn you the chip is sensitive and will die, like
> some of their DDS chips. So now I use a buffer like a 74LS04 or
> 2N2222 inverter between the chip and the outside world.

Connecting a CMOS IC pin directly the outside world is pretty much
inviting trouble to your doorstep, IME. There's really no reliable
spec AFAIK, but parts with robust output drive seem to do better than
parts with wimpy output drive.

> ESD is a big problem, even with parts that are rated for body or
> machine discharge. You can always find a discharge that is larger.
> For example, walking across a carpet in Colorado in the winter can
> easily generate 1 inch sparks.
>
> The voltage is high enough, so wouldn't it simply arc over a small
> smd part? What kind of resistor would solve that problem?

Yes it would, but if it arcs from A to B (where B is not an IC pin)
and then you have a series impedance to the pin from A, you've limited
the current and the energy. It's like lightning, you can't stop it
from happening, and you can't control the amount of energy, but you
can hopefully force it to take an alternate path and prevent damage
when it does take that path, at least up to a reasonable energy level.

Most of the stuff you do to make the micro immune to RF and ESD also
works to reduce the noise emitted by the circuit.

Eeyore

unread,
May 24, 2007, 2:16:45 PM5/24/07
to

tempus fugit wrote:

> just
> > find any processor that has enough inputs, from a manufacturer that
> > offers some kind of introductory starter/trainer kit. That's the other
> > thing that the uP lovers fail to mention - the cost of just getting
> > started, and the time it will take
>
> Right, that was going to be my next question. I've looked at the parts that
> have been mentioned here, but I've got to find someone who will ship to
> Canada without a ridiculous minimum order. Newark has the Atmel IC listed,
> but it isn't in stock atm, and has a 99 day lead time (!?). Mouser doesn't
> appear to have anything, and DigiKey, well - there's that minimum order
> problem again.

Well..... Atmel has a 'buy from from distribution' link on their site and Arrow
will certainly deliver to Canada but you'd have to check out the cost.

Then again there's ebay ! The 89C52 should do the job IIRC.
http://cgi.ebay.com/5-x-ATMEL-89C52-Microcontroller-DIP-40-Cleaned-Erased_W0QQitemZ230131553512QQihZ013QQcategoryZ50915QQrdZ1QQcmdZViewItem

5 of them for $18 !

But then again there's this !

http://cgi.ebay.com/Burner-Free-8051-8052-Microcontroller-Evaluation-Board_W0QQitemZ250117639741QQihZ015QQcategoryZ50915QQrdZ1QQcmdZViewItem

It looks perfect for your needs. I'd ask if they can supply a suitable chip
althoiugh if it'll program the Philips 89C51, I'd expect it to do the above
Atmel 89C52 as well


> I also found this http://www.hvwtech.com/products_view.asp?ProductID=370
> which i can get here, but don't know much about PICs

I can't help you there either.

Graham

Mike Monett

unread,
May 24, 2007, 3:18:37 PM5/24/07
to
Spehro Pefhany <spef...@interlogDOTyou.knowwhat> wrote:

[...]

>> For example, walking across a carpet in Colorado in the winter can
>> easily generate 1 inch sparks.
>>
>> The voltage is high enough, so wouldn't it simply arc over a small
>> smd part? What kind of resistor would solve that problem?
>
> Yes it would, but if it arcs from A to B (where B is not an IC pin)
> and then you have a series impedance to the pin from A, you've limited
> the current and the energy. It's like lightning, you can't stop it
> from happening, and you can't control the amount of energy, but you
> can hopefully force it to take an alternate path and prevent damage
> when it does take that path, at least up to a reasonable energy level.
>
> Most of the stuff you do to make the micro immune to RF and ESD also
> works to reduce the noise emitted by the circuit.

> Best regards,
> Spehro Pefhany

Well, if you can get it to survive a Colorado winter, my hat's off to you:)

Regards,

Mike Monett

It is loading more messages.
0 new messages