Post Go back to editing

CAN1 Transceiver not working, especially with high bit rates

Category: Software
Product Number: ADSP-SC584
Software Version: CCES2.12

Hello everyone,

I am currently working on the CAN communication on my ADSP-SC584 board. I have taken the example from the POST, as there is no device driver for the SC584 for CAN. In the example, a message is sent from CAN0 to CAN 1. This also worked for me, even if the bit timing settings do not match those in the data sheet.
In the data sheet, the rule SJW <= TSEG2 <=TSEG1 applies, but in the example the bit timing is set like this: CAN_TIMING : SJW = 3, TSEG2 = 5, TSEG1 = 2

I found that very confusing.

However, I have adjusted the bit timing so that I get a bit rate of 125kBit/s. In my example, I sent data to my PC once with the CAN0 transceiver and once with the CAN1 transceiver with PCAN-USB. Everything worked perfectly with CAN0 and I was also able to check the bit rate with an oscilloscope.

With CAN1, however, I made some strange observations:
I was able to receive data on my PC at 125kBit/s, but my oscilloscope displayed a bit rate of 180kBit/s and the signal levels generally didn't look clean. I tried to increase the data rate, which CAN1 is supposed to manage up to 1 Mbit/s, but at a rate of 250kBit/s nothing worked anymore.

As in the POST example, I have initialized CAN1 via SPI0 with the CanSpiConfig function, i.e. set the CAN controller to normal mode.
Does anything else need to be configured via SPI? I have set the bit timing settings via the registers *pREG_CAN1_TIMING and *pREG_CAN1_CLK as in the POST example.

Are there any examples where CAN1 works with a high bit rate?

Many thanks for your help

  • Hi Phil, 
    We cross verified the condition SJW <= TSEG2 <=TSEG1, and you are right there is some discrepancy in the POST code CAN configurations.
    We are checking on this discrepancy currently and will get back to you on the same.
    To assist you better can you please provide us more information regarding the CAN0 and CAN1 behavior, are you using only the POST code to verify CAN0 & CAN1 transceiver?
    1. What were the configurations for the CAN clock to arrive different bit rates?
    2. What were the pinouts where you captured the CAN1 bit rates on oscilloscope?
    3. Where you able to check the data from CAN0 after increasing the data rate and were they as expected?
    4. Will you be able to provide probed images of your observations?
    Ranjitha R
  • Hi Ranjitha,

    I created my own CCES project but more or less coppied the parts of the POST example. For example the part with the Configuration over SPI0 for CAN1 is exactly the same and is working fine.

    In my test setup I have the J5 (or J6) Connector connected to my PC with PCAN-USB adapter which comes with the PCAN- View Software. That allows me to capture the transmitted CAN messages from the transceivers.

    1. my clock settings for 125kBit/s are:  

    *pREG_CAN0_TIMING = 0x0225; // t_bit = TQ * (1 + (1 * T_seg1) + (1 + T_seg2))
    *pREG_CAN0_CLK = 79; // TQ = (BRP + 1) / CDU0_CLK04  (100MHz for max core clock)

    *pREG_CAN1_TIMING = 0x0225;
    *pREG_CAN1_CLK = 79;

    2. I attached my probe of the oscilloscope on the CAN High pin directly on the J5 (or J6) connector

    3. the maximum speed of CAN0 is 125kbit/s thats why I want to use the CAN1 controller. When I decrease the bit rate for CAN0, everything was as  expected.

    4. The first image shows CAN0 and the second CAN1. It is noticable that the peak-pead ratio is much higer for Can0 and the signal looks better in general. It is also strange that the bit rate from CAN1 is detected as 172kBit/s, although the timing and clock parameters are exactly the same and the Pcan-Viw software can receive the messages from both transceivers on a bit rate of 125kBit/s.

    Many thanks for your help, this is a challenging problem for me.

    Best Regards,


  • Hi Phil, 
    Please refer to the bare metal and driver example code for CAN transceiver attached below.
  • Hi Ranjitha,

    thanks for the reply.

    there are severel problems with the attached exapmple. 
    This example is old and uses the version with RTOS 10.0.0 and the current Add-In for RTOS uses version 10.4.3. 
    It is also an example for the SC589 and uses the CAN device driver, which is not verified for the SC584. Nevertheless is my iniziallisation part over SPI0 for activating the normal mode for CAN1 controller exactly the same as in this example.
    A loopback example is also not useful, as I only want to know how and whether it is possible to operate CAN1 with a high data rate of e.g. 1MBit/s. 

    Do you have any information for higher datarates on CAN1? Is it verified and even possible? I also tried to configure other parameters over SPI but nothing helps me for better results.

    Thanks for the help

  • Any updates on the issue with CAN1? That would be very helpful for me...