I2C to USB converter - Page 1
Forum section: electronics / general

author: arcticfish
author_rank: Newbie
timestamp: September 22, 2023, 10:48:11 am
content: Hi all,Anyone know decent quality of USB to I2C bridge converter can recommend? mainly use for testing, writing and read register of an IC support I2C from computer comport.Thank you in advance.

author: oPossum
author_rank: Super Contributor
timestamp: September 22, 2023, 11:01:14 am
content: https://ftdichip.com/products/ft260s/

author: SiliconWizard
author_rank: Super Contributor
timestamp: September 22, 2023, 10:33:39 pm
content: Alternatively, you can use the FT232H. If you are going to use Python, there's PyFtdi which supports it and that works well (tried it). The FT260S is not officially listed as supported by PyFtdi, so not sure it is.

author: magic
author_rank: Super Contributor
timestamp: September 23, 2023, 05:43:04 am
content: There is some limited support in CH341A chips and a Linux kernel driver which makes it work with standard i2c-tools and with in-kernel I2C device drivers.https://github.com/gschorcht/i2c-ch341-usbI have bought a CH341A breakout board from AliE for this purpose, but haven't had the opportunity to try it yet.I previously used a passive VGA to I2C cable. But this trick doesn't work with DisplayPort anymore and it endangers the GPU if there is magic smoke from your I2C stuff.

author: fchk
author_rank: Frequent Contributor
timestamp: September 24, 2023, 06:45:32 pm
content: Quote from: oPossum on September 22, 2023, 11:01:14 amYes, this is my preferred choice now. Before this I used MCP2221A.fchk

author: up8051
author_rank: Frequent Contributor
timestamp: September 24, 2023, 07:38:25 pm
content: FT260 has only 1.8V to 3.3V IO levels supported.I once designed a USB -> I2C/UART converter module based on MCP2221

author: dkonigs
author_rank: Regular Contributor
timestamp: September 26, 2023, 03:39:48 am
content: Not sure which direction you're trying to go, but I've had the need to speak to an I2C peripheral from a computer for one project of mine. The device I'm currently working with thisDevantechadapter. Its decently documented, and seems to work well enough.

author: Pack34
author_rank: Frequent Contributor
timestamp: September 26, 2023, 06:39:38 pm
content: Using your computer as an I2C master? Not exactly cheap, but the C232H cables from FTDI seem to work well enough. Come in 5V and 3V3. I've used them in conjunction with some python scripts for test/debug. But ultimately, I think any mini STM32 dev board would probably work better. You'll just have a small layer of embedded code running on the STM32 to convert any serial commands from your python script to I2C commands for your DUT.https://www.digikey.com/en/products/detail/ftdi-future-technology-devices-international-ltd/C232HM-EDHSL-0/2714140https://www.digikey.com/en/products/detail/ftdi-future-technology-devices-international-ltd/C232HM-DDHSL-0/2714139

author: SiliconWizard
author_rank: Super Contributor
timestamp: September 27, 2023, 07:56:06 pm
content: You can use any FT232H breakout board which are relatively inexpensive.Adafruit has this one which is fine. I have a couple of theses around:https://www.adafruit.com/product/2264

author: jaka
author_rank: Contributor
timestamp: September 28, 2023, 05:24:29 am
content: FT232H is not the best choice, if the slave is a microcontroller. The FT232H doesn't support clock stretching.

author: pcprogrammer
author_rank: Super Contributor
timestamp: September 28, 2023, 06:30:29 am
content: There is also a solution with an ATtiny andthis repositoryAmodulelike this can be used to make it with.I have used an early version of similar code and it works great. The USB side is bit banged and only does 12Mbit but I2C is mainly maxed out on 400KHz so the USB speed does not matter.

author: SiliconWizard
author_rank: Super Contributor
timestamp: September 28, 2023, 08:11:02 pm
content: Quote from: jaka on September 28, 2023, 05:24:29 amIt's easy to find, breakout boards are all over the place if you don't want to make your own board, and most of all, it's supported by PyFtdi, which was one point I made, for people who want to use Python.Another benefit is that you can also use it for SPI, GPIO or as an USB FIFO, so it's very versatile.But you're right, it doesn't support I2C clock stretching. I personally try to avoid clock stretching as much as I can in practice, so I personally don't see it as a big issue, but if you absolutely need to handle it, then agreed, look elsewhere. Make sure you absolutely need clock stretching though. (And I'm not sure I see why the fact you'd need to communicate with a MCU as I2C slave would imply having to use clock stretching necessarily.)(One reason I usually avoid clock stretching is that it just "grabs" the bus, waiting for the slave to complete something, making any other communication on the bus meanwhile impossible, which kinda defeats the purpose of I2C unless there's only one slave on the bus. A "typical" use of clock stretching is for ADCs that will clock stretch until a conversion cycle has completed for instance, but most I2C ADCs, even when they support this mode, can usually be configured to not use clock stretching and allow polling flags instead, or via a "data ready" GPIO, which I find much better in practice.)

author: jaka
author_rank: Contributor
timestamp: October 02, 2023, 06:46:04 pm
content: QuoteThat probably depends on the I2C peripheral of the MCU and the driver / firmware implementation. We had to do a PCB re-spin because we found out too late that FT232H was problematic with our 8-bit PIC slave. Especially the I2C bootloader from Microchip application note clock streched a lot. It was possible to use it with FT232H, but the clock speed need to be reduced to 10 kHz or even slower. The in-built I2C driver in CCS compiler was better, but I think it was giving problems at higher clock rates as well.We then switched to CP2112 which has been working well. One downside is that it didn't have Python support on Windows (on Linux it works well with Python). The BOM cost and complexity went down a lot, the CP2112 requires very few external components.Another part which we tested was MCP2221A, which also worked well and requires almost no external components. This one works with Python also in Windows. IIRC, the HID protocol was slightly less economical than in CP2112. For this reason, we chose CP2112.Of course the FT232H outstands in performance in pretty much all other areas than I2C clock stretching. Very versatile part.

author: Wiljan
author_rank: Regular Contributor
timestamp: October 02, 2023, 07:28:40 pm
content: You can take a look on buspirate I like it for ad-hoc testinghttp://dangerousprototypes.com/blog/bus-pirate-manual/i2c-guide/

author: EyC
author_rank: Newbie
timestamp: October 06, 2023, 11:13:00 am
content: MCP2221 may not be as easy to find as FT232H. It also has some I2C quirks you need to manage by software.But, for testing and experimentation, I find MCP2221 more useful. Along with I2C, you get UART and analog GPIO.I recently made some experiments with MCP2221 and also wrote a Python library.https://easymcp2221.readthedocs.io/

author: benSTmax
author_rank: Regular Contributor
timestamp: October 06, 2023, 10:31:10 pm
content: Excellent work. I just ordered a few MCP2221A moments ago for evaluation/tests after seeing your outstanding support for this chip