Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Connecting pins in a matrix PIC

Status
Not open for further replies.

Spork

Member level 3
Joined
Feb 20, 2007
Messages
56
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,286
Activity points
1,752
So I'm using a PIC microcontroller (PIC18F4550). What I want to do is create an array using 23 IO pins. 9 of which will be set high as output, and the other 14 to be set as input.

Lets call the two sets of pins 1A-9A and 1B-14B respectively. When I connect 1A to 1B, I want one action. 1A to 2B, a separate action. Then 2A to 1B and 3A to 1B should give two more actions, and so on throughout the matrix.

Is there any way using a PIC to check which two pins are connected? I want to know how to differentiate between the 5v that pin 1A would give me and that pin 2A would give me. I'm looking for any sort of documentation on the subject, or even a simple explanation or example.


Edit:
I just wanted to clarify that I know basic PIC instructions and how to manipulate IP pins. I have also tried to do research on the subject, but have been unsuccessful finding it because I don't know what to call it. I work mostly in ASM, but could read an example in C if you had one.
 

Hi,

The Port controls are quite straight forwards - you seem to be describing something similar to a matrix keyboards function.

Have a look at this tutorial http://www.winpicprog.co.uk/pic_tutorial9.htm and also see the Microchip site as they have several Application notes on keyboard matrixes.
 

    Spork

    Points: 2
    Helpful Answer Positive Rating
Ah, so it looks like you just have to scan one row at a time. I was thinking there was some way to tell which two pins were connected. This makes much more sense now, thank you.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top