Hello all,
I have been using LTC3300-1 successfully for a couple of year. The LTC3300 is on a separate PCB. It is driven (SPI) by the MCU PCB with an ATmega2560 MCU. On the MCU PCB there is also a LTC6810 cell monitor. Considering that I could no longer buy LTC6810, I redesigned the MCU PCB using an ESP32-S2 MCU and a different method to monitor cells.
The balance PCB has not changed, but SPI communication does not work althought the commands sent by the MCU seem correct!
I have the impression that the SPI mode used by the LTC3300 when a sending data (read command) is not the same as the documented mode..
My understanding is that the LTC3300 SPI mode = 3: clock idle high, bits shifted on falling edge and data sampled on rising edge
For my tests I send a write command (A9) with command bytes 0C 06 (charge cell 3), then I do a read back (AA) to read 2 bytes. I use very slow rate (50 kb/s) to be sure there are no influence of possible line delays. (exactly the same observations at 500 kb/s). note: all data is shown in HEX.
1) scope set to read data on rising edge:
- the write command is properly read by the scope as A9 0C 06
- the read command is properly read as AA
- the bytes returned by the LTC3300 are read as 18 OC and this is also what the MCU reads (this is 0C 0D shifted one bit to the left - meaning that it misses the first bit)
2) now same thing with the scope set to read on the falling edge:
- the commands sent by the MCU are obviously garbled
- the bytes returned by the LTC3300 are properly read as 0C 06
3) looking at it more closely:
This trace is a zoom on the end of the read command and the first bits sent by the LTC3300
This confirms that the write command has its bits shifted on the falling edge (purple MOSI)
But the the bits sent by the LTC3300 shift on the rising edge of the clock (dark blue MISO). An even closer look shows that the bit is shifted 140 ns after the rising edge of the clock
I must be doing something wrong somewhere! Would anyone be able to put me on the right track to get that sorted out.
Thank you
added details on what has changed since it was working
[edited by: pjeanmaire@taoperf.com at 5:08 AM (GMT -4) on 7 Apr 2022]