This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

HECC High-End CAN Controller on DM6437

Other Parts Discussed in Thread: MIO, CCSTUDIO

Hi all,

I'm trying to better understand HECC and how it works. I found detailed documentation about it (SPRU981A.pdf) and I'd like to make a simple message transfer over CAN. Problem is that I’m not able to find any example for DM6437 with HECC. I’m aware that using CSL functions(csl_heccAux.h) I should be able to do it but I'm wondering if  there are any drivers based on CSL functions that are more “user friendly”(MIO drivers or PSP). Does it mean that I should make my own HECC drivers for DM6437 using IOMDRV development kit?

In other words, is there anyone with more experience in this area (HECC on DM6437) that can explain me little bit more how I should use HECC?

I’ll appreciate if someone can provide me simple example.

 

  • Currently it looks like the closest there is to an example would be the can_rx and can_tx projects from within C:\CCStudio_v3.3\boards\evmdm6437_v2\tests which you get from the Spectrum Digital target content package available from the SD Support site. However these test cases are really just for board validation and are not using the officially supported PSP though they may help for your case to get started. I believe there is an example in the works that uses the register level CSL included with the PSP, however it is planned to be in the next PSP release 1.10.02.

  • Ok, I found good example in IOMDRV_031709 and I'm able to run it in loopback mode but when I connect it on the real CAN BUS I'm not able to receive any message. This is configuration that I'm using:

     heccSetup.prescalar = 0x1;

     heccSetup.edge_sync_mode = CSL_HECC_SYNC_RISE_FALL;
     heccSetup.sync_jump_width = 0x2;
     heccSetup.sampling_mode = CSL_HECC_ONE_POINT_SAMPLE; 
     heccSetup.time_seg1 = 0x3;
     heccSetup.time_seg2 = 0x2;
     heccSetup.mode = CSL_HECC_HECC;
     heccSetup.data_order = CSL_HECC_DATA_LSB_FIRST;
     heccSetup.global_int_mask = 0x0;  
     heccSetup.global_acc_mask = 0x0;
     heccSetup.acc_mask0 = 0x0;
     heccSetup.acc_mask3 = 0x0;

    According to the equitation that I found in SPRU981a it's 250Mbit/s bit-rate. Any idea?

     

  • Ok, so does it mean that no one has ever worked with HECC on DM6437 or you just don't want to help me????

  • dejan sajic said:
    Ok, so does it mean that no one has ever worked with HECC on DM6437 or you just don't want to help me????

    I must admit that at least I have never worked with the HECC apart from pointing out the examples and reading through the documentation, the CAN interface tends to be more heavily used by automotive and industrial developers who I do not get to work with as much, but we can certainly look into this further.

  • dejan sajic said:
    According to the equitation that I found in SPRU981a it's 250Mbit/s bit-rate. Any idea?

    This sounds like it could be a problem, 250Mbps seems rather high, the CAN protocol kernel claims support of only up to 1Mbps.

    From a more general perspective, do you see any error bits set in the CAN Error and Status Register (CANES)?

  • Ok, then I'll appreciate if you can explain me how to setup 125Mbit/s. According to the equitation

    Bitrate = CAN module system clock/(BRP x BitTime)

    BitTime = TSEG1 + TSEG2 + 1

    BRP is the binary value of BRP + 1.

    System clock should be 27 MHz if I’m right.

    So which value I should put in CANBTC in order to setup 125Mbit/s? I’m not able to understand that equitation. binary value of BRP?

  • dejan sajic said:
    Ok, then I'll appreciate if you can explain me how to setup 125Mbit/s.

    The CAN controller only supports up to 1Mbps, based on what CAN is and is used for I am not sure that there is such a thing as a 125Mbps CAN implementation, perhaps you mean 125Kbps?

    dejan sajic said:
    So which value I should put in CANBTC in order to setup 125Mbit/s?

    Assuming you mean 125Kbps, and you have a 27MHz system clock you could try:

    Bitrate =  CAN system clock / ( (BRP+1) * (TSEG1 + TSEG2 + 1)))
    Picking TSEG1 = 4, TSEG2 = 3 arbitrarily based on the example in section 2.1.2 of SPRU981 we have...
    125000 = 27000000 / ((BRP+1) * (4 + 3 + 1)))
    216 = (BRP + 1) * 8
    27 = (BRP + 1) = BRPcalc
    26 = BRP = BRPcanbtc

    Which means you would setup CANBTC with BRP = 26 (27 calculated), SJW = 2 (3 calculated), SAM = 1 (because it is possible with BRPcalc > 4), TSEG1 = 3 (4 calculated), TSEG2 = 2 (3 calculated), or alternatively expressed as CANBTC = 0x001A029A

    dejan sajic said:
    I’m not able to understand that equitation. binary value of BRP?

    What they mean by "BRP is the binary value of BRP + 1." is that the value of the BRP you calculate is 1 greater than the value of the BRP bit field in CANBTC. You often see this with bit fields that must have a positive value, such that a 0 value in the bit field means you have a baud rate prescaler value of 1 (because a baud rate prescaler value of 0 does not make sense when fed into the bit rate calculations). This same effect applies to the other bit fields in CANBTC as well.

  • Go to this page.

    http://www.port.de/pages/misc/bittimings.php?lang=en

    Then select " TI TMS320 family" and put "27" in clock rate and push "Request Table". Table will show up with 10 to 1000 set up and you can pick up for 125. This should work.

     

     

  • Hi,

    Thanks a lot everyone that was involved in this issue, I appreciate all your help.

    I set up baud rate like Bernie explained and now everything works fine. I’m able to communicate with VectorCAN card using CANBUS.(to send and receive messages up to 500kbps).

  • I am glad to hear it worked, this definatly helps to validate the equations and formation of the register value :), thank you for trying it out and letting the forum know.