Hi! I am using an nRF52840 which has its I2C SDA and SCL pins assigned to different pins (9 & 10) than the default set Arduino is assigning them (4 & 5).
The nRF52 is actually on a particle Argon board that has been flashed with the nRF52 feather bootloader. Everything works fine except I2C- particle mapped the two I2C signals to two different physical pins. I’ve read through many posts, looked at Wire.h, etc., but can’t seem to figure out how to reassign them so I can use I2C. So my question is, is there a different Method to use with the Wire lib to do this? Or perhaps I should use a different library altogether? Thanks!
Are you sure that this is a question about Arduino ?
The Arduino Nano 33 BLE uses the nRF52840: Arduino Nano 33 BLE — Arduino Official Store
But it might turn on things in the hardware. The code might not be compatible with your board.
Adafruit has the Feather nRF52840 Express with the nRF52840: https://www.adafruit.com/product/4062.
That is a straightforward design: the processor, a power circuit, a charging circuit, and a Neopixel.
Are you using the Arduino IDE, and have selected the Adafruit Feather nRF52840 board ?
Can you just buy a Raspberry Pi Pico W ?
You could ask this at the Adafruit forum.
I only know Arduino. Arduino puts a layer on top of Mbed. It specific settings are here: https://github.com/arduino/ArduinoCore-mbed/tree/main/variants/ARDUINO_NANO33BLE
Arduino has enabled two I2C buses.
You can print "I2C_SDA", "I2C_SCL", "I2C_SDA1", "I2C_SCL1", to see which pins they are (A4, A5, GPIO30 ?, GPIO31 ?).
In the common Wire.h are the definitions for "Wire" and "Wire1". The initialization of Mbed for the I2C hardware is in the common Wire.cpp. I don't know if you can overrule that in the sketch, once it has been set.
Perhaps something like this:
delete Wire1;
arduino::MbedI2C myWire(9,10); // or perhaps Wire1
But it is weird to do, because Arduino has set specific things for the Arduino Nano 33 BLE.
Sorry, I do not get closer to an answer. I hope that you don't mind that I post this anyway for the links.
Thank you, Koepel! I was finally able to make some progress. I’ve been using the Arduino 2.10 IDE without much problem on this board because it is fairly similar to another Arduino-supported nRF52 board. But I found the I2C signals were on an uncommon pin pair. Finally resolved by editing some board definition files. Thanks again for your prompt reply!