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.

TPS65950 Problem with LED control (for turning backlight on/off)

Other Parts Discussed in Thread: TPS65950

Hi,

 

I'm using the OMAP3EVM and try to use the power management to control the backlight.

The program has to run directly on the hardware - not within linux.

I have implemented the I2C Master Transmitter Mode (polling method) as explained in figure 18-29 of the OMAP35x Application Processor Technical Reference Manual. The control of the LED is implemented as described in the Basic Programming Model of the TPS65950 Technical Reference Manual.

...nothing happens.

I have found another flow chart (fig. 18-46), which wants me to wait for I2C1.I2C_STAT[2] ARDY to be set when writing has been finished... this detail was not mentioned in figure 18-29...  however, if I try to wait for this bit after writing the data byte via I2C, I'll wait forever. The bit is never set.

Do you have an idea, where my problem could be?

Best regards,

Sabine

  • Hi Sabine,

    I do not understand if your question is regarding software on OMAP or settings related to TPS65950.

    Are you trying to use I2C to write the LED control registers on TPS65950?

    Please elaborate your problem as much as possible so I can help further.

     

    Regards,

    Gandhar.

     

     

  • Hi Gandhar,


    I'm not just yet sure whether the problem is in programming the I2C bus or in the TPS65950 settings.

    I have no logic analyzer available, so it is not possible for me to check if SDA and SCL are driving the signals I'd expect.

    Yes, I am using the I2C1 component to access the LED control registers. Is there any extremely simple one-register-command on the TPS65950 which allows me to ensure definitely if my writing routine works correctly?

     

    I currently use the programming example to activate LEDA with 50% brightness. The used settings are the following:

        VIBRA_CTL (slave address 0x49) =  0

        LEDEN (slave address 0x4A) = 0x11

        PWMAON (slave address 0x4A) = 63

        PWMAON (slave address 0x4A) = 127   

     

    Best regards,

    Sabine

  • Hi,

    This looks ok to me. You can write any RW register and read it back from I2C. This will confirm that I2C is fine.

    You can actually try the example settings on page 496 of the TRM. Those setitngs are for 56% duty cycle.

    Hope this helps.

     

    Regards,

    Gandhar.

     

     

     

  • Hi Gandhar,

     

    ... I've written the I2C-read method using the flow chart in figure 18-30 of the OMAP35x Application Processor TRM (Master Receiver Mode, Polling Method). But reading a register does not work, the I2C status register is always 0.

    However, if it worked but reading did not deliver the correct value, I could not know if the I2C-read or the I2C-write routine was the problem, could I?

    I also tested the example of page 496, it does not change anything.

     

    Best regards,

    Sabine

  • Hi,

    You seem to have problem with your driver. It is best if you can download some code from the open community and try to use that instead of creating your own driver. You should be able to port that into your code.

     

    Regards,

    Gandhar.

     

     

  • Hi,

    I seem to have the same problem. I am using the beagleboard. However, I am able to write and read the same vales from the register over i2c.

    i2c_readbyte(0x4a,0xEE,&CC); //Returns 00
    kprintf("LEDEN %d\n ",CC);

    i2c_writebyte(0x49,0x45,0x0);
    i2c_writebyte(0x4A,0xEE,0x03);
    i2c_writebyte(0x4A,0xef,63);
    i2c_writebyte(0x4A,0xf0,127);

     

     i2c_readbyte(0x4a,0xEE,&CC); //Returns 03
    kprintf("LEDEN %d\n ",CC);

    What might be wrong?

    @ : How did you get around your problem?

     

    Thank you


  • Not sure I understand your problem. You write 0x03 to physical address 0xEE and you read back the correct value.

    I might be missing something or interpreting your problem differently. 

  • That is true, I read the correct value, but the LED remains as off as ever. :-(

     

    Thank you.

  • May be your PWM setting is set to keep it off all the time. Follow steps in section 8.5 and probe the output. I am assuming external connections from LED to VBAT is ok.

  • Thanks :-) I got it working

    The sequence that worked is 

     

    i2c_readbyte(0x4a,0xEE,&CC);
    kprintf("LEDEN %d\n ",CC);

    i2c_writebyte(0x49,0x45,0x0); //Vibra_CTRL
    i2c_writebyte(0x4A,0xEE,0x22); //LEDEN & PWMB
    i2c_writebyte(0x4A,0xf1,63); //PWM ON
    i2c_writebyte(0x4A,0xf2,127); //PWM Off

    i2c_readbyte(0x4a,0xEE,&CC);
    kprintf("LEDEN %d\n ",CC);

     

    Reading through the datasheet, I was of the impression that enabling the PWM was optional if I wanted the LED on without intensity modulation. However, the LED just does not glow if the LEDEN[PWMB] is not set. I will have to set the PWM on with a 100% dutycycle.

    Makes me wonder what is the point of the PWMB bit in the LEDEN register? Have I got something wrong? Is there a way to have the LED on without bothering with the PWM?

    Thank you.