I can’t get a DAC MCP4725 to work. It’s connected to SDA, SCL, 3V3 and GND.
I tried I2C detection with Arduino Playground - I2cScanner
It crashes with selected board “Seeed XIAO nRF52840”. With “Seeed XIAO BLE - nRF52840” it doesn’t crash but does not detect an address. The board is labeled “XIAO-nRF52840”.
I connected the DAC MCP4725 to a Raspberry Pi and used the command i2cdetect which found the DAC on address 0x62.
Can somebody confirm the the I2cScanner mentioned above works with the XIAO-nRF52840?
I’m running Linux and using Arduino IDE Version: 2.3.2
The output says “Using board ‘xiaonRF52840Sense’ from platform in folder: /home/xxx/.arduino15/packages/Seeeduino/hardware/nrf52/1.1.8”
There is no output after “Scanning…” is printed.
The sketch is:
// --------------------------------------
// i2c_scanner
//
// Version 1
// This program (or code that looks like it)
// can be found in many places.
// For example on the Arduino.cc forum.
// The original author is not know.
// Version 2, Juni 2012, Using Arduino 1.0.1
// Adapted to be as simple as possible by Arduino.cc user Krodal
// Version 3, Feb 26 2013
// V3 by louarnold
// Version 4, March 3, 2013, Using Arduino 1.0.3
// by Arduino.cc user Krodal.
// Changes by louarnold removed.
// Scanning addresses changed from 0…127 to 1…119,
// according to the i2c scanner by Nick Gammon
// Gammon Forum : Electronics : Microprocessors : I2C - Two-Wire Peripheral Interface - for Arduino
// Version 5, March 28, 2013
// As version 4, but address scans now to 127.
// A sensor seems to use address 120.
// Version 6, November 27, 2015.
// Added waiting for the Leonardo serial communication.
//
//
// This sketch tests the standard 7-bit addresses
// Devices with higher bit address might not be seen properly.
//
#include <Wire.h>
void setup()
{
Wire.begin();
Serial.begin(9600);
while (!Serial); // Leonardo: wait for serial monitor
Serial.println("\nI2C Scanner");
}
void loop()
{
byte error, address;
int nDevices;
Serial.println(“Scanning…”);
delay(1000);
nDevices = 0;
for(address = 1; address < 127; address++ )
{
// The i2c_scanner uses the return value of
// the Write.endTransmisstion to see if
// a device did acknowledge to the address.
Wire.beginTransmission(address);
error = Wire.endTransmission();
if (error == 0)
{
Serial.print("I2C device found at address 0x");
if (address<16)
Serial.print("0");
Serial.print(address,HEX);
Serial.println(" !");
nDevices++;
}
else if (error==4)
{
Serial.print("Unknown error at address 0x");
if (address<16)
Serial.print("0");
Serial.println(address,HEX);
}
I did several tests without connected I2C device.
I have a “Seed XIAO nRF52840” board without “sense” in name.
I deleted the $HOME/.arduino15 directory of the Arduiino IDE and installed all packages again.
I tested all nRF52840 board selections from Arduino IDE.
The only working one is “Seeed XIAO nRF52840”. I can’t even light up the “USER LED” with any other board selection.
I used the I2C scanner example from IDE: File → Examples → Wire → main_scan
The scanner stops any Serial print once Wire is used.
So, maybe my board is broken or there is a problem with the current software version.
Does anybody had luck to run the I2C example on “Seed XIAO nRF52840” with the latest software version?
Here the I2C scanner code:
//from Arduino IDE: File → Examples → Wire → main_scan #include <Wire.h>
TwoWire *wi = &Wire;
//TwoWire *wi = &Wire1;
void setup()
{
Serial.begin(115200); // start serial for output
while ( !Serial ) delay(10); // for nrf52840 with native usb
wi->begin(); // join i2c bus (address optional for main)
}
void loop()
{
Serial.println(“Scanning address from 1 to 127”);
delay(500);
It works fine in my environment below.
BSP : Seeed nRF52 Boards by Seeed Studio 1.1.8
Board select : Seeed XIAO nRF52840
Sketch : main_scan.ino
IDE : ArduinoIDE 2.2.1 (Linux Mint)
So, maybe my board is broken or there is a problem with the current software version.
Does anybody had luck to run the I2C example on “Seed XIAO nRF52840” with the latest software version?
What do you mean “the current software virsion”?
What do you mean “the latest software version”?
Please be more specific.
Have you tried with the BSP “Seeed nRF52 mbed-enabled Boards 2.9.2”?