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.

DRV2605: Clearing the GO bit

Other Parts Discussed in Thread: DRV2605L, DRV2605

Hello y'all,

we are developing consumer electronics that include a ERM motor, which buzzes periodically with a defined time interval (like a metronome). The motor is controlled with the DRV2605L in internal trigger mode over I2C, playing haptic effects from the ROM libraries.

I encountered a bug in our firmware: When the interval is considerably small, only every second iteration the motor buzz will be triggered. I suspect that this is happening because at the time I trigger a new haptic effect, the old effect is still being played. Instead of cancelling and playing back the new effect, the DRV2605 ignores the I2C commands to trigger a new effect.

After some investigation and reading the datasheet again I found that I have to clear the GO bit to cancel the current haptic effect and then trigger the new one. However, when I write a 0x00 to address 0x0C (the GO bit address), nothing happens, and the GO bit stays asserted. I tried continuously writing the value in a while loop, and it sometimes takes longer or less long until the command is actually written.


I am wondering what I am missing?

All the best,

Julian

Here's the I2C commands I am sending to play a haptic effect.

    // Assert EN
    DRV_EN_Write(1);
    
    // De-Assert STANDBY if was asserted / Set MODE to ACTIVE=0x00
    IICwriteByte(DRV2605_ADDR, ADDR_MODE, MODE_ACTIVE);
    
    // set library (optional)
    IICwriteByte( DRV2605_ADDR, ADDR_LIBRARY,		library );
    
    // write waveform ID to 0x04 register (or write mltiple as a sequence from 0x04 to 0x0B)
    IICwriteByte( DRV2605_ADDR, ADDR_WAV_SEQ1,		effect );
    IICwriteByte( DRV2605_ADDR, ADDR_WAV_SEQ2,	        0x00 );
    
    // clear the GO BIT if was asserted
    goBit = I2C_ReadOneByte( DRV2605_ADDR, ADDR_GO ) & 0x01;
    printf("playEffect GO\tBEFORE : %d\t", goBit);

    if (goBit == GO) {

        while (goBit != STOP) {
             IICwriteByte( DRV2605_ADDR, ADDR_GO,       STOP );
             goBit = I2C_ReadOneByte( DRV2605_ADDR, ADDR_GO ) & 0x01;
             printf("GO is %d\r\n", goBit);
        }

    }

    // Set GO bit
    IICwriteByte( DRV2605_ADDR, ADDR_GO,			GO );

  • Hi Julian,

    Thanks for using the DRV2605L! Let me see if I can help you with a few debug steps.

    1. Is your EN pin high when you are writing I2C? It must be high for I2C to be read correctly.
    2. Is the capacitor on VREG 1uF?
    3. Can you please provide some scope shots showing the I2C either ACK or NACK?

    Thanks,
    Brian
  • Hi Brian and thanks a lot for your answer.

    The EN pin should be high indeed, and the capacitor on VREG is 1uF.

    I am trying to get the shots, but I am currently without that equipment in the field (around Hong Kong). I guess by looking at your answer, there is nothing obvious wrong with my code? And de-asserting the GO bit before triggering a new effect is the way to go?


    Best,

    Julian

  • Hi, Julian:

    Yes. it is the right way to go.
    I am curious what really happened. I never heard this issue before.