1 Attachment(s)
Greeting...I am trying to Connect two PIC microcontrollers
Hi Everyone,
I join here looking for ideas and help on a project that I am trying to build. What I want to have the main system which I am showing here with the schematic. I want to have a 3x4 keypad for the user to input values. What I came across is that all the pins on that schematic are being used. So the question of using two pics came across, one as a slave and one as a master. But I have no idea how the wiring/ connection are going to be. Once I figure that out I will look into the coding next.
This is the 3x4 device, http://www.pcreview.co.uk/forums/3x4...-t3043773.html
I am using a PIC18F4550, http://ww1.microchip.com/downloads/e...doc/39632c.pdfAttachment 6734
Re: Greeting...I am trying to Connect two PIC microcontrollers
Hi,
What do you mean by all pins are being used?
A 4x3 matrix would require 7 pins and I see 8 free pins (RC2-7, RA4-5, RB5) on the '4550 in your schematic...
If you put a slave PIC on the keypad you could program it to SEROUT/HSEROUT a byte each time a key is pressed and connect it to the USART of the 4550 (RC7 is the RX input for the USART and is currently not used in your schematic.)
/Henrik.
Re: Greeting...I am trying to Connect two PIC microcontrollers
Hi,
Thank you for your response and I am glad I found your answer. You are right there is more pins that the 3x4 can use. If you will, please guide me with the wiring connection. How would you connect the 3x4 keypad to the PIC18f4550? What pins from the keypad to what pins from the PIC?
Thank you for your time.
Re: Greeting...I am trying to Connect two PIC microcontrollers
Hi,
For a basic 4x3 matrix you need 4 output and 3 inputs OR 3 outputs and 4 inputs - up to you really. The outputs drives the columns (or rows) and the inputs reads the rows (or columns).
Pull up the inputs, drive one of the outputs low, read the inputs. If any of the inputs reads low you have a button pressed. Drive the next input low, read the inputs and so on.
If you search the forum I'm sure you'll find examples.
/Henrik.
1 Attachment(s)
Re: Greeting...I am trying to Connect two PIC microcontrollers
In my situation, I have different pins left. I attached the schematic of one of the forums keypad. Please help me choose the pins for the schematic I am working on, by comparing it to the attached image. Thank you, I am grateful.
Attachment 6737
Re: Greeting...I am trying to Connect two PIC microcontrollers
Hi,
I really don't understand. Use any four of the available pins as outputs and any three of the available pins as inputs - or the other way around - that's it.
Re: Greeting...I am trying to Connect two PIC microcontrollers
Thank you,
I am embarrassed to ask this.. I found this website but not sure what pins are what in the actual keypad. May you help me with it?
http://www.pic-tronics.com/7-Segment...eypad-Int-.php
this is the schematic http://www.acroname.com/robotics/par...3X4-KEYPAD.pdf
1 Attachment(s)
Re: Greeting...I am trying to Connect two PIC microcontrollers
Hi,
Look at the table on the datasheet. It'll tell you that when '1' is pressed you'll get a connection between pins 2 and 3. When '2' is pressed you'll get a connection between pins 2 and 1 and when '3' is pressed you'll get a connection between pins 2 and 5.
This means that since '1' and '2' and '3' are on the same row the common connection to that row must be pin 2. The connection to column 1 would be pin 3, column 2 would be pin 1 and column 3 would be pin 5.
If you draw that out on paper you'll get something looking like this:
Attachment 6740
Hope it helps.
/Henrik.