Hi,
I'm using AN4975 software to excise CAN communication on MTRCKTSPNZVM128 board.
the main function is as follows:
void main(void) {
int id;
unsigned char data[8];
PLL_init();
CAN_init();
CAN_set_rx_callback(&processCANMessage);
EnableInterrupts;
//send a test message
id = 0x5A;
data[0] = 0xBB;
data[1] = 0xDD;
CAN_send(id, &data[0], 2);
for(;;) {
__RESET_WATCHDOG();
}
}
I have connected the J3 jumper ,debug the example code and run it,but I can't see anything on my oscilloscope.
please give me some advice ~~
Hi lama:
Thanks for your response.
I just tested your code ,but I still can't see the waveform.
I detected the voltage of CANH and CANL ,both of them are 2.5V.
Hi,
how do you measure the CANH and CANL?
Have you checked CANTx?
If you have nothing connected to the CAN connector then CAN should be in error passive mode because sending does not receive acknowledge so it tries to send message in a cycle.
If you measure this by multimeter then you will measure average value. You should use oscilloscope to see what is at the pins. At the beginning what you can see at CAN Tx.
I would suggest following procedure I usually use in the case of such issues.
1) Set CAN into loopback mode to be sure your routines are correct. (Receive what you have sent)
2) Switch off loopback mode, disable Rx routine and check whether you have correct signal at the CANTx pin of the MCU. Check bit rate, correct values, frame,...
3) Connect transceiver or measure behavior at transceiver output whether it mirror behavior at CANTx pin.
Best regards,
Ladislav