Exact match. Not showing close matches.
PICList
Thread
'[PIC] Re: multiple 4x4 keypads to 16f877 or 18f452'
2004\08\22@202105
by
iain duncan
|
First I'd like to apologize for not putting [PIC] in the subject. I
thought it got there automatically, won't happen again.
> As I always say, learn PIC assembly so you can converse with folks, then
> look to higher level languages.
Yup, I'm doing that. I have the Predko book and the Katzen book.
Actually I like the assembly part. The hard part for me is that the PIC
books naturally assume that you've already done a fair bit of
electronics. ; )
>>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.
If I get it working properly I'll put the design online. The nice part
is that I just scored 20 free keypads by asking around, and someone had
tons of old credit scanners with a 4x4 keypad.
>>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.
For a controller, it would make it more useful, but I suppose I can live
without that feature until it works at least.
{Quote hidden}> 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.
Thanks so much for the tips. If anyone knows of an example of the above
somewhere, preferably both assembly and schematics, that would be lovely.
Thanks
Iain
--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spam_OUTlistservTakeThisOuT
mitvma.mit.edu with SET PICList DIGEST in the body
2004\08\23@025202
by
iain duncan
> 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"
For midi ouput I think I need only one data pin, maybe an extra for
control so that's no biggy. But can I take stock 4x4 keypads and wire
them up 8x8? Problem is, I've never actually wired up a keypad. So while
I want it to be efficient, I'd rather use a less confusing set up then
anything else. Pin efficiency aside, what would be the most beginner
friendly?
Thanks
Iain
--
http://www.piclist.com hint: To leave the PICList
.....piclist-unsubscribe-requestKILLspam
@spam@mitvma.mit.edu
2004\08\23@032733
by
Vern Jones
Hello Iain.
You probably can, with the use of isolation diodes. 4 sets of 4 x 4 are
possible, as well as 1 set of 8x8 foa a MIDI keyboard. I have 1 system with
8x8x4 (256 scan points) digital input matrix and 6x8 (48 Scan points) analog
matrix. This is using a 16F877.
So it can be done. There are lots of examples in the books for 4x4. Start
there and then expand the software after you understand it. Then take the
results and send them to a serial output. Then learn how to format the data
for MIDI.
Use a 4Mhz, 10Mhz or 20Mhz crystal. The MIDI Baud rate will be right on the
money, if you have performed the math correctly for the baud rate. If you
use a 16F628 or 16F8xx, then the PIC chip has a built in USART, making it a
little easier to send MIDI data.
Take each exercise 1 at a time, and in a short period of time you will have
a complete project.
Vern, Sound Research
{Original Message removed}
2004\08\23@052745
by
Denny Esterline
|
> > 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
{Quote hidden}> > 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"
>
> For midi ouput I think I need only one data pin, maybe an extra for
> control so that's no biggy. But can I take stock 4x4 keypads and wire
> them up 8x8? Problem is, I've never actually wired up a keypad. So while
> I want it to be efficient, I'd rather use a less confusing set up then
> anything else. Pin efficiency aside, what would be the most beginner
> friendly?
>
Well, I'm only guessing about how your keypads are arranged, but the
typical matrix arrangement will have one line for each column and one line
for each row:
| | | |
-------+------+------+------+
| | | |
| | | |
| | | |
-------+------+------+------+
| | | |
| | | |
| | | |
-------+------+------+------+
| | | |
| | | |
| | | |
-------+------+------+------+
Generally you set this up where the rows are hooked to input pins and have
pull up resistors. Then you cycle through the columns pulling them low one
at a time and checking for lows on the row inputs. (indicating a button
pressed) (you could also hook it up the other way, with the rows as scanned
outputs and the columns as inputs, but you get the idea :-)
Seems easy enough to connect several keypads together to build a larger
matrix, yes?
As for beginner friendly, I cannot stress this enough, start small and add
to it. Start with blinking an led, then go to four leds - hey that looks
like scanning the keypad ;o) Building blocks, just add one piece at a time.
Good luck
-Denny
--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-request
KILLspammitvma.mit.edu
2004\08\23@134436
by
iain duncan
> As for beginner friendly, I cannot stress this enough, start small and add
> to it. Start with blinking an led, then go to four leds - hey that looks
> like scanning the keypad ;o) Building blocks, just add one piece at a time.
Thanks for the tips. Don't worry, I'm not totally crazy! I've already
done some simple projects that are up to counting up on an 8 seg led
display with a button triggering a count reset via an interrupt. And
before adding the keypads, I plan on doing button sending midi output of
a note on or something equally simple. = )
Thanks.
--
http://www.piclist.com hint: To leave the PICList
.....piclist-unsubscribe-requestKILLspam
.....mitvma.mit.edu
2004\08\23@190823
by
Carey Fisher - NCS
>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.
Why don't you use 4 A/D channels where each A/D channel reads a whole 4x4
keypad? I've completed a project with a PIC18F452 where I read 8 switches
with one A/D pin. It's not hard. If interested, I send you a schematic...
Carey Fisher, K8VZ
website: http://www.ncsradio.com
--
http://www.piclist.com hint: To leave the PICList
EraseMEpiclist-unsubscribe-requestspam_OUT
TakeThisOuTmitvma.mit.edu
2004\08\23@221210
by
Byron A Jeff
On Mon, Aug 23, 2004 at 07:07:43PM -0400, Carey Fisher - NCS wrote:
> >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.
>
> Why don't you use 4 A/D channels where each A/D channel reads a whole 4x4
> keypad? I've completed a project with a PIC18F452 where I read 8 switches
> with one A/D pin. It's not hard. If interested, I send you a schematic...
Interesting idea. I presume that you tie different valued resistors across
the switches? That way you get a different voltage when the switch is pressed
as opposed to released?
But on a 4x4 how do you keep the different rows/cols from interacting. I
can see this for a single string of switches. But wouldn't pressing multiple
switches on a pad possible impact one another?
BAJ
--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-request
spam_OUTmitvma.mit.edu
2004\08\24@082647
by
Carey Fisher - NCS
> >
> > Why don't you use 4 A/D channels where each A/D channel
> reads a whole 4x4
> > keypad? I've completed a project with a PIC18F452 where I
> read 8 switches
> > with one A/D pin. It's not hard. If interested, I send you
> a schematic...
>
> Interesting idea. I presume that you tie different valued
> resistors across
> the switches? That way you get a different voltage when the
> switch is pressed
> as opposed to released?
You basically set up a voltage divider. There are two (at least) ways to
configure it. In my configuration, with no button pressed, the voltage at
the A/D pin is the middle connection of a two resistor voltage divider. The
top resistor is tied to +5V. Then, each switch ties the lower resistor of a
voltage divider to ground. This requires a different value resistor for
each switch but allows you to detect multiple switch closures. See below:
+5
|
.-.
| |
| |
'-'
|
|
|
|----|----|--- to A/D
| |
.-. .-.
| | | |
| | | |
'-' '-'
| |
| |
\ o \ o
\ \
\. \.
o o
| |
| |
=== ===
GND GND
created by Andy?s ASCII-Circuit v1.24.140803 Beta http://www.tech-chat.de
>
> But on a 4x4 how do you keep the different rows/cols from
> interacting. I
> can see this for a single string of switches. But wouldn't
> pressing multiple
> switches on a pad possible impact one another?
>
> BAJ
You have to choose the configuration and the resistor values so that
multiple button pushes yield an invalid resistance (voltage) value. I
haven't sat down and worked this out - maybe I will when I get a few
minutes - but I think it should be possible.
Carey Fisher
--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads
2004\08\24@083930
by
Carey Fisher - NCS
> >
> > Interesting idea. I presume that you tie different valued
> > resistors across
> > the switches? That way you get a different voltage when the
> > switch is pressed
> > as opposed to released?
>
> You basically set up a voltage divider. There are two (at
> least) ways to
> configure it. In my configuration, with no button pressed,
> the voltage at
> the A/D pin is the middle connection of a two resistor voltage
> divider. The
> top resistor is tied to +5V. Then, each switch ties the lower
> resistor of a
> voltage divider to ground. This requires a different value
> resistor for
> each switch but allows you to detect multiple switch closures.
> See below:
>
>
>
> +5
> |
> .-.
> | |
> | |
> '-'
> |
> |
> |
> |----|----|--- to A/D
> | |
> .-. .-.
> | | | |
> | | | |
> '-' '-'
> | |
> | |
> \ o \ o
> \ \
> \. \.
> o o
> | |
> | |
> === ===
> GND GND
> created by Andy?s ASCII-Circuit v1.24.140803 Beta http://www.tech-chat.de
>
> >
> > But on a 4x4 how do you keep the different rows/cols from
> > interacting. I
> > can see this for a single string of switches. But wouldn't
> > pressing multiple
> > switches on a pad possible impact one another?
> >
> > BAJ
>
>
> You have to choose the configuration and the resistor values so that
> multiple button pushes yield an invalid resistance (voltage) value. I
> haven't sat down and worked this out - maybe I will when I get a few
> minutes - but I think it should be possible.
>
> Carey Fisher
Sorry... that was the wrong configuration, what I'm actually using is below:
This eliminates problems with multi-switch closure - only the top-most
switch is detected if multiple buttons are pressed...
VCC
+
|
.-.
| |
| |
'-'
|
+----------+ to A/D
|
.-.
| |
| |
'-'
_/ |
+--+o/ o-+----+
| |
=== .-.
GND | |
| |
'-'
_/ |
+---+o/ o-+---+
|
===
GND
created by Andy?s ASCII-Circuit v1.24.140803 Beta http://www.tech-chat.de
Carey Fisher
--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads
More... (looser matching)
- Last day of these posts
- In 2004
, 2005 only
- Today
- New search...