I'm currently running an Outlander pack for my project, I have CAN communication between my BMS and the 10x CMUs from the Outlander.
I have removed the ANO wiring from the CMU harness as I don't have the Outlander BMS.
I have shortened the CTR (termination resistor) wiring from CMU #7, and spliced it into the CANH/L wiring near to the connector for this CMU.
My BMS communicates through a MCP2515, 16MHz crystal, and a MCP2562 transceiver. My microcontroller is a Teensy 3.2.
My initilisation code is below:
Code: Select all
MCP_CAN CAN3(20);
void setup_cmu_can3()
{
if (CAN3.begin(MCP_ANY, CAN_500KBPS, MCP_16MHZ) == CAN_OK)
{
can3_good = 1;
CAN3.setMode(MCP_NORMAL);
}
}
Code: Select all
byte cmu_len;
byte char cmu_incoming[8];
int cmu_id;
if (!digitalRead(16))
{
for (int x = 0; x < 8; x++)cmu_incoming[x] = 0;
CAN3.readMsgBuf(&cmu_id, &cmu_len, cmu_incoming);
Serial.print("CAN: 3"); ;
Serial.print(" ID: ");
Serial.print(cmu_id, HEX);
Serial.print(" DLC: ");
Serial.print(cmu_len);
Serial.print(" Data:");
for (byte i = 0; i < cmu_len; i++)
{
Serial.print(cmu_incoming[i]);
Serial.print(", ");
}
Serial.println();
}
However, when connecting a second CMU, the data changes to read "255,253" for each voltage reading. This does not appear to be corruption - the values are consistent. It almost looks like an error state from the CMU.
Does anyone have any suggestions here? Have I messed something up with either the wiring or the code?