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.

How to turn off the autoresonance on the DRV2603?

Other Parts Discussed in Thread: DRV2603, DRV2603EVM-CT, DRV2604L, DRV2605L

Hello,

The EVM for the DRV2603 has a mode to turn off the autoresonance for an LRA motor.  However, we don't see in the datasheet how to do that in our design.  How do you turn off the autoresonance?

Thank you

  • Hi, Charles:

    I looked into the firmware of DRV2603EVM-CT. the auto-resonance-off state is a fake state.

    here is the detail:

    when we enter the auto-resonance off mode:

        case BUTTON2:
        {
         Haptics_SendWaveform(lra_alert_dumb); // LRA alert with auto-resonance off
         break;
        }

     

    // Waveform Structure Type Definition

    typedef struct Haptics_Waveform {  

    const unsigned char  outputMode;   // ERM, LRA_AUTOON, or LRA_AUTOOFF (see output modes above)  

    const unsigned char  length;    // size of array in bytes  

    const unsigned char*  data;    // pointer to waveform array data (waveform array is in (amplitude, time) pairs

    } Waveform;

     

    const Waveform lra_alert_dumb = {LRA_AUTOOFF,4,lra_alert_dumb_data};

    void Haptics_SendWaveform(const Waveform waveform)

    {  

    if(playEffect)  {   

    Haptics_HardwareMode(waveform.outputMode); // Set hardware control pins   

    Haptics_StartPWM();       // Start PWM output

      Haptics_OutputWaveform(waveform);   // Control the PWM or I2C

      Haptics_StopPWM();   // Stop PWM output  

    }

    }

     

    void Haptics_HardwareMode(uint8_t outputMode)
    {
     switch(outputMode)
     {
     case LRA_AUTOON:  // LRA with Auto-Resonance
      P3OUT |= 0x01;      // Select LRA Mode on DRV2603
      P2OUT |= 0x40;      // Select LRA on Load Switch
      break;
     case LRA_AUTOOFF:  // LRA without Auto-Resonance
      P3OUT &= 0xFE;      // Select ERM Mode on DRV2603
      P2OUT |= 0x40;      // Select LRA on Load Switch
      break;
     case ERM:    // ERM Mode
      P3OUT &= 0xFE;      // Select ERM Mode on DRV2603
      P2OUT &= 0xBF;      // Select ERM on Load Switch
      break;
     default:   // LRA with Auto-resonance
      P3OUT |= 0x01;      // Select LRA Mode on DRV2603
      P2OUT |= 0x40;      // Select LRA on Load Switch
      break;
     }
    }

    void Haptics_OutputWaveform(const Waveform waveform) {  

    switch(waveform.outputMode)  {  

    case LRA_AUTOON:  // LRA with Auto-Resonance   

    for(k=0; k < waveform.length; k=k+2)   {   

     if(waveform.data[k] == 0x80)     

    P3OUT &= 0xFD;                 //Disable Amplifier    

    else     

    P3OUT |= 0x02;             //Enable Amplifier, Start PWM

             TA1CCR1 = waveform.data[k];     //Waveform*1.625   

             for(j=0;j<waveform.data[k+1];++j)    {     timerdelay(Haptics_resonantModeTick);    }   }  

     break;  

    case LRA_AUTOOFF:  // LRA without Auto-Resonance  

     for(k=0; k<waveform.length; k=k+2)   {   

     if(waveform.data[k] == 0x80)     

    P3OUT &= 0xFD;                 //Disable Amplifier    

    else     P3OUT |= 0x02;             //Enable Amplifier, Start PWM

             for(j=0;j<waveform.data[k+1];++j)    {     

    TA1CCR1 = waveform.data[k];     

    timerdelay(Haptics_dumbModeTick);     

    TA1CCR1 = 255 - waveform.data[k];    

     timerdelay(Haptics_dumbModeTick);    

    }   

    }   

    break;  

    case ERM:  // ERM   

    for(k=0; k<waveform.length; k=k+2)   {    

    TA1CCR1 = waveform.data[k];     //Waveform*1.625    

    for(j=0;j<waveform.data[k+1];++j)   

     {     timerdelay(Haptics_resonantModeTick);    }  

     }   

    break;  

    }

    }

  • Charles,

    To add to Peter's comments, the DRV2603 does not have a specific feature for LRA auto-resonance off; however, for the purposes of comparison on the EVM we chose to emulate an open-loop driver by using the ERM mode and a square wave generated by the on-board MSP430.

    If you need open loop control, I would suggest looking at the DRV2604L (RAM) or the DRV2605L which support open-loop control over I2C or PWM.

    Thanks,
    Brian