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.

LP55231: Fundamental issues with LED error checking

Part Number: LP55231


Hi,

I've put the LP55231 onto my PCB design, and am having issues with getting it working. I2C interface is up and running, and I can successfully force into CP mode and not (with VOUT ADC check working accordingly). However, none of the LEDs are working...! To try and debug I have taken LED2 off of the PCB, but running the LED ADC test I get the same reading for both LED1 and LED2 (0x2a). I've set up registers as follows prior to this test (you'll see LED1 and LED2 differ from others - purely done as part of this debug:

write_led_reg(RegEn, 0x40); //Enable chip (no program execution)
__delay_ms(200);
write_led_reg(OnOffMSB, 0x00); //Turn off LED9
write_led_reg(OnOffLSB, 0x00); //Turn off LED1-8
write_led_reg(PWM1, 0xff); 
write_led_reg(PWM2, 0xff); 
write_led_reg(PWM3, 0x80); // 1/30 duty cycle
write_led_reg(PWM4, 0x80); // 1/30 duty cycle
write_led_reg(PWM5, 0x80); // 1/30 duty cycle
write_led_reg(PWM6, 0x80); // 1/30 duty cycle
write_led_reg(PWM7, 0x80); // 1/30 duty cycle
write_led_reg(PWM8, 0x80); // 1/30 duty cycle
write_led_reg(PWM9, 0x80); // 1/30 duty cycle
write_led_reg(Current1, 0xaf); 
write_led_reg(Current2, 0xaf);
//write_led_reg(Current3, 0x96); // 15mA current
//write_led_reg(Current4, 0x96); // 15mA current
write_led_reg(Current5, 0x96); // 15mA current
write_led_reg(Current6, 0x96); // 15mA current
write_led_reg(Current7, 0x96); // 15mA current
write_led_reg(Current8, 0x96); // 15mA current
write_led_reg(Current9, 0x96); // 15mA current
write_led_reg(OnOffLSB, 0x1F); //Turn on LED1-8
write_led_reg(MISC, 0x0D); //Powersave mode disabled, Charge pump forced off, PWM powersave enabled, forced INT clock

write_led_reg(0x41, 0x8f); //Run LED test on VOUT
__delay_ms(50);
reg_contents = read_led_reg(Status);
reg_contents = read_led_reg(0x42); //ADC result

write_led_reg(0x41, 0xa0); //Run LED test on LED1
reg_contents = read_led_reg(Status);
reg_contents = read_led_reg(0x42);

write_led_reg(0x41, 0xa1); //Run LED test on LED2 
reg_contents = read_led_reg(Status);
reg_contents = read_led_reg(0x42);

I'm running through in debug mode and as I say, get expected value for VOUT ADC testing, but 0x2A for both LED1 and LED (even with LED2 not populated). Schematic as follows, and I'm confident the layout matches (although confidence waning somewhat at this point!!). Any idea what might be causing this issue?? This was meant to be so easy...! I've repeated same issue on a number of PCBs, so don't believe it is chip-related.

Thanks.

  • Hi, Matt,

    Proper engineer has been assigned to take a look at this and will reply you soon.

    Due to Chinese new year holidays, response maybe delayed.

    Thanks for your understanding.

    Regards,
    Kenneth
  • Thanks very much - that would be appreciated - this issue is still unresolved and is stopping the development project.

    Thanks,

    Matt

  • Hi,

    I really need an answer on this please - otherwise I will be forced to use a different part in my design.

    Thanks,

    Matt

  • Hi, Matt,

    Sorry for the trouble.

    Please first refer to the following sample code.

    2502.lp5523_i2c_master_w_multibyte-master_code_MSP_EXP432P401R.zip

    I'll check your code in parallel and give you an answer by Friday.

    Thanks.

    Regards,

    Kenneth

  • Hi Kenneth,

    I can't see anywhere in this code where you're actually writing the LP55231 registers with required contents. This is the code for the MCU running as I2C master, but I'm happy my I2C bus is working correctly (I can successfully write and read registers in the LP55231 and am only doing single register read/writes). I'm assuming I must be missing a register write somewhere in order to make the LED driver work correctly, but cannot for the life of me see what that might be (and this code doesn't show me the writing of any registers to light LEDs). I assume this odd behaviour on the LED ADC test with an unpopulated and shorted LED showing the same result might point to something, but would appreciate your input (and review of my register settings from above code) please.

    Thanks,

    Matt
  • Hi Kenneth,

    OK, I've found "it" - though I really don't understand why it is a problem (and would really appreciate you explaining please!). I found where these registers are being written in your code (sorry was being blind) - and basically just copied it in my application. LEDs miraculously came on!

    Upon further investigation it looks like it all depends on the *order* in which I'm writing some registers (especially the MISC register)...

    If I write the following the LEDs (and self test) all behave correctly:

    write_led_reg(RegEn, 0x40); //Enable chip (no program execution)
    __delay_ms(200);
    write_led_reg(OnOffMSB, 0x00); //Turn off LED9
    write_led_reg(OnOffLSB, 0x00); //Turn off LED1-8
    write_led_reg(MISC, 0x0D); //Powersave mode disabled, Charge pump forced off, PWM powersave enabled, forced INT clock
    write_led_reg(PWM1, 0xff);
    write_led_reg(PWM2, 0xff);
    write_led_reg(PWM3, 0x80); // 1/30 duty cycle
    write_led_reg(PWM4, 0x80); // 1/30 duty cycle
    write_led_reg(PWM5, 0x80); // 1/30 duty cycle
    write_led_reg(PWM6, 0x80); // 1/30 duty cycle
    write_led_reg(PWM7, 0x80); // 1/30 duty cycle
    write_led_reg(PWM8, 0x80); // 1/30 duty cycle
    write_led_reg(PWM9, 0x80); // 1/30 duty cycle
    write_led_reg(Current1, 0xaf);
    write_led_reg(Current2, 0xaf);
    //write_led_reg(Current3, 0x96); // 15mA current
    //write_led_reg(Current4, 0x96); // 15mA current
    write_led_reg(Current5, 0x96); // 15mA current
    write_led_reg(Current6, 0x96); // 15mA current
    write_led_reg(Current7, 0x96); // 15mA current
    write_led_reg(Current8, 0x96); // 15mA current
    write_led_reg(Current9, 0x96); // 15mA current
    write_led_reg(OnOffLSB, 0x1F); //Turn on LED1-8

    BUT if I write the MISC register After the PWM registers, self test (and LEDs) do not work!!:

    write_led_reg(RegEn, 0x40); //Enable chip (no program execution)
    __delay_ms(200);
    write_led_reg(OnOffMSB, 0x00); //Turn off LED9
    write_led_reg(OnOffLSB, 0x00); //Turn off LED1-8
    write_led_reg(PWM1, 0xff);
    write_led_reg(PWM2, 0xff);
    write_led_reg(PWM3, 0x80); // 1/30 duty cycle
    write_led_reg(PWM4, 0x80); // 1/30 duty cycle
    write_led_reg(PWM5, 0x80); // 1/30 duty cycle
    write_led_reg(PWM6, 0x80); // 1/30 duty cycle
    write_led_reg(PWM7, 0x80); // 1/30 duty cycle
    write_led_reg(PWM8, 0x80); // 1/30 duty cycle
    write_led_reg(PWM9, 0x80); // 1/30 duty cycle
    write_led_reg(MISC, 0x0D); //Powersave mode disabled, Charge pump forced off, PWM powersave enabled, forced INT clock
    write_led_reg(Current1, 0xaf);
    write_led_reg(Current2, 0xaf);
    //write_led_reg(Current3, 0x96); // 15mA current
    //write_led_reg(Current4, 0x96); // 15mA current
    write_led_reg(Current5, 0x96); // 15mA current
    write_led_reg(Current6, 0x96); // 15mA current
    write_led_reg(Current7, 0x96); // 15mA current
    write_led_reg(Current8, 0x96); // 15mA current
    write_led_reg(Current9, 0x96); // 15mA current
    write_led_reg(OnOffLSB, 0x1F); //Turn on LED1-8


    So while I am pleased to have fixed the problem, I really would appreciate you explaining why this might be the case - I can't see anything in the datasheet that tells me I have to write to registers in a certain order, and am very surprised to be the first person to have this issue as my approach to writing registers in ascending order probably isn't that rare?!

    Many thanks,

    Matt
  • Hi, Matt,

    First I'm very glad that you can use the chip after referring the code.

    Actually I'm also suprised for the impact of the code writing order since usually we set MISC firstly for the primary function setting.

    We'll double check your code writing order on the EVM and give you the result / expalination.

    Thanks.
    Kenneth
  • Hi, Matt,

    I tried on my EVM.

    I first enable chip_enable, then I set PWM for LED1 and LED2, then I click 1x charge pump, the driver works correctly.

    Thanks.
    Kenneth
  • Hi Kenneth,

    OK, so this doesn't explain/replicate the issue I've seen? I assume maybe it is one of the other bits within the MISC register that is causing the issue? I don't feel this is resolved yet... 

    Thanks,

    Matt

  • Hi, Matt,

    Since MISC is one byte data and needs to update together, can you check the following on your board?
    1. Enable
    2. Set PWM0 to 0x80
    3. Set MISC to set charge pum to 1x or 1.5x

    Let me know the result.

    Kenneth
  • Hi, Matt,

    I'll close this thread due to inactivity and if you have more questions please reply to it directly and it will open again.

    Please help to click "Resolve" if the problem is solved.

    Thanks.
    Regards,
    Kenneth
  • Hi Kenneth,

    Sorry for delay in getting back to you - very busy at this end!

    I have run this test, and unsurprisingly it shows the same thing I was seeing before.

    With register writes in this order:

    write_led_reg(RegEn, 0x40); //Enable chip (no program execution)
    write_led_reg(PWM1, 0x80);
    write_led_reg(MISC, 0x2D); //Charge pump forced off

    The ADC test on LED1 gives a result of 0x2b (incorrect)

    With register writes in this order:

    write_led_reg(RegEn, 0x40); //Enable chip (no program execution)
    write_led_reg(MISC, 0x2D); //Charge pump forced off
    write_led_reg(PWM1, 0x80);

    The ADC test on LED1 gives a result of 0x7b (correct)

    You must be able to replicate this very simple test on your EVM and therefore start to explain why this happens (and why the crucial write order of MISC and PWM registers is not in the datasheet...!!).

    Thanks,

    Matt

  • Hi,

    Please can you respond to this? I can't carry on using a device in my design that has unexplained behaviour like this.

    Thanks,

    Matt

  • Hi, Matt,

    Sorry for the trouble you met.

    For your last code, either I set charge pump to 1x before or after PWM seting, D1 can turn on. So what's your D1 status?

    For ADC, I can get correct value for both the situations.
  • Hi Kenneth,

    Can you please try setting all of the other control bits that are in MISC - obviously it's not the CP_MODE bits causing the issue. You can see the contents of MISC as I'm writing them (and seeing this issue) - please try those same control values.

    Thanks,

    Matt

  • Hi, Matt,

    Actually I use the same code and process as yours.

    With register writes in this order:

    write_led_reg(RegEn, 0x40); //Enable chip (no program execution)

    write_led_reg(PWM1, 0x80);

    write_led_reg(MISC, 0x2D); //Charge pump forced off

    I get correct result and you can refer to the attachment.

    LP55231 test.pdf

    Are you able to get LP55231EVM to test?

  • Hi Kenneth,

    Oh... that's not good news. If you have done that test on the EVM I don't really see any point in me getting one to repeat same test. So now question is why my circuit is not behaving the same as the EVM...! Any ideas?!!

    Thanks,

    Matt

  • Hi Kenneth,

    Sorry I've just looked at your file - it looks from the screenshots like the PWM1 reg and MISC reg aren't being set to the values stated here... PWM1 has been set to 0x10, and MISC to 0x1C??

    Can you please confirm?

    Thanks,

    Matt
  • Hi, Matt,

    My bad.

    See the new picture.

    Do you mind to send your schematic? Let's make sure we don't miss anything.

  • Hi Kenneth,

    The schematic was in the first post - this is all parts related to the LED driver. There are no errors in the PCB layout vs this schematic (this was my assumption when it wasn't working so reviewed a LOT!).

    Thanks,

    Matt

  • So you actually have pull up resitors of SCL/SDA?
  • Hi Kenneth,

    Yes - pull ups on SCL/SDA. Issues with function of chip, not reading/writing of registers.

    Thanks,

    Matt
  • Hi, Matt,

    Can you try using LP55231EVM?
    www.ti.com/.../LP55231SQEVM

    Or can you contact local TI sales? I can't identify the root cause of this and I try so many times on the EVM but still can't duplicate the issue.

    Sorry again for the trouble and thanks for your understanding.