LTC6804-1
Production
The LTC6804 is a 3rd generation multicell battery stack monitor that measures up to 12 series connected battery cells with a total measurement error of...
Datasheet
LTC6804-1 on Analog.com
Which demo code are you talking about the linduino one?
For LTC6804 there is example code in the LTSketchbook. LTC6811 is also designed to be a pin compatible upgrade for systems using LTC6804. Also note that we have ADBMS6830B available now which although not pin compatible, has far faster ADCs and is capable of cell balancing up to 300mA without any external transistors.
I am currently using the code provided in the in the LTSketchbook.The issue I am facing is:
ISSUE 1 : When I just put just the wakeup_idle() and no other functions inside the while(1) loop, the WDT pin doesn't get grounded as it continuously receive the wakeup signal but the DRIVE pin becomes 0V as there is no SPI communication.
ISSUE 2 : When I put the wakeup_idle() function along with any other function which includes the SPI communication code like the LTC6804_adcv(), the DRIVE pin gives 5.6V but the WDT pin gets grounded.
Also in both of the above cases the REF1 and REF2 pins remain just 2 to 4 millivolts.
I have connected the WDT pin with a 1M resistor to VREG. The SWTEN pin is connected to ground. ISOMD pin is also grounded.DRIVE pin is unconnected as external 5V from the microcontroller is being provided.
Also the return value of LTC6804_rdcv() is '-1' (pec error).
ISSUE 1 : When I just put just the wakeup_idle() and no other functions inside the while(1) loop, the WDT pin doesn't get grounded as it continuously receive the wakeup signal but the DRIVE pin becomes 0V as there is no SPI communication.
Can you ensure the CS wire of the SPI is connected and that it is set to be active low? The DRIVE pin should be active and WDT low even with just the wakeup pulses.
ISSUE 2 : When I put the wakeup_idle() function along with any other function which includes the SPI communication code like the LTC6804_adcv(), the DRIVE pin gives 5.6V but the WDT pin gets grounded.
WDT pin is an open-drain output, so the WDT pin being grounded means the device is awake (also verified by the DRIVE pin voltage in this case). This is the intended behavior.
VREF1/2 staying low suggests the command sent from the MCU isn't being sent correctly. Is there any raw data from the RDCV? I suspect that some of the SPI wires are flipped preventing both the LTC6804 from receiving the MCU commands and preventing the MCU from receiving LTC6804 data.
I resolved the above issue. But now i am getting Total measurement error (TME) which is causing to read wrong values of voltages and error in the VREF voltage (i.e. should be 3.3V but due to error it is 3.5V at the pin) . Also some times the VREF pin isn't active (0V) could it be due to the biasing capacitors on the VREF or the 5k pullup resistor on SD0.
Do you have a 1uF bypass capacitor on the VREF1 pin with no other loads or connections? VREF2 also needs a 1uF bypass capacitor, but it does allow low current loads such as NTC thermistor pull-up resistors.
An incorrect VREF1 voltage is certainly cause for the TME problems.
Yes, i have put 1uf capacitors at both the reference pins. Have put a single 10k thermistor on the VREF2 pin. No loads or connections on VREF1.
What is the V+ voltage?
VREF1 absolute voltage will vary part to part, but +300mV above spec is indeed a concern:
VREF1/VREF2 will turn off if no measurement is in progress. To keep it on all the time make sure to set the REFON bit in the configuration register group. I suspect you've already done this but it would be useful to know exactly how much outside of the +/-100mV range your VREF1 is.
V+ voltage is at 22V. The REFON bit is set. the voltage at VREF1 is 3.54V and VREF2 is at 3V.
I don't know how but now it is working fine (VREF1 is at 3.14V and VREF2 is at 3V). But still one issue is there, that when the system starts sometime it remains at constant 3V and 3.14V and sometime it return to 0 after some time.
One thing i wanted to ask that i using a stm32 board whose logic level for the SPI communication is 3.3V so should the pullup on the SDO pin be 5k ?.
Also currently i have setup the system on a breadboard and am using 1uf electrolytic capacitors on the VREF pins, should i use ceramic capacitors ?
Also i noticed that when i increased the distance of the capacitors from the VREF pin there were issue...
One thing i wanted to ask that i using a stm32 board whose logic level for the SPI communication is 3.3V so should the pullup on the SDO pin be 5k ?.
5kohm to the MCU 3.3V logic supply should be fine, but depending on the SPI bus length/capacitance you may benefit from reducing the 5kohm pull-up a bit for 1mbps communication.
Also currently i have setup the system on a breadboard and am using 1uf electrolytic capacitors on the VREF pins, should i use ceramic capacitors ?
Yes, ceramic capacitors should be used. That and being on a breadboard both will impact the accuracy of the reference. I wouldn't be too surprised if this plus breadboard inductance lead to reference instability and the higher measured voltage with a DMM
Also i noticed that when i increased the distance of the capacitors from the VREF pin there were issue...
Indeed, in particular it is critical to keep the VREF1 capacitor close to the IC for reference stability.
One thing i wanted to ask that i using a stm32 board whose logic level for the SPI communication is 3.3V so should the pullup on the SDO pin be 5k ?.
5kohm to the MCU 3.3V logic supply should be fine, but depending on the SPI bus length/capacitance you may benefit from reducing the 5kohm pull-up a bit for 1mbps communication.
Also currently i have setup the system on a breadboard and am using 1uf electrolytic capacitors on the VREF pins, should i use ceramic capacitors ?
Yes, ceramic capacitors should be used. That and being on a breadboard both will impact the accuracy of the reference. I wouldn't be too surprised if this plus breadboard inductance lead to reference instability and the higher measured voltage with a DMM
Also i noticed that when i increased the distance of the capacitors from the VREF pin there were issue...
Indeed, in particular it is critical to keep the VREF1 capacitor close to the IC for reference stability.
Again i am facing the issue, the VREF1 and VREF2 pins are not at their ideal values (i.e. 3.15V and 3V respectively), instead they are fluctuating VREF1 is fluctuating in a range 1.5V to 2V and VREF2 0V to 0.5V . What could be the issue.
also currently i am facing the problem while interfacing LTC6804-1 with stm32, but when i interface it with arduino uno it works fine. Could it because of the logic level (i.e. arduino uno's logic level is 5V and STM32's id 3.3V).
But as i am also displaying the cell voltages on an oled display, the cell voltages values displayed on the oled display are correct even when the VREF1 and VREF2 are not at correct voltages.
please do suggest me a solution.
Can you please tell me at what voltage difference between the cells, cells start balancing (i.e. starts discharging the cells)