Hi, I'm trying to program the LP5521 following the steps on the section 8.3.1 of the datasheet but I'm experimenting a weird behaviour when writing to the program registers. This is the log produced by my application:
[LED]: Initializing
[I2C]: Writing 0x40 to 0x0 // Enable chip
[I2C]: Writing 0x19 to 0x8 // Use internal clock, automatic charge pump mode
[APP]: Programming led...
[I2C]: Writing 0x10 to 0x1 // Load sram for R channel, disable G and B channels
[LP5521]: CHECK OPMODE: 0x10 // Sanity check: read the opmode register to ensure the opmode is set correctly
[I2C]: Writing 0x3 to 0x10 // Write 0x03 to first program memory register
[LP5521]: Verify 0x10: 0x0 // Verify that the register is set correctly, fail
[I2C]: Writing 0x7f to 0x11 // Write 0x7f to the second program memory position
[LP5521]: Verify 0x11: 0x7f // Verify, ok.
[I2C]: Writing 0x4d to 0x12
[LP5521]: Verify 0x12: 0x3 // Fail
[I2C]: Writing 0x0 to 0x13
[LP5521]: Verify 0x13: 0x0 // OK
[I2C]: Writing 0x3 to 0x14
[LP5521]: Verify 0x14: 0x4d // Fail
[I2C]: Writing 0xff to 0x15
[LP5521]: Verify 0x15: 0xff // Ok
[I2C]: Writing 0x60 to 0x16
[LP5521]: Verify 0x16: 0x3 // Fail
[I2C]: Writing 0x0 to 0x17
[LP5521]: Verify 0x17: 0x0 // Ok
It seems there's a pattern: odd writes fails, even writes succeeds. Note though that all the write operations are acknowledged by the device.
After I programmed the 8 registers I do a new read, and that's the funny part, as you can see, the last 2 written values (0x60 and 0x00) overwrites all the registers.
[LP5521]: READ 0x10: 0x60
[LP5521]: READ 0x11: 0x0
[LP5521]: READ 0x12: 0x60
[LP5521]: READ 0x13: 0x0
[LP5521]: READ 0x14: 0x60
[LP5521]: READ 0x15: 0x0
[LP5521]: READ 0x16: 0x60
[LP5521]: READ 0x17: 0x0
I've tried all the possible programming combinations, writing one register at a time, two registers at a time, all the registers sequentially, but still no joy. My best bet is that the device is faulty, but before ordering a new one I would like to be completely sure. Note that all the features, except memory programming, work just fine.
Thank you.
EDIT: After a day struggling with this issue I'm pretty confident that the chip is faulty. I ordered a new one and I'll update the post with the results.