canbus td, rd pins

24 Jun 2010

I'm putting together a CAN demo with the mbed and a TI CAN transceiver.  I'm not able to receive CAN frames on the PC CAN protocol analyzer.  As an intermediate step, I'm trying to probe the td and rd pins (p29 and p30) on the mbed board.  I'm not seeing any output from the td pin even though it would appear I should see a few transmissions before the error threshold is reached.

Does anyone know what the CAN td pin output should look like on a scope?

Here's the program I'm running: cantest2 and I've listed it below.

Thanks,

Richard

#include "mbed.h"

Ticker ticker;
DigitalOut led1(LED1);
CAN can1(p30, p29);
Serial pc(USBTX, USBRX); // tx, rx

char counter = 0;

void send() {
    static char counter = 0;
    if (can1.write(CANMessage(0x200, &counter, 1))) {
        printf("CanTx--> id: 0x200  dlc: 1  data: %x\n\r", counter);
        led1 = !led1;
        counter++;
    }
}

int main() {
    pc.printf("\nCAN Test\n");
    //250kbit/s
    can1.frequency(250000);
    // every 500ms
    ticker.attach(&send, 0.5);
    while (1);
}

24 Jun 2010
24 Jun 2010

I guess the question more simply is, based on the program listed above, why can I not measure any output from the mbed board pin 29 or 30?

24 Jun 2010

What CAN Transceiver are you using?

24 Jun 2010

The CAN Transceiver turned out to be the problem after all.  I'm using a TI ISO1050 evaluation board that I already had (link).  The problem was that particular board had a 50 Ohm resistor between the transceiver's transmit_in and ground.  Switching to a 200 Ohm resistor solved the problem, and I can measure transmissions and receive CAN messages on the protocol analyzer now.  The lesson here is that it is pretty hard to measure CAN activity without a correctly functioning transceiver.

Richard