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.

[LP5562] Load LED pattern to ENG question

Other Parts Discussed in Thread: LP5562

Hi~

I used the LP5562 for RGBW LED driver. I can control it by I2C PWM mode. But I cannot load the pattern to the SRAM.

I read back the SRAM. It's different from my pattern.

BR, KenZ

May you review my instrument?

//LEDEN GPIO
  P1SEL &= ~(0x02);    /* Set pin function to GPIO */
  P1DIR |= (0x02);    /* Set pin direction to Output */
  P1 &= ~(0x02);
  HW_WaitUs(500); //delay 500us
  P1|=(0x02);
   /*power on routine*/
        HW_WaitUs(1000); //delay 1ms
        lp5562_REG_write(LP5562_CH, LP5562_REG_ENABLE, LP5562_ENABLE_DEFAULT);// chip_en=1
        HW_WaitUs(500); //delay 500us
       
        lp5562_REG_write(LP5562_CH, 0x08, 0x21);// enable internal clk
        lp5562_REG_write(LP5562_CH, LP5562_REG_ENG_SEL, 0x00);// Set LED controlled by I2C
        // Set LED current 14mA
        lp5562_REG_write(LP5562_CH, LP5562_REG_R_CURRENT, 0x8c);
        lp5562_REG_write(LP5562_CH, LP5562_REG_G_CURRENT, 0x8c);
        lp5562_REG_write(LP5562_CH, LP5562_REG_B_CURRENT, 0x8c);
        lp5562_REG_write(LP5562_CH, LP5562_REG_W_CURRENT, 0x8c);
        //PWM value
        lp5562_LED(LP5562_CH, LEDW);
        //Pattern Load
        lp5562_REG_write(LP5562_CH, 0x01, 0x10);
       
        //lp5562_ENG_write(LP5562_CH, LP5562_REG_PROG_MEM_ENG1); //ENG1 load breath pattern
        lp5562_REG_write(LP5562_CH, 0x10, 0x03);
        lp5562_REG_write(LP5562_CH, 0x11, 0x7f);
        lp5562_REG_write(LP5562_CH, 0x12, 0x4d);
        lp5562_REG_write(LP5562_CH, 0x13, 0x00);
        lp5562_REG_write(LP5562_CH, 0x14, 0x03);
        lp5562_REG_write(LP5562_CH, 0x15, 0xff);
        lp5562_REG_write(LP5562_CH, 0x16, 0x60);
        lp5562_REG_write(LP5562_CH, 0x17, 0x00);
        lp5562_REG_write(LP5562_CH, 0x18, 0x00);
        lp5562_REG_write(LP5562_CH, 0x19, 0x00);
       
        //Enable ENG1
        lp5562_REG_write(LP5562_CH, 0x01, 0x20);
        lp5562_REG_write(LP5562_CH, 0x00, 0x60);
        // Set LEDW with ENG1
        lp5562_REG_write(LP5562_CH, LP5562_REG_ENG_SEL, LP5562_ENG1_FOR_W);// Set LED controlled by I2C
       
        lp5562_REG_Read(LP5562_CH, 0x10);
        if(buf[0]==0x03) for(;;);
        else for(;;);