EEVblog Electronics Community Forum

Products => Computers => Embedded Computing => Topic started by: IY3775 on March 13, 2019, 04:11:28 pm

Title: Parallel Arduino 4x4 keypad.
Post by: IY3775 on March 13, 2019, 04:11:28 pm
Hey! Will this configuration work properly?

4x4 keypad, has 4 rows and 4 columns, total 8 pins.

The keypad pins from 2 to 8 will be connected to an Arduino Mega 2560 digital pins 2 to 8, and keypad column 1, row pins 5, 6, 7, 8 will be connected to an Arduino Uno/ Nano digital pins 2 to 6. (This leaves ABCD keys from Mega and connects them to the Uno).

Both will have a sketch that uses 'keypad' library. (Searches for keypress in the matrix).

My question is, will it cause any problems with some keypad pins as mentioned above are connected to both Arduinos?(https://uploads.tapatalk-cdn.com/20190313/7cb00ca3a19b2e3888890e9b4780b8c6.jpg)

Sent from my Mi A1 using Tapatalk

Title: Re: Parallel Arduino 4x4 keypad.
Post by: jlmoon on March 14, 2019, 05:21:06 am
I believe without using any style of gating, you're going to have output/input pin contention.  If the two processors have different bus voltages ie. 3.3  / 5 V you're going to damage the devices.  This keyboard is designed as a matrix array, generally during your keyscan program  you set a column or row at a constant level and then scan the rows for a equivalent level.  Then you repeat using another column and row scan again until you have gone through the entire 16 combinations.  If your going to multiplex that keyboard, you will need to gate the multiplexed lines through a configuration of  addressable multiplexers, and with timing considered enable one set of columns and rows and look for keys, then switch multiplexers to the other processor.  Probably going to require a interrupt scheme to keep everybody happy.  In summary, in native form it will be quite difficult to tie two platforms to one keyboard. 

 
Title: Re: Parallel Arduino 4x4 keypad.
Post by: IY3775 on March 14, 2019, 05:28:03 am
I believe without using any style of gating, you're going to have output/input pin contention.  If the two processors have different bus voltages ie. 3.3  / 5 V you're going to damage the devices.  This keyboard is designed as a matrix array, generally during your keyscan program  you set a column or row at a constant level and then scan the rows for a equivalent level.  Then you repeat using another column and row scan again until you have gone through the entire 16 combinations.  If your going to multiplex that keyboard, you will need to gate the multiplexed lines through a addressable multiplexers, and with timing considered enable one set of columns and rows and look for keys, then switch multiplexers to the other processor.  Probably going to require a interrupt scheme to keep everybody happy.  In summary, in native form it will be quite difficult to tie two platforms to one keyboard.
Both will have 5V at the digital pin.

Sent from my Mi A1 using Tapatalk

Title: Re: Parallel Arduino 4x4 keypad.
Post by: viperidae on March 14, 2019, 09:20:37 am
You will still need a method to stop both micros driving different columns at the same time. If they do you'll get the wrong keys detected.
Title: Re: Parallel Arduino 4x4 keypad.
Post by: tooki on March 14, 2019, 02:43:56 pm
I think it’d be wiser to have the Arduino Mega run the keypad, and then send commands to the Uno via serial or I2C or whatever.