Cannot determine address of connected I2C device (simple I2C scanner)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Cannot determine address of connected I2C device (simple I2C scanner)

2,882 Views
paulbarbu
Contributor I

Hello,

I have a 1602A V2.0 LCD display (16 chars x 2 lines) that I intend to connect to my  MK26 ARM M4 MCU via a LCM 1602 I2C extender (which has a Philips PCF8574AT on it).

I'm trying to get it to work since this morning, but apparently, the address I calculated for the I2C extender (0x3F according to this datasheet, A0, A1, A2 are non-jumpered) is not OK, so I tried to scan for a valid address where the I2C extender would ACK me back, but I cannot find any.

I connected just the PCF8574AT to my board, the LCD is not connected and it still doesn't work.

I have the following piece of code (KSDK 2.0):

#include "fsl_gpio.h"
#include "fsl_port.h"
#include "fsl_i2c.h"

#include "Retarget.h"
#include "Log.h"
#include <stdio.h>

#include <stdint.h>
#include <stdbool.h>

int main()
{
    RetargetInit();

    i2c_master_config_t masterConfig;
    uint8_t status;

    /* Get default configuration for master. */
    I2C_MasterGetDefaultConfig(&masterConfig);
    printf("Got def. config\r\n");

    /* Init I2C master. */
    I2C_MasterInit(I2C0, &masterConfig, CLOCK_GetFreq(I2C0_CLK_SRC));
    //I2C_Enable()

    printf("Init\r\n");

    /* Send start and slave address. */
    printf("Starting...\r\n");
    // 0x70, 0x27, 0x38, 0x20, 0x3F

    uint8_t u8Addr = 0x3F;

    for(u8Addr=0; u8Addr<128; u8Addr++)
    {
        status = I2C_MasterStart(I2C0, u8Addr, kI2C_Write);

        LOG("sent address 0x%x", u8Addr);
        uint32_t u32Flags;
        /* Wait address sent out. */

        uint16_t timeout = UINT16_MAX;
        while(!((u32Flags = I2C_MasterGetStatusFlags(I2C0)) & kI2C_IntPendingFlag) && (--timeout))
        {
        }

        if((u32Flags = I2C_MasterGetStatusFlags(I2C0)) & kI2C_IntPendingFlag)
        {
            LOG("ADDRESSS 0x%x IS OK", u8Addr);
        }

        LOG("timeout is %d", timeout);

        //LOG("done address");
        status = I2C_MasterStop(I2C0);
        LOG("Stopped with status=%d", status);
    }
}

Could you please point out what I'm doing wrong, why my scan doesn't yield any results?

Or is there a problem with my I2C extender, phisycally?

I'd expect the output of the above code to contain a single "ADDRESSS 0x... IS OK" line with a timeout different than 0, but that's not the case.

Merry Christmas!

Labels (1)
Tags (2)
0 Kudos
Reply
15 Replies

318 Views
DennisSchulist
Contributor I

It looks like the issue might be due to wiring or address conflicts with your I2C device. Double-check pull-up resistors and ensure the device address matches the datasheet values. You may also find useful troubleshooting guidance through this detailed Hive Planner Review which covers common connection errors and practical solutions. This could help you narrow down whether it’s a hardware or configuration problem.

0 Kudos
Reply

385 Views
root12
Contributor I

It sounds like the issue might be with the pull-up resistors or wiring sequence on your I2C lines, which often causes scanning problems. Double-check your device’s datasheet and ensure correct voltage levels for communication. You may also find useful troubleshooting steps and related guides at wendys talk, which can provide extra clarity on handling such errors. Sharing your exact setup could also help others give more targeted advice.

0 Kudos
Reply

385 Views
nora56
Contributor I

It sounds like the I2C scanner issue could be related to wiring or the device not acknowledging the address properly. Sometimes ensuring correct pull-up resistors or checking the clock speed settings helps. By the way, for anyone dealing with complex financial calculations, tools like this Chatham Interest Calculator can really simplify the process and save time. Hope you get the scanner working smoothly soon!

0 Kudos
Reply

415 Views
logan6jhon86
Contributor I

It sounds like you’ve checked the usual I2C address ranges thoroughly. Sometimes, double-checking pull-up resistor connections can make a difference. Also, if you’re handling multiple modules, keeping a detailed Court Records Search of addresses can help track which devices respond. Documenting each step carefully often makes troubleshooting much faster and clearer.

0 Kudos
Reply

386 Views
lukw14
Contributor I

That’s an interesting issue you’re facing. Sometimes small details like wiring or configuration can make a huge difference in resolving such errors. For those also dealing with research or background checks, resources like County Prison Records can provide useful information to cross-reference details effectively. Hope you get the scanner working smoothly soon!

0 Kudos
Reply

