can bus to instrument cluster, steering rack rx8

This forum is for the discussion of other projects on Megasquirt/Microsquirt hardware that don't fit into any of the other forums

Moderators: jsmcortina, muythaibxr

Post Reply
matthunter1448
Helpful MS/Extra'er
Posts: 140
Joined: Fri Jun 06, 2008 11:15 pm
Location: Spanaway, Wa

can bus to instrument cluster, steering rack rx8

Post by matthunter1448 »

i was wondering if there is anyone on here that could help me try to figure this out and make it work with ms3
the stock rx8 cluster and electronic steering is all can based
the most info i could find on it was here
https://www.cantanko.com/rx-8/reverse-e ... -part-one/
http://www.madox.net/blog/projects/mazda-can-bus/
any body who could help me understand or figure this out would i would be very greatful and possibly willing to pay
jsmcortina
Site Admin
Posts: 39585
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: can bus to instrument cluster, steering rack rx8

Post by jsmcortina »

It might be worth contacting the author of those web pages for more specific information. Reverse engineering CAN to control OEM sub-systems can be a difficult and time-consuming task.

IF you were able to find the CANids and required data, then adding that to the firmware is usually fairly easy.

James
I can repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
matthunter1448
Helpful MS/Extra'er
Posts: 140
Joined: Fri Jun 06, 2008 11:15 pm
Location: Spanaway, Wa

Re: can bus to instrument cluster, steering rack rx8

Post by matthunter1448 »

asked him and his response was


PID 0x201 covers most of the basic functions and has to be refreshed quite regularly (every 50 to 100ms IIRC). Byte 0 controls the rev counter and byte 4 the speedo. I think PID 0x420 byte 0 handles the temperature gauge, but that's from memory :-) Most of what I've done is in the article on my blog (link in the description above) - if you have a rummage through the code you can see how its driving the PIDs for that demo.

It's worth noting, however, that the dash firmware is "clever" (and I put that in quotes specifically) in that it does not echo values it receives over CAN verbatim, rather it will show the temperature increasing until it reaches what it considers normal. At that point it switches into a quite severe hysteresis mode, meaning considerable deviations in temperature up or down are not reflected on the gauge unless they pass pre-determined limits, by which time you've either cooked your engine or knackered it by beating on it whilst it was cold.

It's far from ideal from that point of view, and the oil pressure gauge is the same - a zero on its PID gives you no oil pressure, anything else gives you just-right-of-centre.
muythaibxr
Site Admin
Posts: 8228
Joined: Thu Oct 14, 2004 12:48 pm

Re: can bus to instrument cluster, steering rack rx8

Post by muythaibxr »

