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.

drv2605l: Having trouble with 3.1.3 Play 3 Waveforms with Delay Using I2C in PDF

Part Number: DRV2605L
Other Parts Discussed in Thread: DRV2605, , TCA9548A

Hi, 

I am fairly new to Arduino and I programmed from 20 years ago.

I and trying to get the drv2605 to accept a delay/pause/timer lib. (what ever works)

***In the section" 3.1.3 tells about using a delay with I2C" of your PDF, I don't understand how I am to implement the delays. It's not clicking with me.

Do I use the writeRegister8(DRV2605_REG_WAVESEQ1, xxx) format?  

I had been trying to use Adafruit's code to control them, but started to use the .cpp file

Can you supply me with an example code to use?

I am using several drv's and would like to have say... two on at all times and 3 to have a delay on/off.

I'm trying to enact a 3 to 10 sec delay, is that possible?

I have everything working in my code except that.

Also I was wondering when I was playing around with the waveseq like below

drv5.writeRegister8(DRV2605_REG_WAVESEQ1, 123); //effect 
drv5.writeRegister8(DRV2605_REG_WAVESEQ2, 7667); //wave

I started noticing that values of 1-9  in waveseq2 (xxxx values) effect the types of  patterns as well. Is this changing the bit waveform, bc it reminds me of a stereo equalizer just with 4 input values.

It would great it you folks can help me out bc I have posted on several forums to no avail.

Thanks alot,

Jim

  • Hi Jim,

    Thank you for posting to the E2E forum. Hopefully we can get you some answers here!
    What document are you referring to when you mention section 3.1.3? I tried looking in the datasheets, but I can't find this reference. I have a feeling this is an Arduino/Adafruit document, which means it’s not really supported by TI.
    Can you not use the delay function in Arduino? I believe it is delay().
    If you are controlling multiple devices, do you have an I2C mux? Or are you writing the same commands to all of the DRV2605L devices?

    The above "drv5.writeRegister8(DRV2605_REG_WAVESEQ2, 7667); //wave" is not a valid write. The waveform sequencer register is an 8-bit register, so the max value is 255 in decimal.
    Our device works such that the waveforms in the waveform sequencer will be played consecutively. First off, there are only 123 waveforms in the library, so the max write value for a waveform is 123 in decimal. When you flip the MSB, starting at 128 decimal, the waveforms are now a delay of 10ms*WAV_FRM_SEQ[6:0], which is the latter 7 bits of data.
    Example: 129d (0x81) = delay of 10ms. 255d (0xff) = delay of 1270ms.
  • Thanks for responding Kelly.. here's the link to the setup guide. www.ti.com/.../sloa189.pdf

    The problem with using the delay function is that is puts everything else on hold. Actually it changes the waveform as well bc of the delaying. The delay starts to run in to each I think, changing the wave.

    I am using the TCA9548A I2C Multiplexer here the link for that. www.adafruit.com/.../2717.

    I do have the waveform library sheet for the 123 waveforms.

    Regarding the drv5.writeRegister8(DRV2605_REG_WAVESEQ2, 7667); I figured it wasn't the correct way to use the function, but it changes scaling of how the waveform is going to react. It's the best I can describe it. For example 7447 gives you two higher peaks (outside numbers) then the two inside are lower intensity... Like I said it reminds me of a equalizer on a stereo. I can do 8765 (sliding down) or 2288 (low,low high,high) or combinations of 4 digits. 5 digits will not do anything.

    As far as the MSB flip, I basically understand what you are trying to say. So 255 or 1270ms is the max delay. I would not be able to combine the values to get a higher delay time, correct? i.e. 255 delay's of 3 (0xff, 0xff, 0xff)

    Regarding the 3.1.3, I gave reference to... When you see that section, how would I write that string of commands? C++ format would work if your unfamiliar with Arduino format they are very similar.

    If I can't get a longer delay from 3.1.3 then how would I use the GPIO in section 3.1.2?

    Code would be great reference.

    Thanks for your feedback

    Regards,
    Jim
  • Hey Kelly, I meant to add .... Is there a simpler list of functions and what they do or any code line examples of what they do. It's hard to understand the data sheets sometimes. most times


    I looked to see what part of the world your in.... Saw you went to school in Knox. I'm about a hour and 1/2 from you east in Johnson City. small world!!!