385 Views
brookleen
Contributor I

If you're facing issues with identifying your I2C device, double-checking the wiring and ensuring pull-up resistors are properly placed can help. In some cases, faulty jumpers or mismatched voltage levels might be the culprit. For additional guidance and structured steps, you can refer to this helpful guide on FEPS Application Guide for more clarity on documentation and troubleshooting practices.

0 Kudos
Reply

385 Views
Amilloan
Contributor I

It’s possible the issue lies in the wiring or the pull-up resistors not being properly set for the SDA and SCL lines. Double-check the connections and ensure your device is powered correctly. You might also want to test your setup with another known working component. For quick testing and related algorithmic understanding, tools like Caesar Cipher Tool can sometimes be useful in projects involving encoding or basic logic validation.

0 Kudos
Reply

591 Views
blazetitan
Contributor I

It might be helpful to double-check the wiring and ensure the correct pull-up resistors are in place, especially when dealing with I2C communication issues. Sometimes, device address conflicts or poor connections can cause the scanner to fail. For those interested in improving user feedback systems, this insight on retail experience survey might also provide some valuable perspective on collecting and analyzing responses effectively.

0 Kudos
Reply

1,055 Views
henry_kissinger
Contributor I

Make sure your I2C connections are solid and the pull-up resistors are correctly placed. Also, verify the voltage levels between your MCU and the PCF8574AT. For more reference, take a look at this County arrest lookup which might help in your research process.

0 Kudos
Reply

1,163 Views
nailson_fog
Contributor I

It sounds like your I2C scanner might not be detecting the device due to an address conflict or wiring issue. Double-check the connections and try running a basic scanner script to ensure communication. If you're working on projects related to public data research or need reference images for individuals in custody, you might find Mugshot lookup Kentucky helpful. Sometimes, small coding oversights or faulty jumpers can also cause this issue, so revisiting the hardware setup may help.

0 Kudos
Reply

1,236 Views
AmandaYoung
Contributor I

It sounds like you’ve done a solid job isolating the I2C extender, but one thing to double-check is whether pull-up resistors are present on the SDA and SCL lines—without them, communication often silently fails. Also, make sure your I2C clock frequency isn’t too high for the PCF8574AT. If you're interested in broader system diagnostics or tools that help trace issues in embedded systems, you might also want to explore resources like this Arrest tracker NJ, which showcases structured data logging and tracking approaches. Let us know if you spot anything unusual on the bus with a logic analyzer. 

0 Kudos
Reply

1,297 Views
johazd12
Contributor I

It sounds like you’ve already done a solid job narrowing down the issue. One thing to double-check is pull-up resistors on the SDA and SCL lines—without them, many I2C scanners won’t get any ACKs. Also, make sure the extender is powered properly and no address conflicts exist. If you're working on embedded projects and need additional tools for verification, this CO jail locator can help demonstrate structured data validation methods, especially when organizing and reading serialized outputs. Keep going—you’re close!

 
 
0 Kudos
Reply

1,281 Views
johazd12
Contributor I

If you're facing issues with determining the address of a connected I2C device, I recommend checking your local arrest cases for any potential interference or errors in communication. Sometimes, addressing problems may relate to overlooked connections or settings. It's also helpful to ensure that your wiring is solid, and the device is correctly powered. For those interested in checking on public safety records or other similar databases, there are tools to review that may offer insights into community-level tech troubleshooting.

0 Kudos
Reply

2,405 Views
BlackNight
NXP Employee
NXP Employee

Hi Paul,

See Creating an i2c address scanner .

I'm using a Processor Expert component for this which provides the ScanDevice() which probes a device on the bus:

pastedImage_2.png

As you are using the SDK, that approach does not work directly for you. But you could have a look at the code in the McuEclipseLib project on GitHub (McuOnEclipseLibrary/lib/src at master · ErichStyger/McuOnEclipseLibrary · GitHub ) and the McuGenericI2C ScanDevice() function. That function gets called form the command line parser (ParseCommand() in I2CSpy, you can see how this would look like in CSI Crime Scene Investigation with I2CSpy and Freedom Board | MCU on Eclipse .

Other than that: make sure you are configuring the I2C clocks correctly: there is a silicon errata for this (see KL25Z and I2C: Missing Repeated Start Condition | MCU on Eclipse ).

I hope this helps, and Merry Christmas!

Erich

0 Kudos
Reply

329 Views
Roobin
Contributor I

That issue often happens when the wiring or device address isn’t properly detected. Double-check the pull-up resistors and ensure the device is powered correctly before scanning again. If you’re looking for more detailed legal references, you might also find the Bexar County Court Dockets page useful for structured case-related updates. Sometimes cross-checking reliable sources while troubleshooting helps keep everything in order.

0 Kudos
Reply