Maker Pro
Maker Pro

Can I do this with a uProcessor?

T

tempus fugit

Jan 1, 1970
0
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
 
S

Spehro Pefhany

Jan 1, 1970
0
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
 
M

MooseFET

Jan 1, 1970
0
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.
 
E

Eeyore

Jan 1, 1970
0
tempus said:
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?

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
 
T

tempus fugit

Jan 1, 1970
0
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).

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.

activate a

Opps make the 15 port lines.


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.
 
D

Don Lancaster

Jan 1, 1970
0
tempus said:
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
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: [email protected]

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

Gary Tait

Jan 1, 1970
0
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.
 
E

Eeyore

Jan 1, 1970
0
Don said:
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
 
T

tempus fugit

Jan 1, 1970
0
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
 
E

Eeyore

Jan 1, 1970
0
tempus said:
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.

Graham
 
T

tempus fugit

Jan 1, 1970
0
Eeyore said:
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


I get it now.

Thanks Graham
 
T

tempus fugit

Jan 1, 1970
0
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
 
R

Rich Grise

Jan 1, 1970
0
I'm not familiar with this. What do you mean by scan them at 500Hz?

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
 
M

MooseFET

Jan 1, 1970
0
On May 21, 7:52 am, "tempus fugit"
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.
 
T

tempus fugit

Jan 1, 1970
0
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.

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
 
E

Eeyore

Jan 1, 1970
0
Rich said:
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.

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

Graham
 
Top