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: What Data to Write to Which Registers? (DRV2605L & Devantech USB-ISS Board)

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
    Exported at :5/13/2019 10:37:21 AM
    	========Register Dump Start========
    		Reg:[0x0]	=	0xe0		Status
    		Reg:[0x1]	=	0x7		Mode
    		Reg:[0x2]	=	0x0		Real-Time Playback Input
    		Reg:[0x3]	=	0x6		Library Selection
    		Reg:[0x4]	=	0x4		Waveform Sequencer 1
    		Reg:[0x5]	=	0x0		Waveform Sequencer 2
    		Reg:[0x6]	=	0x0		Waveform Sequencer 3
    		Reg:[0x7]	=	0x0		Waveform Sequencer 4
    		Reg:[0x8]	=	0x0		Waveform Sequencer 5
    		Reg:[0x9]	=	0x0		Waveform Sequencer 6
    		Reg:[0xa]	=	0x0		Waveform Sequencer 7
    		Reg:[0xb]	=	0x0		Waveform Sequencer 8
    		Reg:[0xc]	=	0x01		GO
    		Reg:[0xd]	=	0x0		OverDrive Time Offset
    		Reg:[0xe]	=	0x0		Sustain Time Offset, Positive
    		Reg:[0xf]	=	0x0		Sustain Time Offset, Negative
    		Reg:[0x10]	=	0x0		Break Time Offset
    		Reg:[0x11]	=	0x5		Audio-to-Vibe Control
    		Reg:[0x12]	=	0x19		Audio-to-Vibe Minimum Input Level
    		Reg:[0x13]	=	0x64		Audio-to-Vibe Maximum Input Level
    		Reg:[0x14]	=	0x19		Audio-to-Vibe Minimum Output Drive
    		Reg:[0x15]	=	0xff		Audio-to-Vibe Maximum Output Drive
    		Reg:[0x16]	=	0x3d		Rated Voltage
    		Reg:[0x17]	=	0xaa		Overdrive Clamp Voltage
    		Reg:[0x18]	=	0x6		Auto Calibration Compensation Result
    		Reg:[0x19]	=	0xc6		Auto Calibration Back-EMF Result
    		Reg:[0x1a]	=	0x26		Feedback Control
    		Reg:[0x1b]	=	0x93		Control1
    		Reg:[0x1c]	=	0xf5		Control2
    		Reg:[0x1d]	=	0x80		Control3
    		Reg:[0x1e]	=	0x20		Control4
    		Reg:[0x1f]	=	0x40		Control5
    		Reg:[0x20]	=	0x30		LRA Open Loop Period
    		Reg:[0x21]	=	0xce		VBAT Voltage Monitor
    		Reg:[0x22]	=	0x3c		LRA Resonance Period
    	========Register Dump End========
    

    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.

  • 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.

  • 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
    # Register settings for the DRV2605L
    # Settings in format w 5a xx yy
    # Where:
    #	w is a write command
    #	d is a delay command
    #	5a is the DRV2605L I2C address in hex format
    #	xx is the register address in hex format
    #	yy is the register data in hex format
    #
    #
    #
    d 250 		# Delay in us. Wait at least 250us after power up.
    w 5a 01 07	# Auto-calibration mode enabled.
    w 5a 03 01	# ERM Library selected (optional)
    w 5a 04 04	# Waveform Sequencer 1 (optional)
    w 5a 16 53	# Rated Voltage (2 Vrms, depends of the ERM actuator)
    w 5a 17 a4	# Overdrive Clamp Voltage (3.5Vp, depends of the ERM actuator)
    w 5a 1a 27	# ERM Mode selected. Feedback Control.
    w 5a 0c 01	# Go bit enabled

    DRV2605L_Registers_Code_ERM_Waveform_Sequencer.txt
    # Register settings for the DRV2605L
    # Settings in format w 5a xx yy
    # Where:
    #	w is a write command
    #	d is a delay command
    #	5a is the DRV2605L I2C address in hex format
    #	xx is the register address in hex format
    #	yy is the register data in hex format
    #
    #
    ######################## Auto-calibration procedure ########################################
    #
    d 250 		# Delay in us. Wait at least 250us after power up.
    w 5a 01 07	# Auto-calibration mode enabled.
    w 5a 16 53	# Rated Voltage (2 Vrms, depends of the ERM actuator)
    w 5a 17 a4	# Overdrive Clamp Voltage (3.5Vp, depends of the ERM actuator)
    w 5a 1a 27	# ERM Mode selected. Feedback Control.
    w 5a 1d c0	# Closed-loop mode selected
    w 5a 0c 01	# Go bit enabled
    #
    ######################## Waveform sequencer procedure ######################################
    #
    w 5a 01 00	# Internal-trigger mode enabled.
    w 5a 1d e0	# Open-loop mode selected
    w 5a 03 02	# ERM Library selected
    w 5a 04 04	# Waveform Sequencer 1 (strong click)
    d 500		# Optional delay (it may be also configured with registers 0x04 to 0x0b)
    w 51 05 0a	# Waveform Sequencer 2 (double-click)
    w 5a 0c 01	# Go bit enabled
    

    Best regards,
    Luis Fernando Rodríguez S.

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