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

Alternate SERCOM I2C Not Working On Pins PA08 and PA09 (4 and 3) #711

Open
DeltaAerospace opened this issue Oct 19, 2023 · 2 comments
Open

Comments

@DeltaAerospace
Copy link

I2C is not working using PA08 and PA09 on the ATSAMD21G18A-AU with an Arduino Zero bootloader on a custom PCB.
-Tried Modified I2C Scanner
-Normal I2C on PA22 and PA23 still work

@wltue
Copy link

wltue commented May 21, 2024

Works for me. Problems could be init in the library I had a lot of issues with external libraries if != Wire'0',
If the library tries to init the Wire remove the line (.begin) and add it manually in your setup.

Try manualy, this works:

`#include <arduino.h>
#include "wiring_private.h" // for pinPeripheral() function
#include <Wire.h>

TwoWire Wire1(&sercom2, // &PERIPH_WIRE
4, // PIN_WIRE_SDA
3); // PIN_WIRE_SCL

void setup() {

// Init Wire1
Wire1.begin();
Wire1.setClock(100000);
pinPeripheral(4, PIO_SERCOM_ALT);
pinPeripheral(3, PIO_SERCOM_ALT);

Serial1.begin(115200);
}

void loop() {

Wire1.beginTransmission(0x40);

Wire1.write(0b101010); // Sends value byte
Wire1.endTransmission(); // Stop transmitting

delay(500);
}
`
(set the parameters according to your i2c chip connected)

@DeltaAerospace
Copy link
Author

DeltaAerospace commented May 26, 2024 via email

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

No branches or pull requests

2 participants