Skip to content

Conversation

@dhalbert
Copy link
Collaborator

On nrf, SPIM1/TWIM1 and SPIM2/TWIM2 are shared. They can be either SPI or I2C. Because of driver interrupt routine issues, it's difficult to allocate them dynamically.

Currently, we can't use SPIM3 on nrf, so we allocate TWIM0 as the sole I2C, and use SPIM1/TWIM1 and SPIM2/TWIM2 both for SPI.

But on the CPB board, we really need an off-board I2C, in addition to the on-board I2C for the accelerometer, so this PR will allocate TWIM0 and SPIM1/TWIM1 for I2C , and have just one SPI, on SPIM2/TWIM2

Once we get SPIM3 working, we can have two I2C and two SPI for all boards, and remove this trade-off code.

@dhalbert dhalbert requested a review from ladyada October 29, 2019 01:15
@dhalbert dhalbert added this to the 5.0.0 milestone Oct 31, 2019
@dhalbert
Copy link
Collaborator Author

dhalbert commented Nov 2, 2019

@ladyada Tried this on a Crickit. A servo works fine, so it's working, but if the Crickit isn't powered, then I get what I presume is the #2253 I2C hang. So I'll work on fixing that either with a timeout or better "unpowered I2C" detection.

Copy link
Member

@ladyada ladyada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested CPB + crickit. was able to read accel from wire1 and talk to crickit on wire2 at the same time!

@tannewt tannewt merged commit cd3fcc8 into adafruit:master Nov 3, 2019
@dhalbert dhalbert deleted the cpb-two-i2c branch November 4, 2019 02:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants