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/TMS320F28027F: Additional Interrupt to main ISR

Part Number: TMS320F28027F

Tool/software: Code Composer Studio

Hi Folks,

i have been implementing a motor drive that locks to a reference signal based on an additonal phase loop on top of the speed loop mostly based on the lab11b example. It works but there is still some phase jitter left. This is mainly because i sample the reference signal and the phase error with the main_ISR frequency of 15kHz. For optimization i want to implement another ISR that runns maybe at twice or even 4x the speed of the main_ISR. But im not sure if this is even possible. It seems that all three timers are already in use as you can see in the hal.c file. I also have been looking on the CPU timer examples given, but those seem to use somewhat different library files. Is there any easy way to set up a new handle for that?

Thank you upfront,

Fabian

  • You can use CPU timer or other remain PWM timer to set a fast interrupt, but you can't add too much code in this ISR to occupy CPU bandwidth, otherwise this will affect motor control.
  • Thank you, that sounds good. I have been trying to migrate the CpuTimer example into the InstaSpin project but i'm getting tons of errors like:

     undefined      first referenced      
      symbol            in file           
     ---------      ----------------      
     _CpuTimer2Regs ./f2802x_cputimers.obj

    error #10234-D: unresolved symbols remain
    error #10010: errors encountered during linking; "proj_lab11b.out" not built

     even with all headers and c files included.
    Is there a short snippet that i can use to do the ISR setup in the main.c? The HALayer is nice but i have no idea of how to include the new ISR into that.
    Thank you,

    Fabian

  • Ok i fixed that. It was due to bad library linking. The cpu timer works.
    Anyway, the problem is now, that the interrupt is getting delayed by the main ISR. Is it possible to change the interrupt priority to make that happen in real time? This would be essential for me to make precise measurements. The only thing that is going to happen in the custom ISR two GPIO reads and increasing a value so not much time is spent there.

    Thank you so much,

    Fabian
  • Ok this did not work the way i wanted it to.
    The custom ISR is really affecting the regulation in a bad way. Is it possible to use the eCAP module to read the pulsewidth of a signal? i have only seen it counting rising edges.
    What i need would be to count while the signal is high.
    Is there a way to do that?