Categories

Scan for I2C read and write addresses

Posted on Monday, September 7th, 2009 in Bus Pirate by Ian

i2c-scan

See the latest version in the documentation wiki.

You can find the I2C address for most I2C-compatible chips in the datasheet. But what if you’re working with an unknown chip, a dated chip with no datasheet, or you’re just too lazy to look it up?

The Bus Pirate has a built-in address scanner that checks every possible I2C address for a response. This brute force method is a fast and easy way to see if any chips are responding, and to uncover undocumented access addresses.

i2c-scan-thumbI2C chips respond to a 7bit address, so up to 128 devices can share the same two communication wires. An additional bit of the address determines if the operation is a write to the chip (0), or a read from the chip (1).

We connected the Bus Pirate to the 3EEPROM explorer board. The 7bit base address for the 24LC/AA I2C EEPROM is 101 0000 (0x50 in HEX). It answers at the write address 1010 0000 (0xA0) and the read address 1010 0001 (0xA1).

I2C>(1)<<<I2C search macro
Searching 7bit I2C address space.
Found devices at:
0xA0(0x50 W) 0xA1(0x50 R)
I2C>

Macro 1 in the I2C library runs the address scanner. The scanner displays the raw addresses the chip acknowledged (0xA0, 0xA1), and the 7bit address equivalent (ox50) with write or read bit indicators (W/R). Datasheets usually list the 7bit address, but the 8bit value is more recognizable on a logic analyzer, snooper, debugger, etc.

This entry was posted on Monday, September 7th, 2009 at 7:37 am and is filed under Bus Pirate. You can follow any responses to this entry through the RSS 2.0 feed. You can skip to the end and leave a response. Pinging is currently not allowed.

2 Responses to “Scan for I2C read and write addresses”

  1. Rx Caesar says:

    Is it just me, or is this incorrect?

    “It answers at the write address 01010000 (0xA0) and the read address 01010001 (0xA1).”

    01010000 = 0x50 and 01010001 = 0x51

    I thought the address had to shift one bit: 1010 0000 (0xA0) and 1010 0001 (0xA1)

Leave a Reply

Notify me of followup comments via e-mail. You can also subscribe without commenting.

Recent Comments

  • KH: Awesome build... reminds me of an old time travel argument: If UFOs are a kind of time travel device, then why haven't someone from the...
  • pankaj: can i make soldering paste with cationic rosin
  • pankaj: i want to make soldering paste . i dont have water white rosin , i have cationic rosin . pls tell me is this cationic...
  • Chip Stewart: Am I too late?
  • Sebastian: Yes please!