Yeah, the coolant gauge on the rx8 is basically useless. It reaches its "warm" position around when the thermostat opens (which is *ok* but doesn't mean the whole engine is actually warm), but it doesn't move from that point until around 230 deg F... which is about 20 deg F too late.

Ken
Megasquirt is not for use on pollution controlled vehicles. Any advice I give is for off road use only.
matthunter1448
Helpful MS/Extra'er
Posts: 140
Joined: Fri Jun 06, 2008 11:15 pm
Location: Spanaway, Wa

Re: can bus to instrument cluster, steering rack rx8

Post by matthunter1448 »

That's OK with me just wanting to make the gauges work
Matt Cramer
Super MS/Extra'er
Posts: 17499
Joined: Thu Apr 16, 2009 8:08 pm

Re: can bus to instrument cluster, steering rack rx8

Post by Matt Cramer »

matthunter1448 wrote:That's OK with me just wanting to make the gauges work
Did you mean "work" like stock, or actually display useful temperature data? :D
Matt Cramer -1966 Dodge Dart slant six running on MS3X
matthunter1448
Helpful MS/Extra'er
Posts: 140
Joined: Fri Jun 06, 2008 11:15 pm
Location: Spanaway, Wa

Re: can bus to instrument cluster, steering rack rx8

Post by matthunter1448 »

Either obviously it would just work like stock but that's fine for just making it work and look normal. I might end up just putting my custom autometer gauges
matthunter1448
Helpful MS/Extra'er
Posts: 140
Joined: Fri Jun 06, 2008 11:15 pm
Location: Spanaway, Wa

Re: can bus to instrument cluster, steering rack rx8

Post by matthunter1448 »

did a little bit of reading and i think this might be most of what's needed for the electronic power steering and cluster

Code: Select all

#include
#include
#include

SoftwareSerial sLCD = SoftwareSerial(3, 6); /* Serial LCD is connected on pin 14 (Analog input 0) */
#define COMMAND 0xFE
#define CLEAR 0x01
#define LINE0 0x80
#define LINE1 0xC0

/* Define Joystick connection */
#define UP A1
#define RIGHT A2
#define DOWN A3
#define CLICK A4
#define LEFT A5

#define CANint 2
#define LED2 8
#define LED3 7

#define NOP __asm__ (“nop\n\t”)

MCP_CAN CAN0(10); // Set CS to pin 10

void setup() {
Serial.begin(115200);
Serial.println(“Init…”);

sLCD.begin(9600);
clearLCD();
sLCD.print(“RX-8 CAN control”);
sLCD.write(COMMAND);
sLCD.write(LINE1);
sLCD.print(“www.cantanko.com”);

Serial.println(“Setup pins”);
pinMode(LED2, OUTPUT);
pinMode(LED3, OUTPUT);
pinMode(CANint, INPUT);
pinMode(UP,INPUT);
pinMode(DOWN,INPUT);
pinMode(LEFT,INPUT);
pinMode(RIGHT,INPUT);
pinMode(CLICK,INPUT);

Serial.println(“Enable pullups”);
digitalWrite(LED2, LOW);
digitalWrite(UP, HIGH); /* Enable internal pull-ups */
digitalWrite(DOWN, HIGH);
digitalWrite(LEFT, HIGH);
digitalWrite(RIGHT, HIGH);
digitalWrite(CLICK, HIGH);

Serial.println(“CAN init:”);
if (CAN0.begin(CAN_500KBPS) == CAN_OK) {
Serial.println(“OK!”);
} else {
Serial.println(“fail :-(“);
while (1) {
Serial.print(“Zzz… “);
delay(1000);
}
}
// Debug: iu

//sLCD.begin(9600);
//clearLCD();
Serial.println(“Good to go!”);
}

unsigned char stmp[8] = {0, 0, 0, 0, 0, 0, 0, 0};
unsigned char otmp[8] = {255,255,255,255,255,255,255,255};
unsigned char statusPCM[8] = {125,0,0,0,156,0,0,0};
unsigned char statusMIL[8] = {140,0,0,0,0,0,0,0};
unsigned char statusDSC[8] = {0,0,0,0,0,0,0,0};
char message[17];

unsigned int i=0;
unsigned int j=0;
unsigned int pid=0;

void loop() {
if(digitalRead(UP)==0) {
Serial.println(“PID cycling”);
for (pid=0x4B0;pid 120) {
statusPCM[0]=0;
j++;
switch (j) {
case (5):
statusMIL[4]=1;
clearAndPrint(” oil pressure”);
break;
case (6):
statusMIL[4]=0;
clearAndPrint(“No oil pressure”);
break;
case (7):
statusMIL[4]=1;
clearAndPrint(” oil pressure”);
break;
case (8):
statusMIL[6]=0b00000010;
clearAndPrint(“Low water MIL”);
break;
case (9):
statusMIL[6]=0b10000000;
clearAndPrint(“Oil presure MIL”);
break;
case (10):
statusMIL[6]=0b01000000;
clearAndPrint(“Bat charge MIL”);
break;
case (11):
statusMIL[6]=0b00000000;
statusMIL[5]=0b01000000;
clearAndPrint(“Check engine MIL”);
break;
case (12):
statusMIL[5]=0b10000000;
clearAndPrint(“Check engine -_-“);
break;
case (13):
statusMIL[5]=0b00000000;
clearAndPrint(“Speedo ramp”);
break;
case (15):
statusDSC[6]=0b00000100;
clearAndPrint(“ETC Disabled”);
break;
case (16):
statusDSC[6]=0b00001000;
clearAndPrint(“ETC Active -_-_-“);
break;
case (17):
statusDSC[5]=0b00000000;
statusDSC[4]=0b01000000;
clearAndPrint(“Brake fail MIL”);
break;
case (18):
statusDSC[4]=0b00001000;
clearAndPrint(“ABS MIL”);
break;
case (19):
statusDSC[4]=0b00000000;
statusDSC[3]=0b00000100;
clearAndPrint(“DSC off”);
break;
case (20):
statusDSC[3]=0b00000000;
clearLCD;
break;
case (21):
clearLCD();
sLCD.print(“RX-8 CAN control”);
sLCD.write(COMMAND);
sLCD.write(LINE1);
sLCD.print(“www.cantanko.com”);
break;
}
}
}
delay(30);
i++;
}
}

if(digitalRead(LEFT)==0) {
Serial.println(“Left: RPM sweep”);
for (i=0;i<129;i++) {
stmp[0]=i;
stmp[4]=i;
Serial.println(i);
for (j=0;j<10;j++){
CAN0.sendMsgBuf(0x201, 0, 8, stmp);
delay(20);
}
}
}

if(digitalRead(RIGHT)==0) {
Serial.println("Right: Fuel sweep");
for (j=5;j<8;j++) {
stmp[3]=0b11111111;
for (i=0;i<256;i++) {
stmp[j]=i;
Serial.print("Byte ");
Serial.print(j);
Serial.print(" bits ");
Serial.print(i, BIN);
Serial.print(" value ");
Serial.println(i);
CAN0.sendMsgBuf(0x212, 0, 8, stmp);
delay(500);
}
}
}
}

void clearLCD(void) {
sLCD.write(COMMAND);
sLCD.write(CLEAR);
}

void clearAndPrint(String text) {
clearLCD();
sLCD.print(text);
}
Post Reply