[info] CAN bus: RX8 cluster

Hardware inside and outside of the ECU
Post Reply
User avatar
AndreyB
Site Admin
Posts: 14327
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

CAN bus: RX8 cluster

Post by AndreyB »

While Chrysler bus is work in progress, my plan C was to use a 2004 RX-8 gauge cluster

It's amazingly beautiful
It's pretty cheap
It seems to be kind of documented

Image

[video][/video]
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: CAN bus: RX8 cluster

Post by kb1gtt »

Does the display have the termination resistor internal to it? Do you measure 120 ohms across terminals J and L? Also do you have a 120 ohm across your end? You will need the 120 ohm at each end of the bus. Your bus is short. If you need to add a 120 to the display, you could probably get by with two paralleled 120's at your end.
Welcome to the friendlier side of internet crazy :)
User avatar
AndreyB
Site Admin
Posts: 14327
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: CAN bus: RX8 cluster

Post by AndreyB »

kb1gtt wrote:Does the display have the termination resistor internal to it? Do you measure 120 ohms across terminals J and L? Also do you have a 120 ohm across your end?
Just checked - yes the cluster has 120 ohm between the CAN wires, and so does my transmitter end.
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
puff
contributor
contributor
Posts: 2961
Joined: Mon Nov 11, 2013 11:28 am
Location: Moskau

Re: CAN bus: RX8 cluster

Post by puff »

speed inconsistency? btw, could it be so that discovery uses 3.3V levels while the cluster requires 5V or even higher?
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: CAN bus: RX8 cluster

Post by kb1gtt »

Is your reference clock XTAL based? CAN can be very picky about having a proper accurate clock.
Welcome to the friendlier side of internet crazy :)
User avatar
AndreyB
Site Admin
Posts: 14327
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: CAN bus: RX8 cluster

Post by AndreyB »

kb1gtt wrote:Is your reference clock XTAL based?
I am using stm32 native, behind the scene CAN peripheral. I am pretty sure it's just some stupid bug, I simply need someone to review the code and spot something off.

Will try googling the exact wiring later, there must be info on which CAN wire is which.
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
puff
contributor
contributor
Posts: 2961
Joined: Mon Nov 11, 2013 11:28 am
Location: Moskau

Re: CAN bus: RX8 cluster

Post by puff »

In order for the dash to work correctly, packets have to be sent regularly (20-500ms)
User avatar
AndreyB
Site Admin
Posts: 14327
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: CAN bus: RX8 cluster

Post by AndreyB »

puff wrote:In order for the dash to work correctly, packets have to be sent regularly (20-500ms)
Sure, the code does that.

Code: Select all

chThdSleepMilliseconds(engineConfiguration->canSleepPeriod);
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
puff
contributor
contributor
Posts: 2961
Joined: Mon Nov 11, 2013 11:28 am
Location: Moskau

Re: CAN bus: RX8 cluster

Post by puff »

btw, have you tried debugging it with logic analyzer? and i still couldnt find if 3v and 5v devices are compatible..
User avatar
AndreyB
Site Admin
Posts: 14327
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: CAN bus: RX8 cluster

Post by AndreyB »

puff wrote:and i still couldnt find if 3v and 5v devices are compatible..
I am not sure this 3v/5v applies here. CAN is CAN, at least I hope so :)
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
puff
contributor
contributor
Posts: 2961
Joined: Mon Nov 11, 2013 11:28 am
Location: Moskau

Re: CAN bus: RX8 cluster

Post by puff »

can't get it what it means - high impedance, low impedance... but when you look at the transceiver pinout, you'll see that it is powered either from 5V or from 3V, which seemingly implies that this voltage levels could be found on the can bus. How does the transceiver sense the lines?
Have you checked what's going on with logic analyzer?
User avatar
AndreyB
Site Admin
Posts: 14327
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: CAN bus: RX8 cluster

Post by AndreyB »

Turned out wrong data in the packet - wrong offsets, also this cluster uses different byte order.

[video][/video]
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
AndreyB
Site Admin
Posts: 14327
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: CAN bus: RX8 cluster

Post by AndreyB »

If anyone is interested - I've paid $30 for the cluster with the piece of harness, I was risking - it has mounting taps broken off and was being sold as "for parts"

Normal eBay price seems to be about ~$50 for cluster and ~$20 for the piece of harness
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
puff
contributor
contributor
Posts: 2961
Joined: Mon Nov 11, 2013 11:28 am
Location: Moskau

Re: CAN bus: RX8 cluster

Post by puff »

User avatar
AndreyB
Site Admin
Posts: 14327
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: CAN bus: RX8 cluster

Post by AndreyB »

[video][/video]
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
puff
contributor
contributor
Posts: 2961
Joined: Mon Nov 11, 2013 11:28 am
Location: Moskau

Re: CAN bus: RX8 cluster

Post by puff »

just got it with harness ~ $40
turns on, with lights.
tomorrow gonna try it with rusefi.
mine has the side gauges reversed: oil stuff is to the left, fuel and temp - to the right.

need to know what is the second, bigger connector - what are these wires.
neet more info on fuel gauge.
need to figure out the odo thing.

people say, CLT needle doesn't react to the actual fluctuations in temerature once it reaches the working conditions, which is weird. the same reportedly refers to oil pressure - it's either no pressure, or normal pressure.

what are these three interior light system wire in the smaller connector?
what is d) (brn/blk) wire in the smaller connector?
how do i switch it from mph to kmh?
puff
contributor
contributor
Posts: 2961
Joined: Mon Nov 11, 2013 11:28 am
Location: Moskau

Re: CAN bus: RX8 cluster

Post by puff »

