chipKIT® Development Platform

Inspired by Arduino™

Max32 I2c pin

Created Fri, 08 Jul 2016 05:42:04 +0000 by Dharmesh


Dharmesh

Fri, 08 Jul 2016 05:42:04 +0000

Hello i am using Max32 board. And i am using I2c on the Max32. It works fine WIth SDA and scla pin. But when i connect any ardunio shield the shield's I2c pins are not compatible with max32. Even shield's i2c pins are not fitted in any max32 pin. This pins remain open. How to solve this problem can any one help me.


majenko

Fri, 08 Jul 2016 09:59:28 +0000

An Urduino UNO I²C-based shield will not work on a Max32. It won't even work on an Arduino Mega, an Arduino Leonardo, Arduino Due, etc.

That is why they created the extra pair of I²C pins to try and make a standard position for all I²C shields to use. Not all shields do that, though, and not all boards provide them.

The MAX32 pre-dates the implementation of those pins, so it lacks them. Later boards, like the uC32, WF32 and upcoming Lenny have them, which improves compatibility.

Some boards have strived to work around the problem without those extra I²C pins by providing jumpers that re-route the I²C signals to pins A4/A5 (such as the Picadillo-35T) but the Max32 doesn't have that facility.

So how can you get your shield to work on the Max32? Well, if it has the extra SCL/SDA pins on the shield you could bend them slightly and use Dupont® jumper wires to connect direct to the SCL/SDA pins of the Max32. Or you could modify the shield to use one of the other I²C channels, such as SCL2/SDA2 on pins 12 and 13 (see the manual) or modify the Max32 itself to hard-link the I²C pins across to A4/A5 (be careful that A4 and A5 must never be set to anything but INPUT or you could damage the IO pins).

Another option would be to use a purely software solution - use a "soft" I²C library, though I don't know of one of those off hand that works on the chipKIT boards. It's something I'll leave you to investigate. Essentially, though, it would "bit bang" the I²C protocol through any I/O pins you choose switching between OUTPUT + LOW and INPUT to emulate open-drain operation (although the chipKIT can do real open-drain operation, so a chipKIT specific library would be better off doing that than emulating it).