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

Working version of pin extenders #337

Open
wants to merge 320 commits into
base: Devt
Choose a base branch
from
Open

Working version of pin extenders #337

wants to merge 320 commits into from

Conversation

atlaste
Copy link
Collaborator

@atlaste atlaste commented Mar 15, 2022

This PR is a complete implementation for PCA pin extenders. It is tested extensively, on both unit tests and real hardware. The latency that I found on real hardware is typically between 3 and 7 us.

A few other bugs have been fixed in the process. It should also be quite feasible to make other types of [smart] extenders using this code.

At this point, I would say that making a board with a pin extender is quite hard to get right. It's not really the hardware itself that makes it hard, but how pins should be used. For the moment, I would only recommend using the pin extender for endstops, and only if the interrupt pin of the pin extender is wired. Definitely not stepping. Definitely not probing. Other I/O should work, but should not be mixed with endstops. That's hardly a real issue tho, because it frees a lot of GPIO.

It should be relatively easy to add other I2C pin extenders using this code. From all the data sheets that I have seen, they all work the same way, just with other numbers of ports and other addresses. Nothing the code cannot handle.

@bdring
Copy link
Owner

bdring commented Mar 16, 2022

Do you have a reference schematic?

@atlaste
Copy link
Collaborator Author

atlaste commented Mar 16, 2022

The datasheet has a reference schematic with all the details on how to use these IC's. I based my board off that: https://www.nxp.com/docs/en/data-sheet/PCA9539_PCA9539R.pdf pg 17. As long as you just use them for a single purpose like I do, these extenders work just fine.

Once I finish testing these boards and fixing the bugs I found I can order a bigger batch of boards and send you one as well. I'd be happy to sell them in the EU... I can also design a little 6pack module off these for endstops in due time, it's hardly any effort.

MitchBradley and others added 28 commits April 12, 2022 12:51
It was assumed to be the same as SPI types.
It no longer needs to be constrained if handler.item has a range.
It was forced to be 50Hz now constrained to 50 to 2000 Hz
Some open source BESCs work at higher frequencies.
Eliminated unnecessary conversions to double precision float
Merge branch 'main' into Devt
Stefan de Bruijn and others added 29 commits July 21, 2022 12:31
…er, the update triggers, but the new pin value is not read for some reason.
@robZeilinga
Copy link

From a very high level, would this PR be able to handle other I2C extenders ( specifically MCP23017 ) ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants