add 20 KHz and 50 KHz I2C speeds for the gen3 Nordic-based modules #2889
+19
−7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
We need lower I2C speeds to support longer cable distances on our Gen3 devices. Right now we are limited to 100 KHz or 400 KHz only.
Solution
This solution adds two more I2C speeds: 20 KHz and 50 KHz and adds support for them to the Nordic HAL.
Steps to Test
Using
Wire.setSpeed(20000)andWire.setSpeed(50000)before callingWire.begin()and using a logic analyzer to view the I2C clock during communication. This was tested on the new speeds and the existing 100 KHz and 400 KHz speeds and confirmed to work both with working I2C communication and a logic analyzer on the I2C line.Example App
References
Links to the Community, Docs, Other Issues, etc..
Completeness