• Resolved

level interrupts in motorware_12

hi:

I don't know why motorware use ADCINT at group10 interrupts verctor. should be at group1?

when I changed cpuHandle,CPU_IntNumber_10) in  HAL_enableAdcInts() to  

CPU_enableInt(obj->cpuHandle,CPU_IntNumber_1);  ,

It doesn't work!  I want chang this ,because I will use other interrupts  in motorware.

Till know , I haven't success configurated PWM_TZINT. any way I try!——

who can tell me how can I use interrupts in motorware12!F28069M

thanks!

  • Till now , I haven't success configurated PWM_TZINT. any way I try!——

  • Yanzhen,

    There are two options for these interrupts.  Group 1 only has ADCINT1, ADCINT2, and ADCINT9.  Group 10 has all 8 ADC interrupts.  Motorware is designed to use group 10 because they need to use all of the different ADC interrupts.  Certainly if you need three high priority ADC interrupts you should use group 1.

    You are looking in the right place.  CPU_enableInt needs to be changed as you have already done, but PIE_enableAdcInt also needs to be changed.  If you dig a little deeper you would find that in /drivers/adc/src/32b/f28x/f2806x/adc.h there are high priority interrupt enumerations that you can use to replace ADC_IntNumber1.  Try using ADC_IntNumber_1HP.

    BR,

    Trey German

    LaunchPad Applications Manager

    If a post answers your question, please mark it with the "verify answer" button.
    Visit these helpful C2000 Links!
    C2000 TI Wiki Pages
    TI Forum Sitemap
    ControlSUITE
    C2000 Getting Started
    CLA FAQs
    Workshop Material!
  • In reply to Trey German289:

    hi:BR

    In motorware , mainISR() should be highest level interrupt in system. because, other peripherals should use lower interrupts resouce.

     I remember it uses group1 in controlsuit . so I need detail process how chang.

    In motorware. other peripherals configurations API less can used. so I must establish them myself. . It hard to me...

    last post I want use PWM_TZINT.  .but fail. In the future I will use SCI. I2C. or capture interrupt. I must know how to use interrupt in motorware. so....I want to know why I was fail..where was wrong!

    can you do PWM_TZINT .? if it is ok. show me!

  • In reply to yanzhen fu:

    Hi: Tray

    I changed these:

    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

    and:

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

    but It doesn't work!

    where place do I need chang also ?

  • In reply to yanzhen fu:

    and:

    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

  • In reply to yanzhen fu:

    Hello Yanzhen Fu,

    Please try:

    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_1);


      // enable the cpu interrupt for ADC interrupts
      CPU_enableInt(obj->cpuHandle,CPU_IntNumber_1);

      return;
    } // end of HAL_enableAdcInts() function

    Also you need to modify the code inside HAL_acqAdcInt() -> I saw that you have modified it.

    But please call  HAL_acqAdcInt(halHandle,ADC_IntNumber_1); instead of   HAL_acqAdcInt(halHandle,ADC_IntNumber_1HP);

     

    Best regards,

    Maria

  • In reply to Maria Todorova:

    hi; Maria.

    thanks your reply. but It doesn't work either. I use hv_kit  try it . I don't know why . can you try it?

  • In reply to yanzhen fu:

    yes,Maria.

    I have done. I changed :

    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 = &mainISR;
      pie->ADCINT_1HP = &mainISR;

      DISABLE_PROTECTED_REGISTER_WRITE_MODE;

    return;

    }

    thanks !

    How about PWM_TZINT? I need API.

  • In reply to yanzhen fu:

    yanzhen fu
      pie->ADCINT_1HP = &mainISR;

    I think you should keep it as pie->ADCINT1 = &mainISR;

     

    Anyway, I will try next week and let you know.

    Best regards,

    Maria

  • In reply to Maria Todorova:

    Hello Yanzhen Fu,

    I have tried to use ADC Int from PIE group 1 (not 10), and I can see that gLEDcnt in expression window (that is put in mainISR) are changing (which means the interrupt occurs). I used my own board (not the controlCard) so I can not see the LED blinking or not (but I am sure it is).

    The modifications are:

    hal.c

    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_1);
        PIE_enableAdcInt(obj->pieHandle, ADC_IntNumber_1HP);     // for testing ADC int

        // enable the ADC interrupts
        ADC_enableInt(obj->adcHandle, ADC_IntNumber_1);

        // enable the cpu interrupt for ADC interrupts
        //CPU_enableInt(obj->cpuHandle, CPU_IntNumber_10);
        CPU_enableInt(obj->cpuHandle, CPU_IntNumber_1); // for testing ADC int

        return;
    } // end of HAL_enableAdcInts() function

    hal.h

    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 = &mainISR;
      pie->ADCINT_1HP = &mainISR;    // for testing ADC int

      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_10);
      PIE_clearInt(obj->pieHandle,PIE_GroupNumber_1); // for testing ADC int

      return;
    } // end of HAL_acqAdcInt() function

    If you have done the same, I don't have any idea why these modifications don't work in your board.

    Hope you can figure it out (ah, sorry, I misunderstood, seems that you have made this working, that's great!)

    Also I have another ISR (SCI and timer2) beside mainISR and they works fine.

    I will try about the TZ interrupt.

    Best regards,

    Maria