mri3
mri3

Reputation: 256

Is there a way to read and write to an EEPROM through I2C using USB port?

I was wondering if there was a way to read and write to an EEPROM using the I2C protocol through USB. I basically have a board that has a USB port and on that board is the EEPROM. Is it possible to read and write to the I2C data register on that board through the USB port on the board? I don't want to have to attach and wires just plug in to the USB port on the board and use another device like a Raspberry Pi to read and write to it. Any type of direction would be helpful. Thanks.

Upvotes: 2

Views: 1762

Answers (2)

ralf htp
ralf htp

Reputation: 9422

I2C and USB are different on hardware level so you need a physical adapter. Search net for I2C over USB and see this https://wiki.openwrt.org/doc/howto/usb.i2c-tiny-usb

Upvotes: 0

kirkpatt
kirkpatt

Reputation: 623

tl;dr: Yes, possible. Probably not possible with equipment on hand, it takes some extra hardware.

It doesn't look like there is any quick and easy method. It actually takes a bit of gear to do it, this method at least. Here's a detailed guide on using the Aardvark adapter, which I assume is relatively consistent with most products like it.

The steps to the actual process, assuming you have one of those things laying around and the link is down or something:

  1. Download and run the latest version of the Total Phase USB Drivers Installer.
  2. Download and unzip the latest version of Control Center.
  3. Connect the Aardvark adapter to the PC via the USB connector.
  4. Connect the Aardvark adapter to the I2C/SPI activity board via the I2C/SPI connector.
  5. Launch Control Center.
  6. Connect to the Aardvark adapter.
    1. Click Configure Aardvark Adapter.
    2. Select the Aardvark Adapter.
    3. Click OK to connect to the adapter.
  7. Click Aardvark, and choose I2C+SPI.
  8. Click Aardvark, and enable I2C Pulls-Ups and Target Power. (This configuration is required for the activity board, but may not be required for all target systems.)
  9. Configure the adapter as an I2C Master using the I2C Control panel. (?)
    1. Click on the Master tab.
    2. Enter 100 in Bitrate rectangular, and click Set.
    3. Enter 0x50 in Slave Address field.(?)
    4. Disable 10 Bit Addr and No Stop.
    5. Enter 3 in Number of Bytes field.
    6. Enter 08 0A 0B 0C in the Message field, and click Master Write.
    7. Enter 08 in the Message rectangular, and click Master Write. (By only sending the word address without any data, the internal data word address counter is set to 0x08).
    8. Click Master Read, and verify that the read data is 0A 0B 0C.

If you don't have something like that laying around, this post notes that the cheaper ones run about $40, which a quick google search proves right.

Sorry I couldn't be of more help.

Upvotes: 1

Related Questions