Adafruit MCP23017 i2c library with Arduino Due (IDE 1.5.2)

by Dewy on Sat Mar 09, 2013 11:11 am

Just a silly i2c (and Due) noob question.

I'm trying to use the Adafruit MCP23017 library with the Arduino Due (IDE 1.5.2)
Here's the problem, the IDE automatically switches configs/backend between AVR and ARM during board select.

Select the Arduino Mega2560 for example and the library works just fine. (As advertised.) :)

However if you select the Arduino Due as the target device the back-end changes and the library no longer works.

So my noob question question is; can I copy the headers from the AVR toolchain into a sketch sub-folder labeled "avr" and have it work safely?

It does compile this way, but when it got around to calling for the fuse.h file I got concerned, stopped short of uploading it, and clicked by here for some skilled advice.

The library calls for avr/pgmspace.h...
pgmspace.h calls for:
avr/common.h
avr/fuse.h
avr/io.h
avr/lock.h
avr/portpins.h
avr/sfr_defs.h
avr/version.h

Surely, such a mediation is not going to be that simple.

Any advice?
User avatar
Dewy
 
Posts: 12
Joined: Sun Feb 19, 2012 11:38 pm
Location: Chicago,IL,USA

Re: Adafruit MCP23017 i2c library with Arduino Due (IDE 1.5.2)

by adafruit_support_rick on Sat Mar 09, 2013 3:28 pm

The Due is a completely different processor architecture; totally unrelated to the AVR. Our libraries have to be ported before they will work on a Due. This is something that we're working on right now, but it's not necessarily a trivial task and it will take some time. All I can say is that we're trying to get through them all as quickly as we can.
User avatar
adafruit_support_rick
 
Posts: 10978
Joined: Tue Mar 15, 2011 10:42 am
Location: Buffalo, NY

Re: Adafruit MCP23017 i2c library with Arduino Due (IDE 1.5.2)

by Dewy on Sun Mar 10, 2013 1:49 am

Thank you Driverblock, I was nearly certain that was going to fail.

BTW, dose the ARM actually use fuses? And if so can one be bricked by such misconceptions?
User avatar
Dewy
 
Posts: 12
Joined: Sun Feb 19, 2012 11:38 pm
Location: Chicago,IL,USA

Re: Adafruit MCP23017 i2c library with Arduino Due (IDE 1.5.2)

by adafruit_support_rick on Sun Mar 10, 2013 12:06 pm

Dewy wrote:BTW, dose the ARM actually use fuses? And if so can one be bricked by such misconceptions?

Good question. I just had a squint at the SAM3X datasheet. I didn't see anything that looked like a fuse. They have some "lock regions" in flash, and a "security bit" which can be set to prevent any external access to flash (so nobody can download and hack your executable).

So far, I haven't seen anything that can't be undone. Unsetting the security bit simply requires wiping the flash.

It looks like no bricking is possible, so go ahead - do yer worst! :wink:
User avatar
adafruit_support_rick
 
Posts: 10978
Joined: Tue Mar 15, 2011 10:42 am
Location: Buffalo, NY

Re: Adafruit MCP23017 i2c library with Arduino Due (IDE 1.5.2)

by Dewy on Fri Mar 15, 2013 2:27 am

Thanks! I shall *surly-forth...

*surly = bikers only do one thing with a 'Sally'. >;)
User avatar
Dewy
 
Posts: 12
Joined: Sun Feb 19, 2012 11:38 pm
Location: Chicago,IL,USA

Re: Adafruit MCP23017 i2c library with Arduino Due (IDE 1.5.2)

by adafruit_support_rick on Fri Mar 15, 2013 10:53 am

Odd. The bike in your avatar doesn't look like a Surly... :wink:
User avatar
adafruit_support_rick
 
Posts: 10978
Joined: Tue Mar 15, 2011 10:42 am
Location: Buffalo, NY