Page 1 of 1

Simplest possible setup for Application Development

Posted: Mon 21. Oct 2019, 09:37
by sergio.bobillier
Hello.

I'm new not only to the forum but also to the CAN world. I started working with these tools only a week ago.

I was tasked with creating a piece of software that could send arbitrary CAN messages to a CAN network by using the Peak PCAN-USB Pro. Ideally I would like to use the PCAN Basic API to send a message through channel 1 and receive it on channel 2.

One of my colleagues suggested using a simple cable between the two ports, so that is what we did. We made a serial cable with only the CAN-L and CAN-H pins connected and created a loop between the two ports on the device.

However, this doesn't seem to work, as soon as I try to send anything (from any of the two channels) both of them go into error mode. CAN_Write returns PCAN_ERROR_OK but then I receive two status messages, first one with PCAN_ERROR_BUSLIGHT and the second one with PCAN_ERROR_BUSHEAVY, then nothing, no more messages are received.

I'm not entirely sure but it seems as if the device was not setting the ACK bit causing the message to be re-transmitted multiple times until the error threshold is hit. I tried multiple things: Resetting the channels, setting one of the channels to PCAN_LISTEN_ONLY but I always get the same result.

Now I'm beginning to think that the set-up suggested by my colleague simply doesn't work. So, the question once again: What is the simplest set-up I can have to be able to test my code (send messages through channel 1 and picking them up on channel 2)?

Re: Simplest possible setup for Application Development

Posted: Mon 21. Oct 2019, 11:13
by M.Maidhof
Hi,

a "simple" cable is not enough for a CAN bus system. You need termination resitors (120R) on both ends between CAN-L and CAN-H.

regards

Michael