Searching \ for 'multiple 4x4 keypads to 16f877 or 18f452?' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=16F
Search entire site for: 'multiple 4x4 keypads to 16f877 or 18f452?'.

Truncated match.
PICList Thread
'multiple 4x4 keypads to 16f877 or 18f452?'
2004\08\22@171509 by iain duncan

picon face
I am a newbie to pics and electronics, though I have no problems with
assembly programming. I get much more confused by what's going on
outside the pic. I would like to interface four 4x4 keypads to one chip
that will also do midi output, which i guess means multiplexing of some
sort, is this likely to be a terribly difficult project? Can anyone tell
me what other parts I will need to get more than one keypad into the
pic, or point me at any good resources for this? Is there anyone on here
who might have made a keypad-to-midi controller?

Also, will it be possible in such a situation to write the firmware so
that it can accept multiple simultaneous keypresses across the pads, or
is that reall hard?

Thanks
iain

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spam_OUTlistservTakeThisOuTspammitvma.mit.edu with SET PICList DIGEST in the body

2004\08\22@183814 by Byron A Jeff

face picon face
On Sun, Aug 22, 2004 at 02:01:35PM +0000, iain duncan wrote:
> I am a newbie to pics and electronics, though I have no problems with
> assembly programming.

As I always say, learn PIC assembly so you can converse with folks, then
look to higher level languages.

> I get much more confused by what's going on
> outside the pic. I would like to interface four 4x4 keypads to one chip
> that will also do midi output, which i guess means multiplexing of some
> sort,

It does.

> is this likely to be a terribly difficult project?

Not really. It'll require some external hardware I'd guess off the top of my
head.

>Can anyone tell
> me what other parts I will need to get more than one keypad into the
> pic, or point me at any good resources for this? Is there anyone on here
> who might have made a keypad-to-midi controller?

It'll be an interesting device for sure.

>
> Also, will it be possible in such a situation to write the firmware so
> that it can accept multiple simultaneous keypresses across the pads, or
> is that reall hard?

That'll make it harder.

OK let's talk about organization. You can organize your keypads in 3
configurations:

1) 4 individual keypads.
2) A single 8x8 keypad.
3) A single 4x16 keypad.

Each will require a different amount of I/O

1) The 4 individual keypads would require 32 I/O lines
2) The 8x8 would require 16 I/O lines.
3) The 4x16 would require 20 I/O lines.

In each case a decoder and/or multiplexer can be used to reduce the lines to
the corresponding power of 2. So for the cost of a chip, you can greatly
reduce the number of lines required.

Personally I'd organize in the 8x8 wiring the 4 keypads in a square. Then
I'd drive the rows with the outputs of a 74HC138 decoder, and read the outputs
from the columns using a 74HC151 multiplexer. It'll take 7 PIC I/O pins to do
the job: 3 to drive the HC138, 3 to drive the HC151, and one input to read the
HC151.

BAJ

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email .....listservKILLspamspam@spam@mitvma.mit.edu with SET PICList DIGEST in the body

2004\08\22@194818 by Vern Jones

flavicon
face
Hello Iain,

Pronanly not as difficult as you might think. I have several different types
of MIDI encoders. Some as kits.

I can provide DIY MIDI encoders and decoders. Perhaps even some Code.

Vern, http://www.sound-research.net
{Original Message removed}

2004\08\22@221610 by Denny Esterline

picon face
> Personally I'd organize in the 8x8 wiring the 4 keypads in a square. Then
> I'd drive the rows with the outputs of a 74HC138 decoder, and read the
outputs
> from the columns using a 74HC151 multiplexer. It'll take 7 PIC I/O pins
to do
> the job: 3 to drive the HC138, 3 to drive the HC151, and one input to
read the
> HC151.
>
> BAJ
>


Really? I'd have thought an 8x8 square with no external parts. Drive the
rows with portD and read the columns with portB interrupt on change. I'm
not familiar with MIDI, but certainly I'd have thought the other 17 IO
lines would be enough to implement it.

As others are fond of saying "engineering is the art of compromise"

-Denny

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservspamKILLspammitvma.mit.edu with SET PICList DIGEST in the body

2004\08\23@054904 by Howard Winter

face
flavicon
picon face
On Sun, 22 Aug 2004 22:18:02 -0400, Denny Esterline wrote:

> > I'd drive the rows with the outputs of a 74HC138 decoder, and read the
outputs
> > from the columns using a 74HC151 multiplexer. It'll take 7 PIC I/O pins to do
> > the job: 3 to drive the HC138, 3 to drive the HC151, and one input to
> > read the HC151.
> >
> > BAJ
>
> Really? I'd have thought an 8x8 square with no external parts. Drive the
> rows with portD and read the columns with portB interrupt on change.

