You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi
My car Nexa has only implemented J1979 so I am not able to read raw CAN data using MCP2515 and also with MCP2517FD but with MCP2515 I am able to send requests to CAN like RPM and able to receive responses.
My question is using MCP2517 how can I send the request and receive a response like the below code for MCP2515:
`if (useStandardAddressing) {
CAN.beginPacket(0x7df, 8);
} else {
CAN.beginExtendedPacket(0x18db33f1, 8);
}
CAN.write(0x02); // number of additional bytes
CAN.write(0x01); // show current data
CAN.write(0x0c); // engine RPM
CAN.endPacket();
Hello,
My librairies work only under Arduino, ACAN2515 with MCP2515, and ACAN2517 and ACAN2517FD with the MCP2517FD / MCP2518FD.
What is your system ? If you use an other system and / or other library, I can't help you.
However, the MC2517FD is not compatible with the MCP2515. If your code works with the MCP2515, it will not work with MCP2517FD, you should also change the library.
Pierre
Le 6 janv. 2022 à 15:13, Som4567 ***@***.***> a écrit :
Hi
My car Nexa has only implemented J1979 so I am not able to read raw CAN data using MCP2515 and also with MCP2517FD but with MCP2515 I am able to send requests to CAN like RPM and able to receive responses.
My question is using MCP2517 how can I send the request and receive response like below code for MCp2515:
`if (useStandardAddressing) {
CAN.beginPacket(0x7df, 8);
} else {
CAN.beginExtendedPacket(0x18db33f1, 8);
}
CAN.write(0x02); // number of additional bytes
CAN.write(0x01); // show current data
CAN.write(0x0c); // engine RPM
CAN.endPacket();
// wait for response
while (CAN.parsePacket() == 0 ||
CAN.read() < 3 || // correct length
CAN.read() != 0x41 || // correct mode
CAN.read() != 0x0c); // correct PID
float rpm = ((CAN.read() * 256.0) + CAN.read()) / 4.0;
Serial.print("Engine RPM = ");
Serial.println(rpm);`
—
Reply to this email directly, view it on GitHub <#16>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AEWKZVBP2AZVOT5V5VYZQN3UUWPQJANCNFSM5LMNM36Q>.
Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you are subscribed to this thread.
Hi
My car Nexa has only implemented J1979 so I am not able to read raw CAN data using MCP2515 and also with MCP2517FD but with MCP2515 I am able to send requests to CAN like RPM and able to receive responses.
My question is using MCP2517 how can I send the request and receive a response like the below code for MCP2515:
`if (useStandardAddressing) {
CAN.beginPacket(0x7df, 8);
} else {
CAN.beginExtendedPacket(0x18db33f1, 8);
}
CAN.write(0x02); // number of additional bytes
CAN.write(0x01); // show current data
CAN.write(0x0c); // engine RPM
CAN.endPacket();
// wait for response
while (CAN.parsePacket() == 0 ||
CAN.read() < 3 || // correct length
CAN.read() != 0x41 || // correct mode
CAN.read() != 0x0c); // correct PID
float rpm = ((CAN.read() * 256.0) + CAN.read()) / 4.0;
Serial.print("Engine RPM = ");
Serial.println(rpm);`
The text was updated successfully, but these errors were encountered: