Is there any way I can test out, interface directly with i2c and SPI devices. - Page 1
Forum section: electronics / projects

author: cdev
author_rank: Super Contributor
timestamp: September 24, 2017, 12:35:27 am
content: directly from my PC's console without having to use an MCU?Using some kind of dongle instead. At one point I swear I saw i2c in some kind of device you could buy and just plug in and use..If not that way, what about internal headers, can we connect i2c devices to our PCs internal i2c bus?Actually, this sounds like a job for Raspberry Pi. I think perhaps my motherboard has an i2c header somewhere in there.. There are just a few devices I wouldn't mind having handy all the time.(UPDATE: For testing devices Bus Pirate is useful and it appears a Chinese USB to serial chip variant the CH341A also may have SPI/i2C and some other functionality and is cheap but good luck getting info in English on it)

author: tombi
author_rank: Regular Contributor
timestamp: September 24, 2017, 12:44:08 am
content: Checkout buspirate from dangerous prototypes. I think Dave used one in an early video to test and LCD screen.Tom

author: Ian.M
author_rank: Super Contributor
timestamp: September 24, 2017, 02:19:02 am
content: *WAY* back in the days of DOS, Philips had a simple printer port interface and utility program that bit-banged I2C, but with the removal of legacy ports, and increased security on direct hardware access that's no longer viable on a modern PCBuspirate is actually a MCU with a USB CDC interface. However the fact that you simply access it from a terminal rather than needing proprietary software probably puts it ahead of the rest.Microchip have some USB to SPI and I2C bridge chips, and many of the more recent FTDI USB UARTs can be configured as SPI and/or I2C bridges, but you need a custom PC side application to talk to them.

author: TK
author_rank: Super Contributor
timestamp: September 24, 2017, 02:26:10 am
content: I also recommend you use Bus Pirate. I think there are i2c devices on the PC motherboard, but you will need to access the bus by writing custom device drivers for Windows / Linux or whatever OS you are using, and you don't have control of the existing pull-up resistor values. SPI is not possible because you will need dedicated SS (Slave Select) pins and I don't think you get them on PC motherboards.I usually do this type of quick i2c or SPI access tests using my Arduino board.

author: cdev
author_rank: Super Contributor
timestamp: September 24, 2017, 02:57:43 am
content: This is good because I have a Bus Pirate 3.6 that I have not used in over three years (since before I had my scope, because the last project was using it as a scope with Python to attempt to visualize 1PPS on a GPS I was fooling around with) The only cable I had for it was the Seeed mini grabbers cable, however I recently got a pack of 20 10 pin IDC plugs so now can make a nice cable to use it with a breadboard easily. That makes all the difference.Need to read up on it, make sure the firmware on it is current.

author: cdev
author_rank: Super Contributor
timestamp: September 24, 2017, 03:02:09 am
content: Yes, I had been too but both of my Arduinos are kind of old and memory limited.They make great hardware /computer interfaces generally, though.It seems as if from what I can tell, I can use STM32 Blue Pill boards somewhat interchangeably with Arduino, with a few exceptions.And they cost very little. Need to get some accessible book to introduce me to programming with them.Quote from: TK on September 24, 2017, 02:26:10 am

author: cdev
author_rank: Super Contributor
timestamp: September 24, 2017, 03:13:36 am
content: For years Ive been seeing USB to (fake) parallel port adapters for fairly high prices on the net. maybe $20-30. But the other day I saw one coming from a Chinese vendor for around $3. So, might be possible to use that for all the stuff that needs a parallel port if software could communicate through it. Like flashing old BIOS chips.. (flashrom) Lots of tools use real parallel ports.Quote from: Ian.M on September 24, 2017, 02:19:02 am

author: Ian.M
author_rank: Super Contributor
timestamp: September 24, 2017, 04:20:38 am
content: It doesn't work that way - Generic USB parallel ports work with *most* printers, but don't provide the register level bit-banged access that was needed to do non-standard stuff with a true PC parallel port.

author: KE5FX
author_rank: Super Contributor
timestamp: September 24, 2017, 06:31:51 am
content: TI'sUSB2ANYbox is very handy, but frustratingly, the company doesn't go out of their way to support it. You have to scrounge up resources like GUIs, manuals/schematics, and SDK files from various unrelated parts of their site. It's hard to be sure you have the latest support files since there's no central repository for them.

