Skip to main content
Graduate
August 7, 2024
Question

Enable I2C between MKI245KA and AT-Mega

  • August 7, 2024
  • 3 replies
  • 1518 views
I recently bought the STEVAL-MKI245KA, consisting of an ad hoc PCB mounting the ISM330BX 6-axis IMU, which is connected through flat cable to a generic adapter board (STEVAL-MKIGI06A). I am trying to enable I2C commincation between the adapter board and an Arduino Mega, however, even after I connect the pins according to the datasheet of the components, when I run an I2C scanner on the Arduino, there are no devices detected. Here are my pin connections:
 
 
Adapter Board
Arduino
1
VDD
3.3V
2
GND
GND
3
SCLSCL
4
SDA
SDA
5
CS - VDDIO
 
6
SDO3.3V

The adapter board is mounted on a DIL 24 pin socket, which is then placed on a breadboard.

What am I doing wrong? I want to read and use the IMU readings, any suggestions on how I can do this any other way?

    This topic has been closed for replies.

    3 replies

    Super User
    August 7, 2024

    Recheck your assumptions, it should work.

    Are there external pullups on the I2C lines? Can you look at the waveform? Perhaps show a picture of the setup. Is the chip powered appropriately? Can the Arduino detect a different I2C device?

    Graduate
    August 7, 2024

    There are no external pullups. do i need to add any?

    The Arduino can detect other I2C devices, just not this one. I've added pictures of my set-up below, the code i used was just the Arduino Playground code for an I2C scanner (https://playground.arduino.cc/Main/I2cScanner/)

    IMG_8279.jpg

    IMG_8282.jpg

    IMG_8281.jpg

    IMG_8280.jpg

     

    Super User
    August 7, 2024

    I2C needs external resistors somewhere. If it's working with other devices, perhaps those devices have pullups, but yes they need to be present somewhere.

    It's possible they're on the adapter board. I didn't look for a schematic.

    Graduate
    August 9, 2024

    The I2C is working now, the scanner is able to find the IMU device at address 0x6B as it should. I changed my breadboard and it started working, so I guess the connections were bad the first time.

    I have another issue now.. when I run the scanner it finds the I2C device at 6B but it also says 'Unknown error at address 0x7E '. The IMU (with the adapter board) is the only device connected to the Arduino. What could the 7E be referring to?

    Super User
    August 9, 2024

    Perhaps consult the documentation of the scanner tool for what that error message means. Means nothing to me, it's not an STM32 convention.

    Explorer
    August 7, 2024

    AtMega is 5V device, likely you need "logic level converter"

    Graduate II
    August 9, 2024

    My thought too. With the wealth of 3V3 Arduino boards available in that universe, why use an ATMEGA at 5V ?

    VDDIO on the MEGA's hard wired to 5V, and SDA/SCL will be pulled to that too.