Hi all, I am working on a project where I have a Porsche 997 swapped with a 2016 LT1. I have everything up and running at this point with a few details to wrap up before a test drive. I’ll post a link to my build thread on Rennlist for anyone interested.
One of the things I need to do is figure out how to get my gauge cluster to work. Some have used the Porsche ECM, fed it a couple sensors, and they gets most things working. My plan is bypass that entirely, and just pass GM high speed CAN data from the GM controller to the corresponding signals on the Porsche DRIVE CANBus. Macchina M2 is my planned device for this. I am a mechanical engineer, so this is a bit of a weak area for me, but not entirely new. I just haven’t messed with Arduino much before. Another member here pointed me to this product, he used it with his LS swapped 996. I started with his code, and hack some things in here… I’m not sure if I’m even on the right track. I have a lot of learning to do obviously
Starting which his code, he was passing through everything, which is not what I need to do, so I think I need to rearrange my code a bit. I only want to pick and choose certain signals and resend them to a different message, some I will need to edit based on different scaling. RPM is the same at least, so I’m starting with that.
I didn’t include the GM frame or Porsche frame I’m referencing. Not sure if moderators don’t want those shared? I have DBC files for all signals I plan to send.
My build thread:
My code below:
//Reads all traffic on CAN0 and forwards it to CAN1 (and in the reverse direction) but modifies some frames first.
// Required libraries
#include “variant.h”
#include <due_can.h>#include <Arduino.h>
#include <pins_arduino.h>
#include <stdint.h>#include “M2_IO.h”
#include <M2_12VIO.h>M2_12VIO M2IO; //Constructor for the M2_12Vio library
//Leave defined if you use native port, comment if using programming port
#define Serial SerialUSBvoid setup()
{Serial.begin(115200);
M2IO.Init_12VIO(); // Initialise the M2I/O library
M2IO.Setpin_12VIO(1, ON, SOURCE);
pinMode(Led5, OUTPUT); // Set the RED LED PIN as an OUTPUT to enable flasing or Flash ERROR Condition
digitalWrite(Led5, LOW); // turn the RED LED ON by making the PIN LOW// Initialize CAN0 and CAN1, Set the proper baud rates here
Can0.begin(CAN_BPS_500K);
Can1.begin(CAN_BPS_500K);//By default there are 7 mailboxes for each device that are RX boxes
//This sets each mailbox to have an open filter that will accept extended
//or standard frames
int filter;
//extended
for (filter = 0; filter < 3; filter++) {
Can0.setRXFilter(filter, 0, 0, true);
Can1.setRXFilter(filter, 0, 0, true);
}
//standard
for (int filter = 3; filter < 7; filter++) {
Can0.setRXFilter(filter, 0, 0, false);
Can1.setRXFilter(filter, 0, 0, false);
}int RPM = 0;
}void printFrame(CAN_FRAME &frame) {
Serial.print(“ID: 0x”);
Serial.print(frame.id, HEX);
Serial.print(" Len: “);
Serial.print(frame.length);
Serial.print(” Data: 0x");
for (int count = 0; count < frame.length; count++) {
Serial.print(frame.data.bytes[count], HEX);
Serial.print(" “);
}
Serial.print(”\r\n");
}void loop(){
CAN_FRAME incoming;
if (Can0.available() > 0) {
Can0.read(incoming);
if (incoming.id == 0xFF) {
printFrame(incoming);
RPM = incoming.data.bytes[1]};
}
myFrame.id = 0xFF;
myFrame.length = 8
myFrame.data[2] = RPM;
Can1.sendFrame(myFrame);
}
This is the signal I am trying to implement for CAN1, not sure if I set it up right at all (again, frame held out). I believe 18 is a typo, it starts at bit 16 in the other DBC file I have, so I have this entered in as the 3rd byte (2) for where it writes to.