I2C & SPI Bus Tester - Page 1
Forum section: electronics / projects

author: German_EE
author_rank: Super Contributor
timestamp: January 04, 2015, 04:23:51 pm
content: I have a project on my workbench that uses both the I2C and SPI bus interfaces, I don't like this idea but it has been forced upon me as one chip can only be obtained with an I2C interface. Reading this buses is possible but difficult using my oscilloscope but even then I have no way to send bus signals to debug my design. Ideally I would like to avoid a situation where something does not work and I am not sure if it is hardware or software.So.......Does anybody know of an easy and cheap way to send and receive I2C and SPI data using a PC and display the data on the screen?

author: Thilo78
author_rank: Regular Contributor
timestamp: January 04, 2015, 04:36:21 pm
content: I don't know your setup, but a quite easy way might be to use a microcontroller like the ATmega for this.With an off-the-shelf Arduino and the Arduino IDE, it's rather easy to setup a communication via I²C or SPI and log it via the serial monitor.But it's not too fast.(I should note, that I'm a beginner here myself. I've just tinkered a bit with SPI and I²C)

author: Alex Eisenhut
author_rank: Super Contributor
timestamp: January 04, 2015, 04:36:59 pm
content: Easy is thishttp://www.totalphase.com/products/beagle-i2cspi/Cheap, on the other hand, it ain't.There are shields for the arduino, surely that's a solution?

author: German_EE
author_rank: Super Contributor
timestamp: January 04, 2015, 04:53:22 pm
content: Now you see my problem, over $300 for some hardware just to read two different serial buses, silly money. As for the Arduino, there may be a shield that can do this job but in order to use it I would first need to purchase (and learn to program) my first Arduino.What I am hoping for is some clever fellow who has come across this problem before, programmed a PIC or FPGA to do the task and he's selling the result of his efforts.

author: Thilo78
author_rank: Regular Contributor
timestamp: January 04, 2015, 05:06:51 pm
content: Actually, you don't need any shields AFAIK.Just a <5 EUR Arduino clone*, software for free, some wires and a little time to search for and c&p some tutorial code.It's all there.I'd think that's the least possible effort for that goal.Another option would be a cheap logic analyzer, but that's more money again and the same learning curve.* example from ebay:http://www.ebay.de/itm/Uno-R3-MEGA328P-ATMEGA16U2-Board-mit-USB-Kabel-compatible-Arduino-AR01001-/271726867685?pt=Wissenschaftliche_Ger%C3%A4te&hash=item3f442ef4e5Seller is trustworthy and quick. I can recommend him.Edit: Just look out for signal levels. Some Arduino clones come in 5V and 3.3V flavours.

author: Christopher
author_rank: Frequent Contributor
timestamp: January 04, 2015, 05:35:12 pm
content: Bus Pirate is pretty good. You can slap together some Python to access the I2c/SPI. Have found it a bit slow though..These days I knock something quick up with an Arduino (Have my own C portable I2C/SPI/UART/CAN software drivers) as a quick test, just on a breadboard or bit of stripboard,

author: Alex Eisenhut
author_rank: Super Contributor
timestamp: January 04, 2015, 06:02:00 pm
content: Quote from: German_EE on January 04, 2015, 04:53:22 pmMaybe look into this thinghttp://www.ebay.ca/itm/ALL-IN-1-USB-to-SPI-I2C-IIC-UART-TTL-ISP-serial-Adapter-/201025056063?pt=LH_DefaultDomain_0&hash=item2ece06ed3fMyself I already have a Beagle... They were cheaper at some point in time. And I was also richer...

author: jancumps
author_rank: Unknown
timestamp: January 04, 2015, 06:32:20 pm
content: To simulate, I'm using a Bus Pirate as mentioned above.To collect and analyze, I use a Papilio with Logic Sniffer code loaded, and the OpenLogic Sniffer software as client. It has an SPI and I2C protocol plugin.I'm using these tools because they can be used for other things too. The Papilio normally serves as my FPGA dev/learn board.Bus Pirate serves as my protocol prototyping and chip probing tool .

author: DanielS
author_rank: Frequent Contributor
timestamp: January 04, 2015, 08:39:13 pm
content: Quote from: Thilo78 on January 04, 2015, 05:06:51 pmThat's why I love FPGAs: if you need to snoop anything up to tens of Mbps, you can relatively easily sniff whatever serial or narrow-parallel protocol you want using affordable (~$100) FPGA development kits, just need the appropriate buffers or level-shifters. Things get more complicated if you want a deep DRAM-based buffer though. For I2C and similar, you can also implement a bus master to hijack the bus if you want to. Wholesome fun for the whole family.

author: zapta
author_rank: Super Contributor
timestamp: January 05, 2015, 01:14:50 am
content: Search for icsp to i2c converter. It will allow you to use a spi tester with both buses.

author: ajb
author_rank: Super Contributor
timestamp: January 05, 2015, 06:40:07 am
content: If you want something ready to go out of the box you might check out the Ikalogic devices. They're not super sophisticated, but they're inexpensive (~50€) and do a fair job of decoding the most common buses with decent software.

author: rfbroadband
author_rank: Unknown
timestamp: March 08, 2015, 04:05:54 am
content: I once designed a USB <-> SPI, I2C interface using a 32 bit PIC. The end result was very cheap...but the USB part and the firmware part is work...Not sure how you value your time....but buying an existing I2C/SPI adapter will get you there really quickly...

author: German_EE
author_rank: Super Contributor
timestamp: March 08, 2015, 12:12:57 pm
content: Sorry but I eventually gave up on this problem and rented a device called a 'Logic Bus Exerciser' from a local test equipment house. One box the size of a PC could send and receive SPI, I2C, USB, PS2, CAN bus, RS-232 plus all of the remote control protocols and a dozen more others. Once I knew that my I2C and SPI receivers were working correctly I had enough confidence to continue with the rest of the design.Sometimes it is easier to accept defeat and get the bank cards out of the wallet.