How to Connect Multiple I2C Devices to Devantech USB-ISS (Not Enhanced Version)?

Hello everyone. I’m new here, and I hope someone can help me with my inquiry. :slight_smile:
I’ve searched the forums but can’t seem to find what I’m looking for … :frowning:

I have a Devantech USB-ISS; and
I use this to connect my SRF10 ultrasonic sonar sensor to my PC and Raspberry Pi (sorry for not linking the SRF10 sonar sensor as I’m only allowed to include 2 links in my posts here because I’m new) …

And my questions are:

  1. Can I connect multiple I2C devices to the Devantech USB-ISS?; and
  2. If yes, then how can I connect this haptic micro controller while the SRF10 sonar sensor is also connected to the Devantech USB-ISS?

I do hope someone can guide me to the right documentation. Also:
I’m completely blind but have someone to describe me photos and images, — I’m unable to include photos in this thread at the moment because everyone’s asleep. :frowning:

Please kindly advise. Would greatly appreciate your help. Thanks in advance! :slight_smile:

Hi @MXGray and welcome to the RobotShop community :grinning:

The answer to your question is: Yes! you can connect multiple devices to the Devantech USB-ISS :slightly_smiling_face:

I’m not sure what you mean with “Not enhanced version” but any device that works with the I2C protocol allows to connect multiple slaves to a single master or even multiple masters controlling single or multiple slaves. You can find more information about how this communication protocol works here and here. In those links, you will also find how to connect multiple slaves (the SRF10 and the motor controller) to one master (the Devantech USB-ISS), like this:

image

It is as simple as connecting all of the SDA pins together, and all of the SCL pins together. The image also shows the pull-up resistors but you don’t need to add those because the technical specification of the Devantech USB-ISS states:

The USB-ISS module is always a bus master, and is fitted with 4.7k pull-up resistors on the PCB.

I hope that information is enough to solve all your doubts, but in case you come up with any other questions don’t be afraid to ask :grin:

1 Like

Thanks a lot, @geraldinebc15! :slight_smile:
I’ll carefully review these linked pages and will also ask someone here to describe the photo to me later this morning; and
I’ll then update this thread and share my experience. Cheers!

P.S. I think this enhanced USB-ISS is different from this non-enhanced USB-ISS?

Hi everyone. Just got back to working on this (got caught up with a lot of other things); and
I’m back again with a few questions. Hoping for some help and guidance. :slight_smile:

I properly connected the mini vibrating disk (ERM) and the DRV2605L controller to my Devantech USB-ISS by following this here >> http://www.ti.com/product/DRV2605L
But when I run the code below, I always get an error that says “Received NACK instead of ACK”:

from usb_iss import UsbIss, defs
iss = UsbIss()
iss.open(“COM7”) # On Windows 10 with Python 3.5
#iss.open(’/dev/ttyACM0’) # On Raspbian Buster
iss.setup_i2c()

iss.i2c.read(0x5A,0x00,1) # 0x5A is factory I2C address of DRV2605L, 0x00 is register for status

[255]

iss.i2c.write(0x5A,0x01,[0x00]) # 0x01 is reg mode and 0x00 is to initiate DRV2605L

This results to the error, which says ‘received NACK instead of ACK’

I tested many registers and what to write based on the data sheet above, but still:
;( All I get is the error that says ‘received NACK instead of ACK’ …

What could be the problem?
Is my DRV2605L broken?
My SRF10 that’s simultaneously connected to the same USB-ISS board is working fine …

Please advise. Would greatly appreciate your help. Thanks! :slight_smile:

Hello @MXGray !

Sorry to hear about your problem. I found a discussion thread in this forum where they talk about your problem, you should review it to get some ideas about possible solutions.

Briefly, there are two different cases to consider for ACK/NACK:

  • After sending the slave address: when the I2C master sends the address of the slave to talk to (including the read/write bit), a slave which recognizes its address sends an ACK. This tells the master that the slave it is trying to reach is actually on the bus. If no slave devices recognize the address, the result is a NACK. In this case, the master must abort the request as there is no one to talk to. This is not generally something that can be fixed by retrying.
  • Within a transfer: after the side reading a byte (master on a receive or slave on a send) receives a byte, it must send an ACK. The major exception is if the receiver is controlling the number of bytes sent, it must send a NACK after the last byte to be sent. For example, on a slave-to-master transfer, the master must send a NACK just before sending a STOP condition to end the transfer. (This is required by the spec.)

I hope this could help you. :grin:

1 Like

Hi. Thanks for that! :slight_smile:

Upon further digging, now I’m not getting the “received NACK instead of ACK error” — What I did was:

  1. Ran dmesg | grep tty* in the terminal (Raspbian Buster);
  2. Noticed that there were two I2C ports, namely ACM0 and ACM1 — ACM0 is the SRF10 ultrasonic sensor that’s connected to the USB-ISS, while ACM1 is the DRV2605L controller that’s also connected to the same USB-ISS board; and
  3. So instead of iss.open(’/dev/ttyACM0’), I use iss.open(’/dev/ttyACM1’) and also removed the iss.setup_i2c() line …

And when I check the status by reading from register 0x00 of the DRV2605L (i2c address is 0x5A) — I get the correct status; and
When I write to the reg_mode register (0x01), I get to change the DRV2605L’s mode …

I also did some experimenting, and I don’t get the “received NACK instead of ACK” error …

But still, I’m stuck — I can’t figure out how to write (and read) the right data to the right registers to make the DRV2605L work. :frowning:

All sample code that I could find are for Arduino; and
There are Python implementations, but it also assumes you’re using an Arduino to control the DRV2605L. :frowning:

Plus, I tried figuring out the Python code so I can find the right data to write to the right registers and get the thing to work; BUT
Still, no luck. :frowning:

@everyone — I’d greatly appreciate all the help I could get. Thanks in advance! :slight_smile:

I contacted TI’s technical support team; and
I’m still waiting for their response— Here’s what I sent to them:

Start of My Support Request

I’d greatly appreciate your assistance regarding my step-by-step process for using your DRV2605L ( http://www.ti.com/lit/ds/symlink/drv2605l.pdf ) …
I did this step-by-step process:

STEP 1. I connected the DRV2605L to an ERM mini vibrating disk ( https://www.adafruit.com/product/1201 );
STEP 2. I then connected the DRV2605L to the Devantech USB-ISS board ( https://www.robot-electronics.co.uk/htm/usb_iss_tech.htm );
Note: Another I2C device is connected to the Devantech USB-ISS board, which is the Devantech SRF10 ultrasonic ranger …

STEP 3. Next, I connected the Devantech USB-ISS board via USB to a Raspberry Pi 3B+;
STEP 4. I installed a Python module called usb_iss; and
STEP 5. I opened Python and wrote the following lines:

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

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 your guide

iss.i2c.write(0x5A,0x01,[0x00]) # Parameters are (I2CAddress,Register,[Data])

But I’m stuck at this point. I can’t seem to grasp the rest of the steps in your guide (found in your DRV2605L datasheet); and

So using the format of the code above, please kindly let me know the registers to write to and what data to write, in order for me to do your guide here:

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.

End of My Support Request

Hope somebody here could also assist me. I’d greatly appreciate any help that I could get. Thanks! :slight_smile:

1 Like