I'm using a PCF8574 as an output device only, and not using all of the I/O ports, in particular I'm not using P5 and P6. Is it advisable to connect these to ground so that they are set LOW?
So, on reading the data from the PCF8574 I would always get 0's on P5 and P6. I'm using P7 as a data available DA, and P0 to P4 for the data being fed back.
On these port expanders, there are internal pull-ups permanently enabled (and secondary ones transiently enabled if you write the port HIGH). So they default to "1" and you do not need to connect them to anything if not needed.
Thanks Paul. BTW I changed my username as I moved from Surrey.
I’m back to creating a keypad with PCF8574 and 74C923. Basing the project on a similar circuit designed by Andrew Divison. His design doesn’t use the interrupt from the PCF8574 and is relying on continuously checking for his data enable on P4 i.e. kp & 0x10. I’m thinking that use of the interrupt might be better as I appear to be missing key presses?
I’ve not been using Arduino for a few years now, hence still trying to get this project off of the prototype stage.
You should be able to read a keypad organised as a 4X4 matrix with only one PCF8574. The trick is to pull all the columns low and read the rows. Then pull all the rows low and read the columns.
If there is not too much other activity in the loop(), you do not need an interrupt to notify of changes.
6v6gt:
You should be able to read a keypad organised as a 4X4 matrix with only one PCF8574. The trick is to pull all the columns low and read the rows. Then pull all the rows low and read the columns.
If there is not too much other activity in the loop(), you do not need an interrupt to notify of changes.
Thanks, “whole” project will have a lot to get on with, so best to use an interrupt for the keypadS.
I was trying to use the design with the keypad decoder, but have arrived at the same decision as you have made.