Other Parts Discussed in Thread: BQ76952, BQSTUDIO
Hi All,
I am working to switch communications from I2C to SPI on the BQ76952EVM BMS029B and am running into issues regarding whether the device is in SPI mode. I followed the software development guide and EVM users manual to create my SPI functions, but I am unable to read anything besides garbage using the logic analyzer. Since I have the device which boots into I2C mode, I wrote functions to enable SPI communications and then swap to SPI. Here is what I have done:
1. Set comm type to 0x10 (SPI with CRC) by writing to the Comm Type register (address 0x9239) - taken from EVM users guide
2. Enabled REG0 by setting REG0 config register to 0x01 (address 0x9237) - taken from EVM users guide
3. Enable REG1 by setting REG1 config register to 0x0D (address 0x9236) - taken from EVM users guide
4. Enabled SPI communication by writing 0x60 to the SPI Configuration register (address 0x923C) - taken EVM users guide
5. Configured CFETOFF for SPI CS operation by setting that register to 0x00
6. Configured HDQ pin for SPI MOSI operation but setting that register to 0x00
After these steps, I have read from these registers and verified the correct values using the logic analyzer, just to double check that the device is setting those values in its registers, so everything looks good there.
Lastly, I send the SWAP_COMM_MODE subcommand.
From here, I try to read the device address register, but I am just getting garbage on the logic analyzer. I completely remove the wires connecting to the external I2C J17 and also the jumpers on J15 and J18, so the bus lines should only have SPI traffic. This is all after verifying correct I2C operation using the logic analyzer.
I have also tried just using the SWAP_TO_SPI() subcommand but that does not work either, and am still reading garbage on the logic analyzer.
I2C communication works seamlessly and I am able to read voltages, status registers, device id, and everything else, but we need to be using SPI for our application.
Is there anything that I am missing? I am using the evaluation module and am wondering if I missed a jumper somewhere or something, or I missed a config setting. I have been through the TRM, EVM users guide, and software dev guide over and over. Any help is greatly appreciated. Thank you!
Sincerely,
Kyle Garland