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.

CCS/TMS570LC4357: RTI + CAN1 Interrupt

Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN

Tool/software: Code Composer Studio

Hello TI Team,

I have a RTI setup on counter 0 for a 50ms IRQ interrupt. I also have Halcogen setup to have an interrupt on CAN1 on one IRQ 20ms CAN message. They work well individually however when I have both together my program no longer functions. My first thought was that perhaps I am having nested interrupts. I went ahead and at the start of of the CANnotification and rtinotification function I _disable_IRQ_interrupt_() and at the end of the notification routine _enable_IRQ_interrupt(). However this does not help the issue. 

Inside Halcogen for the RTI1 Counter0 I set the RTU source configuration -> 0

   RTI1 Compare I set Compare 0 Period -> 50 (ms)

Am I not disabling and re-enabling the interrupts appropriately?

Did I not set the RTI1 properly where the interrupt is occurring much faster than I expect?

Robert

  • Hello Robert,

    So, each is working independently but not when you combine them? Are you getting any interrupts at all when you combine them? Even one? Can you set break points in each ISR and see if you are getting to one or the other? Note that I would remove any IRQ enable/disable calls you have put in place from your independently working code at this point.

    Can you describe what is happening in your code that you have described as not working at all? Is it dropping through to a while(1) loop or is getting an exception or what? More information would be helpful in debugging.

    If you think you aren't getting the right period on your RTI, can you add a GIO toggle to it and measure with a scope to verify the timing? A 50uS ISR may well be suppressing the CAN interrupt. Can you check to see if the CAN message was received after running for sufficient amount of time without getting the interrupt? Is the CAN flag set? Is CANRx data in the mailbox?
  • Hello Chuck,

    It looks like it works now. I changed the RTI period to be appropriate. Also in my CAN interrupt in the beginning I stop the RTI timer and restart it at the end of the processing.

    How do I disable CAN interrupts?. Under certain error conditions I need to engage a motor provide a clamp force to prevent motion. This can take 2 seconds.

    Robert Liu
  • Hello Robert,

    Please see section 27.10 Interrupt Functionality in the DCAN chapter of the technical reference manual.

    IE0 and IE1 bits are used to enable and disable the interrupts. These bits are located in the DCAN CTL register (see setion 27.17.1 of the TRM). Note that there are cautionary notes about changing the CAN control register during active communications which you should review and be aware of. Please review the TRM to understand the proper procedures to follow when making updates to the CAN Ctl register.