Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I2CkeyPad and PCF8575 not working together #21

Closed
ennio64 opened this issue Jun 10, 2024 · 6 comments · Fixed by #23
Closed

I2CkeyPad and PCF8575 not working together #21

ennio64 opened this issue Jun 10, 2024 · 6 comments · Fixed by #23
Assignees
Labels
question Further information is requested

Comments

@ennio64
Copy link

ennio64 commented Jun 10, 2024

I2CKeyPad version=0.4.0 and PCF8575 version=0.2.3 not working together.
On stm32f411 individually they work well but together on the same bus they conflict.
I change the I2C bus for pcf8575 (use I2C3 SCL=PA8 and SDA=PB4)
TwoWire myWire(PB4, PA8);
PCF8575 PCF8575A(0x20, &myWire);
and work.

@RobTillaart
Copy link
Owner

Sorry for the long delay, I missed the notifications.

@RobTillaart RobTillaart self-assigned this Jul 14, 2024
@RobTillaart RobTillaart added the question Further information is requested label Jul 14, 2024
@RobTillaart
Copy link
Owner

@ennio64

The possible I2C addresses of the PCF8574 and the PCF8575 do overlap.
So you should not use the same (default) addresses for both.

Have you tried to give the PCF8574 and the PCF8575 different addresses?

Another option is to use a PCF8574A for the keypad as this has another address range.

@RobTillaart
Copy link
Owner

Will add a section to the readme.md file like this

I2C addresses

This library uses a PCF8574 or a PCF8574A chip.
These devices are identical in behavior although there are two distinct address ranges.

Type Address-range Notes
PCF8574 0x20 to 0x27 same range as PCF8575 !
PCF8574A 0x38 to 0x3F

@ennio64

Is the problem still actual?

@RobTillaart
Copy link
Owner

Created develop branch with new readme.md

@RobTillaart RobTillaart linked a pull request Jul 14, 2024 that will close this issue
@ennio64
Copy link
Author

ennio64 commented Jul 15, 2024

Not is a addresses conflict, when I tried both on the same I2C bus they had different addresses and conflicted. In my project I solved it by using two different I2C buses.

@RobTillaart
Copy link
Owner

@ennio64
I understand that using two I2C busses works as you separate the devices.

If I recreate the setup of an PCF8574 and PCF8575 on one bus I see two different I2C addresses.
(using different addresses by means of the A0, A1 and A2 pin, and pull up resistors on SDA / SCL of course).
So I do not understand how your conflict looks like?
Did you see only one I2C address? did you get a lot of read failures?
How did the conflict expose itself?

If you have time, can you please elaborate on this? If no time, no problem, then I just close the issue.

RobTillaart added a commit that referenced this issue Jul 18, 2024
- Fix #21, add section to readme.md
- Fix #22, implement **debounceThreshold**
- add constant **I2C_KEYPAD_THRESHOLD**
- add **uint32_t getLastTimeRead()**
- update **getChar()** to support **I2C_KEYPAD_THRESHOLD**
- update readme.md
- update unit test
- update keywords.txt
- minor edits
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants