This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

pcf8575

Other Parts Discussed in Thread: PCF8575

hi all

my board = evm8168

my ezsdk = ti-ezsdk_dm816x-evm_5_01_01_80

my rootfs = tar from the ti-ezsdk_dm816x-evm_5_01_01_80/filesystem/ezsdk-dm816x-evm-rootfs.tar.gz

 

i want to control leds connected to pcf8575 (U13)

this is my log

root@dm816x-evm:~# i2cdetect -l
i2c-1 i2c        OMAP I2C adapter                 I2C adapter
i2c-2 i2c        OMAP I2C adapter                 I2C adapter
root@dm816x-evm:~# i2cdetect -r 1    
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-1 using read byte commands.
I will probe address range 0x03-0x77.
Continue? [Y/n]
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- --
20: 20 -- -- -- -- 25 -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: 50 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --         

----------------- SW2[3:0]  = 0001 --------------------------

              
root@dm816x-evm:~# i2cget 1 0x20
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will read from device file /dev/i2c-1, chip address 0x20, current data
address, using read byte.
Continue? [Y/n]
0xfe

---------------------------SW2[3:0]  = 0000 ----------------------


root@dm816x-evm:~# i2cget 1 0x20
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will read from device file /dev/i2c-1, chip address 0x20, current data
address, using read byte.
Continue? [Y/n]
0xff

--------------------------------in order to turn on the leds -----------------------


root@dm816x-evm:~# i2cset 1 0x20 0 0x0f
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will write to device file /dev/i2c-1, chip address 0x20, data address
0x00, data 0x0f, mode byte.
Continue? [Y/n]

--------------------------now all leds are light ------------------------------

-------------------------- read -------------------------


root@dm816x-evm:~# i2cget 1 0x20
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will read from device file /dev/i2c-1, chip address 0x20, current data
address, using read byte.
Continue? [Y/n]
0x00

---------------------------- now in order to turn off leds ----------------------------------


root@dm816x-evm:~# i2cset 1 0x20 0 0xff
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will write to device file /dev/i2c-1, chip address 0x20, data address
0x00, data 0xff, mode byte.
Continue? [Y/n]

--------------------------------------read ------------------------------------------


root@dm816x-evm:~# i2cget 1 0x20
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will read from device file /dev/i2c-1, chip address 0x20, current data
address, using read byte.
Continue? [Y/n]
0x00
root@dm816x-evm:~#

1 . why my setting does not work

2. how can i use /sys interface to operate i2c

thank you for any help 

  • I2C instance1 was controlled via the M3 firmware instead of A8(linux), that's why your setting did not work.

    Regards,

    yihe

  • hi yihe

    1 >  i have changed ezsdk from ti-ezsdk_dm816x-evm_5_01_01_80 to ti-ezsdk_dm816x-evm_5_02_01_59

    2 >  i am sure both firmwares have been downloaded  successfully

    3 > but  my setting does not work

    --------------------------------in order to turn on the leds -----------------------


    root@dm816x-evm:~# i2cset 1 0x20 0 0x0f
    WARNING! This program can confuse your I2C bus, cause data loss and worse!
    I will write to device file /dev/i2c-1, chip address 0x20, data address
    0x00, data 0x0f, mode byte.
    Continue? [Y/n]

    --------------------------now all leds are light ------------------------------

    -------------------------- read -------------------------


    root@dm816x-evm:~# i2cget 1 0x20
    WARNING! This program can confuse your I2C bus, cause data loss and worse!
    I will read from device file /dev/i2c-1, chip address 0x20, current data
    address, using read byte.
    Continue? [Y/n]
    0x00

    ---------------------------- now in order to turn off leds ----------------------------------


    root@dm816x-evm:~# i2cset 1 0x20 0 0xff
    WARNING! This program can confuse your I2C bus, cause data loss and worse!
    I will write to device file /dev/i2c-1, chip address 0x20, data address
    0x00, data 0xff, mode byte.
    Continue? [Y/n]

    --------------------------------------read ------------------------------------------


    root@dm816x-evm:~# i2cget 1 0x20
    WARNING! This program can confuse your I2C bus, cause data loss and worse!
    I will read from device file /dev/i2c-1, chip address 0x20, current data
    address, using read byte.
    Continue? [Y/n]
    0x00
    root@dm816x-evm:~#

    looking  forward to your reply 

  • Ok, you are actually use I2C instance 0(pcf8575)  though it is i2cget 1.

    I am not sure about the i2cget utility, but I can use i2c mw and i2c md command from u-boot to change the LED and read them no problem.

    TI8168_EVM#i2c mw 0x20 0x7f 1
    TI8168_EVM#i2c md 0x20 0 1
    0000: 7f

    Regards,

    yihe

  • Hi,

    On board LEDs in 8168 EVM are controlled thru' Bus 1 (I2C0 hardware instance).

    To switch on LEDs

    i2cset 1 0x0 0xff

    To switch off LEDs

    i2cset 1 0xff 0x0

    This worked for me....


    Regards,

    Nageswari