...
Any thoughts Liam Hawkins ?
Debugging Jun 6 2020
Going off the last comment of the SPI lines being shorted, I double checked them and they seemed to be fine. No shorts that I could see. I measured the other SPI bus on the carrier (for the Current Sense) and it was not shorted - which seemed like the expected behaviour.
I checked all the pins on the LTC6820 and confirmed that it was only the MISO/MOSI pins that were shorted. Thinking it could be some solder stuck underneath the chip connecting the backs of the pins, I flooded those pins with solder, then removed it using the solder wick. Still shorted.
Poking around the board a little more, I found the culprit. MISO/MOSI on SPI1 are shorted underneath the controller board connector, so that you can only see it if you’re looking at an angle less than about 30 degrees to the horizontal. And it really does just look like flux unless you have the right lighting. I tried to get a picture, but it doesn’t really do it justice:
...
Plugging everything back in, we immediately get data back!
...
But is it the data expected?
We are sending it: 0x00, 0x02, 0x2b, 0x0a which should be the command to read configuration register A, followed by the 2 bytes of the Packet Error Code used to check for data errors.
It sent back:
0xFA, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0x52
Which should be the 6 bytes of data in Configuration Register A followed by the 2 bytes of the packet error code. According to the Validation Page (and the datasheet), this is expected - with only the GPIOs and the DTEN bits set.
And the python script I had created earlier for generating and checking the CRC gives a CRC of 0xC652 for the same 6-byte message so everything is working!
Yay!
Here’s the python program if anyone wants it:
View file | ||
---|---|---|
|
This is the modified smoke_spi main.c I used to get the data:
View file | ||
---|---|---|
|
Now going back to the Plutus code that we were originally trying to run to read voltages: It works!
Code Block |
---|
[0] projects/plutus/src/main.c:19: THIS IS THE START[0] libraries/ms-helper/src/persist.c:112: Found valid section at 0x801f800 (0x10 bytes), loading data
[0] projects/plutus/src/main.c:22: Board type: 0
[0] projects/plutus/src/ltc_afe_fsm.c:65: TRIGGERED CELL CONVERSION SUCCESSFULLY
[0] projects/plutus/src/ltc_afe_impl.c:230: Got cell voltage for cell index: 0 with value 40889
[0] projects/plutus/src/ltc_afe_impl.c:230: Got cell voltage for cell index: 1 with value 40862
[0] projects/plutus/src/ltc_afe_impl.c:230: Got cell voltage for cell index: 2 with value 40590
[0] projects/plutus/src/ltc_afe_impl.c:240: CALCULATING PACKET ERROR CODE (CRC) FOR rev_pec=48032 and data_pec=48032
[0] projects/plutus/src/ltc_afe_impl.c:230: Got cell voltage for cell index: 3 with value 40897
[0] projects/plutus/src/ltc_afe_impl.c:230: Got cell voltage for cell index: 4 with value 41418
[0] projects/plutus/src/ltc_afe_impl.c:230: Got cell voltage for cell index: 5 with value 41621
[0] projects/plutus/src/ltc_afe_impl.c:240: CALCULATING PACKET ERROR CODE (CRC) FOR rev_pec=64312 and data_pec=64312
[0] projects/plutus/src/ltc_afe_impl.c:230: Got cell voltage for cell index: 6 with value 41517
[0] projects/plutus/src/ltc_afe_impl.c:230: Got cell voltage for cell index: 7 with value 41479
[0] projects/plutus/src/ltc_afe_impl.c:230: Got cell voltage for cell index: 8 with value 41443
[0] projects/plutus/src/ltc_afe_impl.c:240: CALCULATING PACKET ERROR CODE (CRC) FOR rev_pec=39510 and data_pec=39510
[0] projects/plutus/src/ltc_afe_impl.c:230: Got cell voltage for cell index: 9 with value 39617
[0] projects/plutus/src/ltc_afe_impl.c:230: Got cell voltage for cell index: 10 with value 41053
[0] projects/plutus/src/ltc_afe_impl.c:230: Got cell voltage for cell index: 11 with value 40681
[0] projects/plutus/src/ltc_afe_impl.c:240: CALCULATING PACKET ERROR CODE (CRC) FOR rev_pec=38042 and data_pec=38042
[0] projects/plutus/src/ltc_afe_fsm.c:79: READING FROM CELLS
[0] projects/plutus/src/ltc_afe_fsm.c:86: RUNNING CELL CALLBACK
|
Comparing to the Keysight U1282A multimeter, all voltages were within 1mV, expect for the top 2 cells (the last 2 printed out) which measured low by the LTC6811 by 1.3mV and 1.6mV respectively.
Overall, voltage reading is a success!
Temperature Readings
-I need to attach some thermistors first…