This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How use usb data line without usb core

Hi, Nordic! We have connected gpio pins to usb data line pins for using usb or i2c in different times. But even if USB core disconnected, usb lines hinder for i2c lines. Is it possible connect usb d+ and d- to GPIO?

usb i2c connection

Parents
  • Hello Vlad

    As RK has stated none of the GPIO of the nRF52840 supports USB, and the USB pins are exclusively used for USB. So if you want to use the GPIO for USB do that you would have to bitbang it somehow, though I'm not sure if that would be possible.

    Unfortunately we do not have any examples or reference code for something like this. I have seen people claim to have bitbanged USB on ARM M0 processors, however for our products you would have to worry about the SoftDevice using part of the processor time as well.

    To my knowledge USB has never been bitbanged on any of our products, so I'm afraid I don't have any further advice on how to achieve something like that.

    Best regards

    Jørn Frøysa

  • so I finally, after the comment from yesterday, understand what they are trying to do. They aren't trying to use GPIOs for USB. What they're trying to do is have one connector on the board, a USB connector, but have it work both for USB (usual case, usual wiring) or I2C (with some custom connector). So they have D+/D- on the connector hooked up to D+/D- pads on the chip but also to two GPIOs for when they're using the USB connector for I2C. I think what they hoped for /expected is that if the USB module itself is off, the D+/D- pads would be high impedence and wouldn't interfere with the I2C communication going into the GPIO pins. I assume when using USB,they set the GPIOs high impedence and that works. So I guess the question here is what are the electrical characteristics of the D+/D- pads when the USB module is turned off?

Reply
  • so I finally, after the comment from yesterday, understand what they are trying to do. They aren't trying to use GPIOs for USB. What they're trying to do is have one connector on the board, a USB connector, but have it work both for USB (usual case, usual wiring) or I2C (with some custom connector). So they have D+/D- on the connector hooked up to D+/D- pads on the chip but also to two GPIOs for when they're using the USB connector for I2C. I think what they hoped for /expected is that if the USB module itself is off, the D+/D- pads would be high impedence and wouldn't interfere with the I2C communication going into the GPIO pins. I assume when using USB,they set the GPIOs high impedence and that works. So I guess the question here is what are the electrical characteristics of the D+/D- pads when the USB module is turned off?

Children
No Data
Related