puff
contributor
contributor
Posts: 2961
Joined: Mon Nov 11, 2013 11:28 am
Location: Moskau

Re: CAN bus: RX8 cluster

Post by puff »

is there a chance to feed some other switched signals to this cluster over CAN?

e.g. oil pressure switch?
traction control (I'd like to indicate diff lock condition instead)
parking brake?
coolant level?

could it switch on the battery light if the engine is running (rpm>0), and the voltage is lower than 13V?
could it switch on the check engine light via CAN, not a separate contact?
are there any chances to implement trip meter? (though, involves too many CAN messages, and probably requires some really fancy maths)
will it feed speed signal from rusefi?
puff
contributor
contributor
Posts: 2961
Joined: Mon Nov 11, 2013 11:28 am
Location: Moskau

Re: CAN bus: RX8 cluster

Post by puff »

If I understand this correctly,

Code: Select all

	commonTxInit(CAN_MAZDA_RX_STATUS_2);
	txmsg.data8[0] = 0xFE; //Unknown
	txmsg.data8[1] = 0xFE; //Unknown
	txmsg.data8[2] = 0xFE; //Unknown
	txmsg.data8[3] = 0x34; //DSC OFF in combo with byte 5 Live data only seen 0x34
	txmsg.data8[4] = 0x00; // B01000000; // Brake warning B00001000;  //ABS warning
	txmsg.data8[5] = 0x40; // TCS in combo with byte 3
	txmsg.data8[6] = 0x00; // Unknown
	txmsg.data8[7] = 0x00; // Unused

	commonTxInit(CAN_MAZDA_RX_STATUS_2);
	txmsg.data8[0] = 0x98; //temp gauge //~170 is red, ~165 last bar, 152 centre, 90 first bar, 92 second bar
	txmsg.data8[1] = 0x00; // something to do with trip meter 0x10, 0x11, 0x17 increments by 0.1 miles
	txmsg.data8[2] = 0x00; // unknown
	txmsg.data8[3] = 0x00; //unknown
	txmsg.data8[4] = 0x01; //Oil Pressure (not really a gauge)
	txmsg.data8[5] = 0x00; //check engine light
	txmsg.data8[6] = 0x00; //Coolant, oil and battery
	txmsg.data8[7] = 0x00; //unused
	sendMessage();
all these values are actually hardware coded - not taking the real-time values :-(

Code: Select all

	txmsg.data8[1] = 0x00; // something to do with trip meter 0x10, 0x11, 0x17 increments by 0.1 miles
isn't it 0.1 kms?
User avatar
AndreyB
Site Admin
Posts: 14327
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: CAN bus: RX8 cluster

Post by AndreyB »

Что-то берётся настоящее, но много не берётся. У меня точно не будет рук делать - принимаю патчи и улучшения!

Code: Select all

	float kph = getVehicleSpeed();

	setShortValue(&txmsg, SWAP_UINT16(getRpmE(engine) * 4), 0);
	setShortValue(&txmsg, 0xFFFF, 2);
	setShortValue(&txmsg, SWAP_UINT16((int )(100 * kph + 10000)), 4);
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
puff
contributor
contributor
Posts: 2961
Joined: Mon Nov 11, 2013 11:28 am
Location: Moskau

Re: CAN bus: RX8 cluster

Post by puff »

вся процитированная тобой часть стоит внутри #if - то есть выполняется только если в системе имеется датчик скорости?
то есть без датчика скорости автомобиля на панели приборов даже обороты отображаться не будут?

плюс почему-то 144 и 154 строки дублируют номер пакета, и после формирования первого пакет так и не отправляется...

вот патчик для температуры и миганий лампочками. правда, собирать не пробовал...


а для одометра нужно будет, наверное, переделать тот коэффициент датчика скорости в более удобоваримое значение (сколько импульсов на метр/километр?), и из кода датчика скорости делать колбеки, что ли? причем только в случае, если выбрана приборка мазды? как иначе заставлять его отправлять can сообщение с меняющимся вторым байтом каждые 33 метра пробега?
Attachments
rx8.patch
(546 Bytes) Downloaded 803 times
puff
contributor
contributor
Posts: 2961
Joined: Mon Nov 11, 2013 11:28 am
Location: Moskau

Re: CAN bus: RX8 cluster

Post by puff »

зато теперь патч, который собирается)
Attachments
rx8.patch
(978 Bytes) Downloaded 749 times
User avatar
AndreyB
Site Admin
Posts: 14327
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: CAN bus: RX8 cluster

Post by AndreyB »

puff wrote:зато теперь патч, который собирается)
Any chance to make this a github pull request? See http://rusefi.com/forum/viewtopic.php?f=13&t=325&p=25517#p25517
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
AndreyB
Site Admin
Posts: 14327
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: CAN bus: RX8 cluster

Post by AndreyB »

Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
Rhinoman
contributor
contributor
Posts: 256
Joined: Thu Sep 24, 2015 2:14 pm
Location: Wiltshire, UK

Re: CAN bus: RX8 cluster

Post by Rhinoman »

puff wrote:can't get it what it means - high impedance, low impedance... but when you look at the transceiver pinout, you'll see that it is powered either from 5V or from 3V, which seemingly implies that this voltage levels could be found on the can bus. How does the transceiver sense the lines?
Have you checked what's going on with logic analyzer?
CANbus is differential but the signal level is only around 2V so it doesn't matter if its 3v3 or 5v supply. The common mode voltage does matter though so you need a good common ground.
puff
contributor
contributor
Posts: 2961
Joined: Mon Nov 11, 2013 11:28 am
Location: Moskau

Re: CAN bus: RX8 cluster

Post by puff »

didn't know that - hadn't checked the voltage with the scope.
so, good ground is a must, even for CAN
Post Reply