Hi,
I am trying to receive CAN frames with a teensy 3.2.
I am using an SN65HVD230D.
There are the 2 120 ohm terminations.
there are 3 nodes (an ECU, a digital dashboard, and my teensy3.2)
the ECU and the dashboard are commercial products (race automotive). They work perfectly with each other.
For the ECU to send these frames, the dashboard sends a request to the ECU (ID 0x80, frame 0-7 = 0x3).
I am using a oscilloscope to see the frames. it is able to decode them.
Frames sent by the ECU start at 0x200. they are well transmitted and appear on the oscilloscope.
My problem :
with my Teensy3.2 I can only receive the frame sent by the dashboard 0x80, but cannot receive the frames from the ECU ??
I am trying to receive CAN frames with a teensy 3.2.
I am using an SN65HVD230D.
There are the 2 120 ohm terminations.
there are 3 nodes (an ECU, a digital dashboard, and my teensy3.2)
the ECU and the dashboard are commercial products (race automotive). They work perfectly with each other.
For the ECU to send these frames, the dashboard sends a request to the ECU (ID 0x80, frame 0-7 = 0x3).
I am using a oscilloscope to see the frames. it is able to decode them.
Frames sent by the ECU start at 0x200. they are well transmitted and appear on the oscilloscope.
My problem :
with my Teensy3.2 I can only receive the frame sent by the dashboard 0x80, but cannot receive the frames from the ECU ??
Code:
#include <FlexCAN_T4.h>
FlexCAN_T4 <CAN0, RX_SIZE_256, TX_SIZE_16> Can0;
CAN_message_t frame;
//static uint32_t id;
//*************************************************************
void setup() {
Serial.begin(115200);
Can0.begin();
Can0.setBaudRate(1000000);
Can0.enableFIFO();
Can0.setMaxMB(16);
Can0.enableFIFOInterrupt();
Can0.onReceive(FIFO, canSniff);
Can0.mailboxStatus();
}
//*************************************************************
void loop() {
Can0.events();
CAN_message_t msg;
if ( Can0.read(msg) )
{
canSniff(msg); // polling
}
}
//*************************************************************
void canSniff(const CAN_message_t &msg) { // global callback
Serial.print("MB "); Serial.print(msg.mb);
Serial.print(" LEN: "); Serial.print(msg.len);
Serial.print(" EXT: "); Serial.print(msg.flags.extended);
Serial.print(" TS: "); Serial.print(msg.timestamp);
Serial.print(" ID: "); Serial.print(msg.id, HEX);
Serial.print(" Buffer: ");
for ( uint8_t i = 0; i < 8; i++ ) {
Serial.print(msg.buf[i], HEX); Serial.print(" ");
} Serial.println();
}
//*************************************************************