• TI Thinks Resolved

DRV2605L: What Data to Write to Which Registers? (DRV2605L & Devantech USB-ISS Board)

Prodigy 30 points

Replies: 4

Views: 120

Part Number: DRV2605L

Introduction

Hi. I'm a completely blind programmer and ML / DL developer. I've recently started exploring GPIO sensors for a wearable device for the blind that I'm currently developing ...

Summary

I hope somebody can assist me in knowing what data to write to which registers of the DRV2605L. I'm currently stuck at following TI's guide for the DRV2605L Haptic controller. And I'm using this with an ERM mini vibrating disk and a Devantech USB-ISS board on Raspberry Pi 3 model B+ on Raspbian Buster.

Details

Here are the electronic components that I wanted to ask about:

  1. DRV2605L Haptic Controller: http://www.ti.com/lit/ds/symlink/drv2605l.pdf
  2. ERM Mini Vibrating Disk: https://www.adafruit.com/product/1201
  3. Devantech USB-ISS Board: https://www.robot-electronics.co.uk/htm/usb_iss_tech.htm
  4. Raspberry Pi 3 Model B+: https://www.raspberrypi.org/products/raspberry-pi-3-model-b-plus/

And here are the software products that I'm using:

  1. Raspbian Buster OS: https://www.google.com/search?newwindow=1&sxsrf=ACYBGNTsClRFhsZmCuAEp_wRnmf3kfF-VA%3A1568778032342&ei=MKeBXavBFI6soAS94Y0w&q=Raspbian+Buster&oq=Raspbian+Buster&gs_l=psy-ab.3..35i39l2j0l8.19138.21031..21167...0.0..0.94.1148.15......0....1..gws-wiz.......0i131j0i67j0i131i67.wa5iWYsAoF4&ved=0ahUKEwirmeXKudnkAhUOFogKHb1wAwYQ4dUDCAs&uact=5
  2. Python 3.4 (64-Bit): https://www.python.org/downloads/release/python-340/
  3. Python usb_iss Module: https://pypi.org/project/usb-iss/

What I've Done So Far

I did this step-by-step process:

