Hi, i'm working on a project, but recently acquired an arduino due-board and want to make my code work with this board too. I had this little code-snippet to run in the setup function, to disable internal pull-ups which the wire library enables by default:
#if defined(__AVR_ATmega168__) || defined(__AVR_ATmega8__) || defined(__AVR_ATmega328P__)
// deactivates internal pull-up
// atmega8 manual p. 167
cbi(PORTC, 4);
cbi(PORTC, 5);
#else
// deactivates internal pull-up
// atmega128 manual p. 204
cbi(PORTD, 0);
cbi(PORTD, 1);
#endif
cbi is defined:
#ifndef cbi
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))
#endif
This used to work with the previous arduino-boards but it obviously doesn't work with the new Arduino Due which uses an ARM-chip instead of Atmega.
So i guess i can add something to that first code-snippet to make it work with the Arduino Due too, but i'm kind of lost what to put there? I googled "disabling internal pullup arduino due", but could not find an answer. Does someone have a quick code snippet, that disables internal pull-ups on the arduino due's SCL and SDA port?