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
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.
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;
}
}