I'm not sure either technique allows for multiple simultaneous key depressions, which was mentioned by the OP.
As far as I can see, any simple x-y matrix will give ambiguity if two non-orthogonal keys are pressed at once.
I wonder if a keyboard controller chip (I know they exist, I just don't know any!) would be the answer, since
n-key rollover is part of what they do.

>  I'm not familiar with MIDI, but certainly I'd have thought the other 17 IO
> lines would be enough to implement it.

MIDI is basically serial I/O with a tightly-defined format specification.  I believe you can do it with 1
input and 1 output (there may be a clock too - can't remember) but half of a PIC I/O port is plenty.  It may
even be possible to use a UART on PICs that have it.

> As others are fond of saying "engineering is the art of compromise"

Indeed!  Any engineering that's straightforward with one obvious solution isn't really worth the name  :-)

Cheers,


Howard Winter
St.Albans, England

--
http://www.piclist.com hint: To leave the PICList
.....piclist-unsubscribe-requestKILLspamspam.....mitvma.mit.edu

2004\08\23@081048 by Kevin

flavicon
face
>On Mon, 23 Aug 2004, Howard Winter wrote:
> I'm not sure either technique allows for multiple simultaneous key depressions, which was mentioned by the OP.
> As far as I can see, any simple x-y matrix will give ambiguity if two non-orthogonal keys are pressed at once.
> I wonder if a keyboard controller chip (I know they exist, I just don't know any!) would be the answer, since
> n-key rollover is part of what they do.

How about a keyboard controller chip made from a picf84
Try Tony Kubeks
www.piclist.com/techref/microchip/picboard.htm
I was able to make a 4x4 keypad talk to an IBM PC with
Tony's project and Fr. Tom's Keypad Project both with full
source and fully commented.
http://www.drzyzgula.org/bob/electronics/frtom.shtml

That was my first pic project after blinking a led :)
I was able to enter a two digit hex character and have the
F84 talk to the ps2 keyboard port on the pc and produce any
key character I wanted from a look up table.

~Kevin

--
http://www.piclist.com hint: To leave the PICList
EraseMEpiclist-unsubscribe-requestspam_OUTspamTakeThisOuTmitvma.mit.edu

2004\08\23@081049 by Bob Ammerman

picon face
MIDI in and out work fine on a traditional UART. The baud rate is 31 250,
which works out perfectly when using an crystal that is an exact number of
MHz (as opposed to some funny number).

However, rather than using conventional RS232 levels, proper MIDI uses an
opto-isolated connection.

Bob Ammerman
RAm Systems

> >  I'm not familiar with MIDI, but certainly I'd have thought the other 17
IO
> > lines would be enough to implement it.
>
> MIDI is basically serial I/O with a tightly-defined format specification.
I believe you can do it with 1
> input and 1 output (there may be a clock too - can't remember) but half of
a PIC I/O port is plenty.  It may
> even be possible to use a UART on PICs that have it.

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestspamspam_OUTmitvma.mit.edu

2004\08\23@134018 by Vern Jones

flavicon
face
Hello Iain,

There are different kinds of MIDI events. For keyboaed use it needs to scan
multiple keys. Keeping in mind it is possible for 10 fingers to play more
than 10 notes. The scan rate needs to be fast enough to keep up with a
player without noticable delay. A PIC chip can do this. For other controls,
one can use the same keys as Patch control and other controllers like
Sustain pedal by using other PIC pins to control the mode of the input keys,
or extend the matrix past the keyboard range, and assign those scan points
to controller inputs. MIDI, unlike computer keyboards needs to be able to
handle multiple input scan points simultaniously.

Using a PIC with analog inputs, allows for continuos controllers.

After doing the learning exercises for using the pic, also download a copy
of the MIDI specification at:
http://www.borg.com/~jglatt/tech/midispec.htm

For a site dedicated to the DIYs there is: http://www.ucapps.de/ . This site
is run by Thorsten Klose. He has released most of the software to the
public. There is Source code and Hex code with lots of discussion about the
applications as well as discussion groups. So both of these sites have good
data. If you are interested in specific types of controllers, send me a
private E-Mail, and I'll try to answer your questions.

Musically yours,

Vern Jones, @spam@vernjonesKILLspamspamsound-research.net

{Original Message removed}

2004\08\23@134846 by iain duncan

picon face
Bob Ammerman wrote:
> MIDI in and out work fine on a traditional UART. The baud rate is 31 250,
> which works out perfectly when using an crystal that is an exact number of
> MHz (as opposed to some funny number).
>
> However, rather than using conventional RS232 levels, proper MIDI uses an
> opto-isolated connection.

Bob, what's the deal with the opto-isolation? I've noticed some examples
on line have it, some don't. Do I *need* to include opto-isolation to
just get simple output, or is there some other way? And why is
necessary, ie why can't I just bring down the voltage level on the pins
to acceptable midi range using diodes or what not? ( Am very much a
beginner with electornics. I am more scared of external chips than I am
of bit banging serial i/o myself, ha ha. )

Iain

--
http://www.piclist.com hint: To leave the PICList
KILLspampiclist-unsubscribe-requestKILLspamspammitvma.mit.edu

2004\08\23@144207 by Vern Jones

flavicon
face
Hello Iain,

The MIDI outputs are not opto isolated, but the MIDI inputs are. From the
MIDI OUTPUT pin connect a 220 to 270 ohm resistor to pin 5 of the female DIN
output connector, and a 220 Ohm resistor from PIN 4 of the din output
connector to +5 Volts. This will interface to any standard MIDI cable and
MIDI instrument.

The PIC can drive the MIDI out just fine...connect PIN 2 of the DIN
connector to ground.

On my website see the MIDI encoder sections, some of the encoders also have
data sheets in .pdf format. Just click on technical information (Gree
highlight) to down load. The PEDMUX series, abe about as simple as you can
get with a MIDI encoder.

Vern
{Original Message removed}

2004\08\23@163725 by Bob Ammerman

picon face
The optical isolation is intended to eliminate any problems with the various
devices in the midi chain having different ground potentials.

Bob Ammerman
RAm Systems

{Original Message removed}

More... (looser matching)
- Last day of these posts
- In 2004 , 2005 only
- Today
- New search...