Adafruit is open and shipping! Let's build back better, together!
0

How can I use both Wire and Wire1 I2C on GC M4?
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

How can I use both Wire and Wire1 I2C on GC M4?

by lexdm3 on Sat Nov 14, 2020 1:29 am

I need to use two independent I2C buses on a GC M4. Wire works fine but when I try to use Wire1 like this:
Wire1.beginTransmission(0x20);

I get error message:
"'Wire1' was not declared in this scope; did you mean 'Wire'?"

How can I get Wire1 up and running? I have tried "Wire1.begin();" and that doesn't do it. I have hunted here and on the web with no luck. Do I need to modify the Variant or any other files to make Wire1 work? Do I need to declare a new TwoWire port with Sercom pins/pads defined? I hope not. I think the GC M4 should have Wire1 already set up, right?

If I have missed something simple, please slap me upside the head and just tell me what I missed.

Thanks! --Dan

lexdm3
 
Posts: 31
Joined: Thu Mar 12, 2015 6:44 pm

Re: How can I use both Wire and Wire1 I2C on GC M4?

by lexdm3 on Mon Nov 16, 2020 9:34 pm

Hi again. I'm hoping for a reply.

Supposedly the GC M4 has Wire1 already set up on D25 (SDA1) and D24 (SCL1) but the tutorial doesn't describe how to activate it. (Seems like it should...)

I took a crack at using the method discussed in this other part of the Forums but haven't made that work yet either.
viewtopic.php?f=63&t=169390#p829481

Any help would be most appreciated. Thanks. --Dan

lexdm3
 
Posts: 31
Joined: Thu Mar 12, 2015 6:44 pm

Re: How can I use both Wire and Wire1 I2C on GC M4?

by lexdm3 on Tue Nov 17, 2020 12:09 pm

adafruit_support_bill - Just trying to get the magic words from you that will help me get this thing going.

I'm building a cool system for disabled kids doing PT that we are doing final assembly of this week and I NEED to get that second I2C port going.

Thanks. --Dan

lexdm3
 
Posts: 31
Joined: Thu Mar 12, 2015 6:44 pm

Please be positive and constructive with your questions and comments.