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

I2C for Heltec Mesh Node T114 #4745

Merged
merged 4 commits into from
Sep 23, 2024
Merged

Conversation

todd-herbert
Copy link
Contributor

@todd-herbert todd-herbert commented Sep 17, 2024

Resolves #4605

Adds an I2C bus, assigned to P0.13 (SDA) and P0.16 (SCL), which are available on the header pins.

This is implemented using a second I2C bus.
Bus 0 retains its original assignment from Heltec: routed to the footprint for an RTC which is not populated on the current hardware version.

Another option would be to simply reassign the pins for the currently unused I2C bus 0.
Is there reason to consider this instead?

@todd-herbert todd-herbert marked this pull request as draft September 17, 2024 11:39
@lyusupov
Copy link

lyusupov commented Sep 18, 2024

image

Think about to use this mapping:

Signal Pin
SCL 13
SDA 16


Heltec T114 pin header

image

@todd-herbert
Copy link
Contributor Author

todd-herbert commented Sep 18, 2024

Think about to use this mapping:
Signal Pin
SCL 13
SDA 16

That's definitely a reasonable suggestion.

My first hope was to match the qwIIC mapping Heltec used on their other Vision Master boards, but this wasn't possible because 3.3V and GND are reversed.
image

After the disappointment with the qwIIC mapping, I didn't think to check for any alternative layouts. If the pin-out in your photos is another common layout for I2C devices, then definitely it's worth swapping the SCL and SDA assignment, so at least it can be convenient in some cases.

@todd-herbert todd-herbert marked this pull request as ready for review September 18, 2024 15:27
Enabled at compile-time if WIRE_INFERFACES_COUNT defined as 2
SDA: P0.13
SCL: P0.16

Uses bus 1, leaving bus 0 routed to the unpopulated footprint for the RTC (general future-proofing)
SDA=P0.16, SCL=P0.13
@caveman99 caveman99 merged commit 1afd616 into meshtastic:master Sep 23, 2024
105 of 106 checks passed
#ifndef WIRE_INTERFACES_COUNT
// Officially an NRF52 macro
// Repurposed cross-platform to identify devices using Wire1
#if defined(I2C_SDA1) || defined(PIN_WIRE_SDA)
Copy link
Contributor

Choose a reason for hiding this comment

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

@todd-herbert shouldn't this be PIN_WIRE_SDA1 here?

Copy link
Contributor

Choose a reason for hiding this comment

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

PIN_WIRE1_SDA* rather :)

Copy link
Contributor

Choose a reason for hiding this comment

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

fifieldt added a commit to fifieldt/meshtastic-firmware that referenced this pull request Sep 23, 2024
Based on meshtastic#4745, PIN_WIRE1_SDA is the 'second' wire interface.

This pach amends the check to determine whether a device has two
wire interfaces should use PIN_WIRE1_SDA, rather than PIN_WIRE_SDA.
thebentern pushed a commit that referenced this pull request Sep 24, 2024
Based on #4745, PIN_WIRE1_SDA is the 'second' wire interface.

This pach amends the check to determine whether a device has two
wire interfaces should use PIN_WIRE1_SDA, rather than PIN_WIRE_SDA.
@todd-herbert
Copy link
Contributor Author

@fifieldt Ah thank you for spotting that!

@pagex
Copy link

pagex commented Oct 17, 2024

Wondering how were you flashing T114 as there is no model available at web flasher?

@todd-herbert todd-herbert deleted the t114-i2c branch December 6, 2024 11:53
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.

[Feature Request]: Expose an I2C interface for Heltec Mesh Node T114
5 participants