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.

TMS320F28055: SPINTAC-MOTION lost control when SCI interrupts happen

Part Number: TMS320F28055


HI TI,

 How can I set ADC interrupts to highest priority, so that SCI RX interrupt won't effect SPINTAC'S Position Plan when it's in motion?

Is there any other ways that I avoid the conflicts between these two interrupts ?

  • Yes, you can set ADC interrupts to highest priority in the PIE. Please investigate HAL_enableAdcInts() function - you'll see a few function calls that setup the ADC interrupt priority. If you follow ADC_IntNumber_1 to the corresponding enumeration definition, you'll see an enumeration for ADC_IntNumber_1HP. You can see on the PIE interrupt vector table (pg 134 of this doc: www.ti.com/.../spruhe5c.pdf) that the ADC can actually be set to the highest priority interrupt, which corresponds to the enumeration I mentioned. Change the variables passed to these functions as needed. Please also change the CPU interrupt number to the corresponding one for the high priority interrupt.

    Sean
  • Hi Sean,

     I already tried to change the priority to ADCINT9  which is also in group 1 of PIE, but it didn't solve the problem of conflict.

    Other than setting priority, what else can I do to avoid Rx Interrupts to stop my motor movements? 

  • I set up ADC priority to ADC_IntNumber_1HP as followings, but it motor won't be able to initialize. It is the same way I setup ADCINT9, and motor  works fine.But did not solve the conflict problem with SCI RX interrupts. So I am going to give a last try on this.

    static inline void HAL_initIntVectorTable(HAL_Handle handle)
     {
      HAL_Obj *obj = (HAL_Obj *)handle;
      PIE_Obj *pie = (PIE_Obj *)obj->pieHandle;
    
    
      ENABLE_PROTECTED_REGISTER_WRITE_MODE;
    
      pie->ADCINT1_HP = &mainISR;
      pie->SCIRXINTA = &sciarxISR;
    
      DISABLE_PROTECTED_REGISTER_WRITE_MODE;
    
      return;
     } // end of HAL_initIntVectorTable() function
    static inline void HAL_acqAdcInt(HAL_Handle handle,const ADC_IntNumber_e intNumber)
    {
      HAL_Obj *obj = (HAL_Obj *)handle;
    
    
      // clear the ADC interrupt flag
      ADC_clearIntFlag(obj->adcHandle,intNumber);
    
    
      // Acknowledge interrupt from PIE group 10 
      PIE_clearInt(obj->pieHandle,PIE_GroupNumber_1);
    
      return;
    } // end of HAL_acqAdcInt() function

    void HAL_enableAdcInts(HAL_Handle handle)
    {
      HAL_Obj *obj = (HAL_Obj *)handle;
    
    
      // enable the PIE interrupts associated with the ADC interrupts
      PIE_enableAdcInt(obj->pieHandle,ADC_IntNumber_1HP);
    
    
      // enable the ADC interrupts
      ADC_enableInt(obj->adcHandle,ADC_IntNumber_1HP);
    
    
      // enable the cpu interrupt for ADC interrupts
      CPU_enableInt(obj->cpuHandle,CPU_IntNumber_1);
    
      return;
    } // end of HAL_enableAdcInts() function

      // acknowledge the ADC interrupt
      HAL_acqAdcInt(halHandle,ADC_IntNumber_1HP);

    When I setup ADC_IntNumber_1HP, DO I need any extra steps?