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.

DM6467T EVM user-switches and LEDs

Other Parts Discussed in Thread: PCF8574A

I've got a DM6467T EVM and the dvsdk 3.10.00.19

How do you read the user dip switches?  How do you drive the LEDs?

Neither method in http://processors.wiki.ti.com/index.php/DVEVM_and_DVSDK_frequently_asked_questions#How_do_I_toggle_the_LED:s_on_the_board_from_Linux_user_space.3F

works.

 

Snippets of code would help.  How do you open the i2c adapter and control subdevice 0x38, the led/switch expander?

  • Hi,

    To control the LEDs from user space you can also make use of i2cset command available as part of arago file system. Before using 'i2cset' command you have to disable the entry for 'pcf8574a' in the kernel source file arch/arm/mach-davinci/board-dm646x-evm.c. After the following sequence of commands should toggle the leds:

    # i2cset -y 1 0x38 0 0x55
    # i2cset -y 1 0x38 0 0xaa

    Regards, Sudhakar

  • Thanks, that worked.  

    Writeup:

     

     

    How to access User LED and Switches on DM 6467T EVM

     

    In git/.config

    find line: CONFIG_GPIO_PCF857X=y

    make it:   CONFIG_GPIO_PCF857X=n

     

    Then "make uImage"

     

    Run this uImage kernel.  Then on the target: 

     

     

     

    TO SET LEDS (DS1..DS4)

     

       i2cset -y 1 0x38 0 0xC0  

     

           Upper nybble controls LEDs DS1..DS4.  A '1' shuts it off.

           0xC0 = ..**   .=dark *=lit

     

     

     

    TO READ SWICHES (J1)

     

       i2cget -y 1 0x38 0xFF b

     

    returns in lower nybble

    a '1' if switch is UP  eg  UP UP UP DOWN    -->  7 in lower nybble

     

     

     

    Note that the instructions on TI involving /sys files doesn't work.

     

  • To use sysfs interface, you will need to modify the following in .config:

    CONFIG_GPIO_SYSFS=y

    Then you will be able to see /sys/class/gpio/gpio(145 to 148) and read switches values from value files.

    LEDs will be at /sys/class/leds/DS(1-4), controlled by brightness files.

    Alex

  • Alexander, thanks for your answer, it really helped out, with that the instructions on the wiki worked

    auf widersen