author: JPortici
author_rank: Super Contributor
timestamp: September 24, 2017, 07:20:15 am
content: If it's of any help.. (should work inside realterm)https://realterm.sourceforge.io/#I2C_Bus

author: cdev
author_rank: Super Contributor
timestamp: September 24, 2017, 03:17:58 pm
content: Not being a Windows user, I had never looked at Realterm until now.Looks interesting!Quote from: JPortici on September 24, 2017, 07:20:15 am

author: cdev
author_rank: Super Contributor
timestamp: September 24, 2017, 05:28:34 pm
content: So, it turns out the Bus Pirate is exactly right for this.

author: ebclr
author_rank: Super Contributor
timestamp: September 25, 2017, 12:50:03 pm
content: This silabs dev can be another optionhttps://www.silabs.com/products/development-tools/interface/cp2112ek-evaluation-kit

author: cdev
author_rank: Super Contributor
timestamp: September 25, 2017, 06:53:21 pm
content: Have seen this also and wondered about it...https://world.taobao.com/item/14541759710.htm(Update: have found a great deal more about the ch341a chip and the so clled "usb2any" device.. need to clean this article up...The device is called "YSUMA01-341A" - It differs from the Bus Pirate in that the Bus Pirate is a much more versatile swiss army knife of a bus communication tool in a number of ways, and this device appears to be in a number of other ways, and as far as i can tell, there is little overlap.. I eventually found (one) English datasheet for the Ch341A and its quite understandable, so maybe the statement to the effect that the ch340 that I read somewhere saying it was the worst USB-UART driver out there is undeserved or based on incomplete knowlwedge.. I have a medium sized to large collection of USB-UART adapters and my CH340 adapter is better than average in terms of compatibility..But I had never heard about the ch341A chip until a few days ago when I spotted this dongle on taobao..So Ive ordered one, looking forward to checking it out. somehow..Turns out there are a number of projects involving it on github, most are targeting the EEPROM functionality.. This was the first one of several that I found.https://github.com/karlp/ch341-linuxThe manufacturer of the chip does have a site- some datasheets/drivers are on their site.Some are not.. like as far as I could tell, the English datasheet did not get returned when I searched for "ch341a"Datasheet in Chinese...http://www.wch.cn/download/CH341DS1_PDF.htmltheir site navigation is also broken in English for me.It appears this chip is also used in cheap EEPROM programmershttps://onetransistor.blogspot.com/2017/08/ch341a-mini-programmer-schematic.htmlFrom onetransistor.blogspot.com - - this article has a lot more info on the ultra cheap ch341a EEPROM programmer.... and promises an update telling more about how to use other CH341A devices.. and its API: sometime in the future...Link to an English copy of the datasheet that I found eventually.https://hannover.ccc.de/redmine/attachments/download/213/CH341DS1.pdfAlso, on Amazon in the reviews for this product I found a lonk to a 6,5 MB RAR file that appears to have the English versions of some of the below files in it, but they are not coming from the manufacturer and for all I know, could be virus impregnated.. its possible.So here is a chunk of the one transistor article.. (below) The ch341a - if I can use it to incorporate arbitrary i2c and SPI devices into my desktop system, semi-flexibly - may be a useful chip, for me.Quote

author: xani
author_rank: Frequent Contributor
timestamp: September 26, 2017, 01:20:00 pm
content: There is also GreatFEThttps://greatscottgadgets.com/greatfet/altho it is very much a WiP at this point

author: Back2Volts
author_rank: Unknown
timestamp: October 15, 2017, 11:50:10 pm
content: I am sure it is too late for the OP, but just for future reference...When looking for a solution for a project, I run into the FT232H. It does USB to SPI, I2C, UART, JTAG and GPIO (which I find rather unique). It comes with FTDI drivers and API library.FTDI has various dev/breakout boards and even conversion cables. There is also a breakout board from Adafruit, with support included in their Python GPIO library.Some links:https://learn.adafruit.com/adafruit-ft232h-breakout/overviewhttps://www.digikey.com/product-detail/en/ftdi-future-technology-devices-international-ltd/UM232H/768-1103-ND/2614628https://www.digikey.com/product-detail/en/ftdi-future-technology-devices-international-ltd/UM232H-B-NC/768-1160-ND/3770837http://www.ftdichip.com/Products/Cables/USBMPSSE.htm