Linux ARM IIC i²c EEPROM Read and write operation

Source: Internet
Author: User



Several sets of i²c buses are detected

[Email protected]:~# i2cdetect-li2c-0i2c OMAP i²c adapter i²c adapteri2c-1i2c OMAP i²c Adapter I²c Adapter[email protected]:~#


Check the online status of the device on each bus:-y means yes,0 represents/dev/i2c-0

[email protected]:~# i2cdetect  -y -r 0     0   1  2  3  4  5  6  7  8   9  a  b  c  d  e  f00:           -- -- -- -- -- -- -- -- -- --  -- -- -- 10: -- -- -- -- -- -- -- -- --  -- -- -- -- -- -- -- 20: -- -- -- -- uu  -- -- -- -- -- -- -- -- -- -- -- 30: --  -- -- -- -- -- -- -- -- -- -- -- -- --  -- -- 40: -- -- -- -- -- -- -- -- -- -- --  -- -- -- -- -- 50: uu -- -- -- -- -- -- -- -- -- -- --  -- -- -- -- 60: -- -- -- -- -- -- -- --  -- -- -- -- -- -- -- -- 70: -- -- -- --  -- -- -- --                          [email protected]:~#  UU says 0x50 has devices in use at this address.




View the contents of the EEPROM, the following 0 means/dev/i2c-0 bus, 0x50 is the address of the EEPROM

[email protected]:~# i2cdump -f -y 0 0x50no size specified  (using  byte-data access)      0  1  2  3   4  5  6  7  8  9  a  b  c   d  e  f    0123456789abcdef00: ff ff ff  ff ff ff ff ff ff ff ff ff ff ff ff ff    &NBSP, .......... 10: ff ff ff ff ff ff ff ff ff ff ff ff ff  FF FF FF   &NBSP, .......... 20: ff ff ff ff ff ff ff ff ff ff ff ff ff  FF FF FF   &NBSP, .......... 30: ff ff ff ff ff ff ff ff ff ff FF FF FF FF FF FF   &NBSP, .......... 40: ff ff ff ff ff ff ff ff ff ff ff ff ff  FF FF FF   &NBSP, .......... 50: ff ff ff ff ff ff ff ff ff ff ff ff ff  FF FF FF   &NBSP, .......... 60: ff ff ff ff ff ff ff ff ff ff ff ff ff  FF FF FF   &NBSP, .......... 70: ff ff ff ff ff ff ff ff ff ff ff ff ff  FF FF FF   &NBSP, .......... 80: ff ff ff ff ff ff ff ff ff ff ff ff ff  FF FF FF   &NBSP, .......... 90: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff     .......... a0: ff ff ff ff ff ff ff ff ff ff ff  ff ff ff ff ff    ................b0: ff ff ff  ff ff ff ff ff ff ff ff ff ff ff ff ff     ................c0: ff ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff    ................d0: ff  ff ff ff ff ff ff ff ff ff ff ff ff ff  Ff ff    ................e0: ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff ff     .......... f0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    &NBSP, .......... [email protected]:~#


Gets/sets the No. 01 byte of data for the 0x24 device of the i2c0-0 bus

[Email protected]:~# i2cget-f-y 0 0x24 [email protected]:~# i2cset-f-y 0 0x24 0xaa #掉电后, the data written is invalid, pending investigation ... [Email protected]:~# i2cget-f-y 0 0x24 01


Beaglebone Black Read Write EEPROM from file, Permanent

[Email protected]:~# dd If=eeprom.bin Of=/sys/bus/i2c/devices/0-0050/eeprom #大约要等5分钟






This article is from the "Li Chunli" blog, make sure to keep this source http://990487026.blog.51cto.com/10133282/1977966

Linux ARM IIC i²c EEPROM Read and write operation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.