Other Parts Discussed in Thread: LMK04832
HI,
I am writing a kernel drive to program the LMK03318 clock chip over i2c.
I am able to write to the registers and they cause a corresponding change in the live output of the chip.
For completeness, I am using the i2c_master_send for sending single bytes and i2c_master_recv to receive single bytes (No burst mode yet).
My I2C clock is 400kHz on the bus.
I am able to write to any individual register and read it back to confirm correct write operation.
I am also able to write to the SRAM directly using the excel doc (3857.LMK033x8_EEPROM_programming_v1) as the generator of the address value pairs with the EEPROM file being generated by TICS.
I can confirm the correct SRAM by reading back the values and comparing them to the original values.
My issue comes when I try to set the SRAM into the EEPROM.
We are in soft pin mode with GPIO 2/3 both set to ground.
I have tried following the 10.5.4 Write SRAM section of the PDF.
I have tried the first method described by writing all the registers I need to set and confirming live operation.
Then writing 0x00 to R145 to set page 0.
Then writing a 1 to R137.6 to copy the live registers over to SRAM.
I then follow section 10.5.5 Write EEPROM.
Write 0xEA to R144 to unlock the EEPROM
Write a 1 to R137.0 to start the transfer.
I did use to relock the EEPROM again after waiting 400ms but I don't right now as I wasn't sure if it was causing the write to fail.
I have also tried the second method of writing to the SRAM first and I can confirm that the values took as I can read them back.
I then follow section 10.5.5 Write EEPROM as described above.
What happens is R137 never clears it stays 0x01 forever until I power cycle.
This is a before image with the EEPROM counter, NVMCTL and NVMUNLK registers circled.
This chip was programmed once by the TICs program directly before it became embedded in the system.
After performing the EEPROM write steps above.
7
You can see that the NVMCTL reg is stuck on 0x01, the counter is still at 0x01 and the unlock is currently "unlocked" at 0xEA.
Sorry that this is a long post I just wanted to cover everything I could think of.
Hopefully, someone can help.
Cheers
Anton