Problematic 83.3k canbus in Jeep

Introduction and miscellaneous that we haven't created categories for, yet
Post Reply
raine
Posts: 37
Joined: Sun Jun 27, 2021 10:35 am
Has thanked: 6 times
Been thanked: 6 times

Problematic 83.3k canbus in Jeep

Post by raine »

Hi, I am loosing my faith with the topic of hooking into Jeep Patriot interior canbus with 83.3kbs. The bus seem to be very picky and I have tested many different boards without luck to it.

My objective is to have 3 channel bridge device with two at 83.3k and one 500k speed. My intention is to alter some messages coming from ecu for engine rpm to instrument cluster. Planning to have this gauge to show power draw from bms.

My preferred board is Teensy 4, but no luck with it. The board with tranceivers work just nice with other speeds and even with the 83.3k speed while seeing the traffic with pcan viewer. But while plugging it into the car bus, the car bus goes silent. I have tested polarity of the can L/H and also with and without termination resistor. No luck. Same board works just fine with other speed buses.

Also tried Canbed dual from Longan/Seeedstudio. No luck. This seem to be really buggy board. Nobody has got it working according to their forum. Although, it is nice board and very affordable. Perhaps too cheap with the cost of quality.

The third one I tested was regular arduino with mcp2515. This worked well in all the other networks, except Jeep’s one.

The only working canbus interface so far is Longan made i2c canbus adapter. It seem to work and not interfere Jeeps own traffic. In my test setup, it was hooked to Wemos D1 mini and works well.

I am feeling lost with the case. All tips are very much welcomed and also recommendations for the Arduino ide compatible 3-way canbus setups.

Thanks.
User avatar
EV_Builder
Posts: 1199
Joined: Tue Apr 28, 2020 3:50 pm
Location: The Netherlands
Has thanked: 16 times
Been thanked: 34 times
Contact:

Re: Problematic 83.3k canbus in Jeep

Post by EV_Builder »

With the peak (which version?!?) you often choose self sampling timing. It's important that those timing settings are correct. I think that if you assign that "odd" speed in the microcontroller the timing is off. It also might be that the bus isn't 83.3 but 100K or more common 125K.

I assume you don't have diagnostic tools so allot of 'trying'...

Approach: use the pcan to determine the real settings timing and baudrate.

1) try 125K
2) try 100K
3) apply settings to microcontroller;
Converting an Porsche Panamera
see http://www.wdrautomatisering.nl for bespoke BMS modules.
raine
Posts: 37
Joined: Sun Jun 27, 2021 10:35 am
Has thanked: 6 times
Been thanked: 6 times

Re: Problematic 83.3k canbus in Jeep

Post by raine »

Hi, thanks for the suggestions. I was also (still am) considering if the baudrate was wrong. Internet is suggesting it may be 125k. Unfortunately, I was not able to have Pcan-view (version 5.0.2.838 64bit) recognize the traffic with any other speed than 83.3k. And Linux can utils (candump) also works with the same speed. These are the (default) settings the bus is listened succesfully with 83.3kbit speed.
pcanview.png
User avatar
EV_Builder
Posts: 1199
Joined: Tue Apr 28, 2020 3:50 pm
Location: The Netherlands
Has thanked: 16 times
Been thanked: 34 times
Contact:

Re: Problematic 83.3k canbus in Jeep

Post by EV_Builder »

Well if you are confident that's correct, and i must admit you got good reasons. Then you need to add this speed to the devices you mentioned. Maybe they don't support this speed. How do you configure them anyway?
Converting an Porsche Panamera
see http://www.wdrautomatisering.nl for bespoke BMS modules.
raine
Posts: 37
Joined: Sun Jun 27, 2021 10:35 am
Has thanked: 6 times
Been thanked: 6 times

Re: Problematic 83.3k canbus in Jeep

Post by raine »

Teensy flexcan library should support 83333 speed. And this can be verified with Pcan-view. Sample code I am using with Teensy 4 is as following:

Code: Select all

#include <FlexCAN_T4.h>

FlexCAN_T4<CAN1, RX_SIZE_256, TX_SIZE_16> can1;
uint8_t i;

void setup(void) {

  pinMode(2, OUTPUT); digitalWrite(2, LOW); /* optional tranceiver enable pin */
  pinMode(3, OUTPUT); digitalWrite(3, LOW); /* optional tranceiver enable pin */
  can1.begin();
  can1.setBaudRate(83333);
  can1.enableFIFO();
  can1.enableFIFOInterrupt();
  can1.onReceive(FIFO, canSniff20);
  can1.mailboxStatus();
}


void canSniff20(const CAN_message_t &msg) { // global callback
  Serial.print("T4: ");
  Serial.print("MB "); Serial.print(msg.mb);
  Serial.print(" OVERRUN: "); Serial.print(msg.flags.overrun);
  Serial.print(" BUS "); Serial.print(msg.bus);
  Serial.print(" LEN: "); Serial.print(msg.len);
  Serial.print(" EXT: "); Serial.print(msg.flags.extended);
  Serial.print(" REMOTE: "); Serial.print(msg.flags.remote);
  Serial.print(" TS: "); Serial.print(msg.timestamp);
  Serial.print(" ID: "); Serial.print(msg.id, HEX);
  Serial.print(" IDHIT: "); Serial.print(msg.idhit);
  Serial.print(" Buffer: ");
  for ( uint8_t i = 0; i < msg.len; i++ ) {
    Serial.print(msg.buf[i], HEX); Serial.print(" ");
  } Serial.println();
}
 
void loop() {
  CAN_message_t msg1;
  msg1.id = 0x7df;
  msg1.buf[0] = i++;
  can1.write(msg1);
  delay(100);
}
The weird thing is, no matter if the Teensy is powered or not, connecting the Teensy can wires, the car bus goes silent. Unfortunately, my oscilloscope is very old school CRT one and I cannot get clear view to the waveforms or levels. Need to get access to a better scope next.
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 349 times

Re: Problematic 83.3k canbus in Jeep

Post by Pete9008 »

Would be worth trying your code without transmitting anything in the loop. CAN transcievers have a nasty habit in that if they don't get an ack on the message (either because of a buad rate, config error or bus pronlem) they can continually retransmit and hog the bus which could be what is causing the bus to go silent (that's assuming by silent you mean not working rather than having no CAN transactions visible on it when looking with the scope).

Edit - although if it does it when the teensy isn't powered the above wouldn't explain it. Causing the bus to hang when powered down suggests a bus loading problem, are you adding an additional termination on the teensy?
raine
Posts: 37
Joined: Sun Jun 27, 2021 10:35 am
Has thanked: 6 times
Been thanked: 6 times

Re: Problematic 83.3k canbus in Jeep

Post by raine »

Yes, this led me to the right direction. I started to measure different tranceivers I have at hand and as I was not adding any terminators myself, I finally found out, that all my Teensy tranceivers included terminators. While unsoldering the terminator out, I managed to have it working.

So case closed for now. A painfull journey that turned to be just the matter of termination resistors. Thanks for the help, this community is awesome.
Post Reply