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.

TMS570LS3137: DCAN Module message box assigments depending on parity.

Part Number: TMS570LS3137
Other Parts Discussed in Thread: HALCOGEN

Hi All,

I didnt understand Initialize strategy for assigments on dcan module. I guess halcogen  automatically assigned message boxes depending on whether odd or even to IF1 and IF2 registers.

Can I only use IF1 or IF2 registers for assigments? . If i can do that why halcogen generates code like below? Actually no make sense for me.

Best Regards,

Furkan

  • Hi Furkan,

    Can I only use IF1 or IF2 registers for assigments? . If i can do that why halcogen generates code like below? Actually no make sense for me.

    Yes, if you want you can only use either IF1 or IF2.

    The HALCoGen code will generate in such way that, all odd numbered messages will use IF1 and all even numbered messages will use IF2. This is just because to speed up the initialization.

    I mean if you select the all the message numbers sequentially, for example here i am selecting first 4 messages.

    And my initialization code was generated as below:

    And if you verify above code, before using any IF register, we are verifying whether the corresponding IF register set is free to use or not by polling the Busy bit.

    Imagine if you use the same IF register again and again it will take some time to transfer the control data in IF register to the message object location in message RAM right?

    That is the reason to speed up the initialization process, they just using IF1 for odd numbers and IF2 for even numbers.

    And remember this will work only if you select the message numbers in sequentially only, but if you select only even or only odd message numbers again the process will be a bit slow.

    For example, i selected the odd numbers only:

    And you can see my generated code:

    Only IF1 is using now, so my suggestion would be just trying to select message numbers in sequential manner.

    --
    Thanks & regards,
    Jagadish.

  • Hi jagadish,

    Thanks a lot for interest I got the strategy here. In my opinion interesting progress for speed up the module. I have a last question about this module. we have plan to use all message boxes so 64 message box will be selected in the run time. Can I assign 0-32 message box to IF1 register and the rest to IF2 register ? If i use this method can I speed up the process?

    Best Regards,

    Furkan

  • Hi Furkan,

    Can I assign 0-32 message box to IF1 register and the rest to IF2 register ? If i use this method can I speed up the process?

    What you want to do here is not possible with HALCoGen(because as we discussed HALCoGen will generate the code to use all odd numbered message boxes to IF1 and even numbers to IF2) but if you manually write your code then it would be possible.

    Here you should take care one thing i.e. even though you are using first 32 message boxes to the IF1 and rest to the IF2 but in the execution point of view you should place the codes alternatively. I mean that

    Message Box-1 initialization using IF1

    Message Box-33 initialization using IF2

    Message Box-2 initialization using IF1

    Message Box-34 initialization using IF2

    Message Box-3 initialization using IF1

    Message Box-35 initialization using IF2

    .

    .

    .

    .

    Message Box-32 initialization using IF1

    Message Box-64 initialization using IF2

    Because, if your execution flow in this way then if CPU assigning data to the IF2 then in background CAN module will use IF1 control data and will move it to the corresponding message object in the RAM and vice versa.

    --
    Thanks & regards,
    Jagadish.

  • Hi jagadish,

    I understood the process. Thanks a lot for explanation. I will consider your way during development process. 

    Best Regards,

    Furkan