STEP 1. I connected the DRV2605L to an ERM mini vibrating disk. STEP 2. I then connected the DRV2605L to the Devantech USB-ISS board. Note: Another I2C device is connected to the Devantech USB-ISS board, which is the Devantech SRF10 ultrasonic ranger ( https://www.robotshop.com/en/devantech-srf10-ultrasonic-range-finder.html ).

STEP 3. Next, I connected the Devantech USB-ISS board via USB to a Raspberry Pi 3B+ that's running Raspbian Buster. STEP 4. I installed a Python module called usb_iss. And STEP 5. I opened Python 3.4 and wrote the following lines:

Python Code

from usb_iss import UsbIss, defs
iss = UsbIss()
iss.open('/dev/ttyACM1')
>> This is what appeared as the virtual port of the DRV260L as the SRF10 is /dev/ttyACM0
>> And I got this = <usb_iss.usb_iss.UsbIss object at 0x7657b410> 

iss.i2c.read(0x5A,0x00,1) 
>> Parameters are (I2CAddress,Register,Data)
>> I got this = [36]

>> Remove DRV2605L from standby mode as stated in TI's guide
iss.i2c.write(0x5A,0x01,[0x00]) 
>> Parameters are (I2CAddress,Register,[Data])

Problem

But I'm stuck at this point. I can't seem to grasp the rest of the steps in TI's guide (found in their DRV2605L datasheet).

And so using the format of the code above, I'd greatly appreciate some assistance in knowing the registers to write to, and what data to write, in order for me to follow TI's step-by-step guide:

TI's Step-by-Step Initialization & Typical Usage Guide

9.3.1 Initialization Procedure

  1. After powerup, wait at least 250 µs before the DRV2605L device accepts I2C commands.
  2. Assert the EN pin (logic high). The EN pin can be asserted any time during or after the 250-µs wait period.
  3. Write the MODE register (address 0x01) to value 0x00 to remove the device from standby mode.
  4. If the nonvolatile auto-calibration memory has been programmed as described in the Auto Calibration Procedure section, skip Step 5 and proceed to Step 6.
  5. Perform the steps as described in the Auto Calibration Procedure section. Alternatively, rewrite the results from a previous calibration.
  6. If using the embedded ROM library, write the library selection register (address 0x03) to select a library.
  7. The default setup is closed-loop bidirectional mode. To use other modes and features, write Control1 (0x1B), Control2 (0x1C), and Control3 (0x1D) as required. Open-loop operation is recommended for ERM mode when using the ROM libraries.
  8. Put the device in standby mode or deassert the EN pin, whichever is the most convenient. Both settings are low-power modes. The user can select the desired MODE (address 0x01) at the same time the STANDBY bit is set.

9.3.2 Typical Usage Examples 9.3.2.1 Play a Waveform or Waveform Sequence from the ROM Waveform Memory

  1. Initialize the device as listed in the Initialization Procedure section.
  2. Assert the EN pin (active high) if it was previously deasserted.
  3. If register 0x01 already holds the desired value and the STANDBY bit is low, the user can skip this step. Select the desired MODE[2:0] value of 0 (internal trigger), 1 (external edge trigger), or 2 (external level trigger) in the MODE register (address 0x01). If the STANDBY bit was previously asserted, this bit should be deasserted (logic low) at this time.
  4. Select the waveform index to be played and write it to address 0x04. Alternatively, a sequence of waveform indices can be written to register 0x04 through 0x0B. See the Waveform Sequencer section for details.
  5. If using the internal trigger mode, set the GO bit (in register 0x0C) to fire the effect or sequence of effects. If using an external trigger mode, send an appropriate trigger pulse to the IN/TRIG pin. See the Waveform Triggers section for details.
  6. If desired, the user can repeat Step 5 to fire the effect or sequence again.
  7. Put the device in low-power mode by deasserting the EN pin or setting the STANDBY bit.

I'd greatly appreciate your help regarding this. Thank you.

  • Hi, Marx,

    Welcome to E2E and thank you for your interest in our products!

    We have some examples of registers configuration for ERM load. However, you would need to translate it to your programming language (in this case, Phyton).

    DRV2605L_ERM_AutoCalibration.txt

    This is a basic example for an auto-calibration. You should be able to see how the DRV2605L runs the auto-calibration for a small period of time. Your ERM load should work during this period.

    If this configuration works, this would mean that the DRV2605L connections are all correct and we can proceed with another functions such the library effects.

    Please let me know if you have questions or comments on this.

    Best regards,
    Luis Fernando Rodríguez S.

  • In reply to Luis Fernando Rodriguez S.:

    Hi Luis,

    Thanks! But what should I do with the info that you provided in the TXT document?

    a) Should I execute write commands using the registers and the data listed in the document that you gave, one after the other? Or:
    b) Should I try to use the info that you gave to follow the steps in the initialization procedure and the typical usage procedure (which I find very, very confusing)?

    NOTE: I'd really appreciate it if you can give me the step by step commands to execute to complete the initialization and auto calibration and typical usage procedures (I have no problem translating what you give me to Python) ...

    Looking forward to your help. Thank you.

  • In reply to Marx Vergel Melencio:

    Hi, Marx,

    The TXT document contains the registers dump to initialize the auto-calibration. I also prepared the registers commands in the suggested order to perform an auto-calibration and another one that enables the waveform sequencer. I hope you find them useful for your application.

    Please notice that there are some code lines that depend of the ERM characteristics such the Rated Voltage and the Overdrive Clamp Voltage. They must be configured according to the actuator datasheet.

    DRV2605L_Registers_Code_Auto_Calibration_ERM.txt

    DRV2605L_Registers_Code_ERM_Waveform_Sequencer.txt

    Best regards,
    Luis Fernando Rodríguez S.

  • In reply to Luis Fernando Rodriguez S.:

    Thanks, Luis! I'll test these out and will update this thread. Have a great day!  :)