Author Topic: I2C & SPI Bus Tester  (Read 6669 times)

0 Members and 1 Guest are viewing this topic.

Offline German_EETopic starter

  • Super Contributor
  • ***
  • Posts: 2399
  • Country: de
I2C & SPI Bus Tester
« on: January 04, 2015, 04:23:51 pm »
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?
Should you find yourself in a chronically leaking boat, energy devoted to changing vessels is likely to be more productive than energy devoted to patching leaks.

Warren Buffett
 

Offline Thilo78

  • Regular Contributor
  • *
  • Posts: 149
  • Country: de
Re: I2C & SPI Bus Tester
« Reply #1 on: January 04, 2015, 04:36:21 pm »
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)
 

Online Alex Eisenhut

  • Super Contributor
  • ***
  • Posts: 3483
  • Country: ca
  • Place text here.
Re: I2C & SPI Bus Tester
« Reply #2 on: January 04, 2015, 04:36:59 pm »
Easy is this

http://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?
Hoarder of 8-bit Commodore relics and 1960s Tektronix 500-series stuff. Unconventional interior decorator.
 

Offline German_EETopic starter

  • Super Contributor
  • ***
  • Posts: 2399
  • Country: de
Re: I2C & SPI Bus Tester
« Reply #3 on: January 04, 2015, 04:53:22 pm »
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.
Should you find yourself in a chronically leaking boat, energy devoted to changing vessels is likely to be more productive than energy devoted to patching leaks.

Warren Buffett
 

Offline Thilo78

  • Regular Contributor
  • *
  • Posts: 149
  • Country: de
Re: I2C & SPI Bus Tester
« Reply #4 on: January 04, 2015, 05:06:51 pm »
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=item3f442ef4e5
Seller 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.
 

Offline Christopher

  • Frequent Contributor
  • **
  • Posts: 429
  • Country: gb
Re: I2C & SPI Bus Tester
« Reply #5 on: January 04, 2015, 05:35:12 pm »
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,
 

Online Alex Eisenhut

  • Super Contributor
  • ***
  • Posts: 3483
  • Country: ca
  • Place text here.
Re: I2C & SPI Bus Tester
« Reply #6 on: January 04, 2015, 06:02:00 pm »
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.

Maybe look into this thing

http://www.ebay.ca/itm/ALL-IN-1-USB-to-SPI-I2C-IIC-UART-TTL-ISP-serial-Adapter-/201025056063?pt=LH_DefaultDomain_0&hash=item2ece06ed3f

Myself I already have a Beagle... They were cheaper at some point in time. And I was also richer... :)
Hoarder of 8-bit Commodore relics and 1960s Tektronix 500-series stuff. Unconventional interior decorator.
 

Offline jancumps

  • Supporter
  • ****
  • Posts: 1273
  • Country: be
  • New Low
Re: I2C & SPI Bus Tester
« Reply #7 on: January 04, 2015, 06:32:20 pm »
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 .
 

Offline DanielS

  • Frequent Contributor
  • **
  • Posts: 798
Re: I2C & SPI Bus Tester
« Reply #8 on: January 04, 2015, 08:39:13 pm »
Another option would be a cheap logic analyzer, but that's more money again and the same learning curve.
That'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.

 

Offline zapta

  • Super Contributor
  • ***
  • Posts: 6289
  • Country: 00
Re: I2C & SPI Bus Tester
« Reply #9 on: January 05, 2015, 01:14:50 am »
Search for icsp to i2c converter. It will allow you to use a spi tester with both buses.
 

Offline ajb

  • Super Contributor
  • ***
  • Posts: 2733
  • Country: us
Re: I2C & SPI Bus Tester
« Reply #10 on: January 05, 2015, 06:40:07 am »
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.
 

Offline rfbroadband

  • Supporter
  • ****
  • Posts: 186
  • Country: us
Re: I2C & SPI Bus Tester
« Reply #11 on: March 08, 2015, 04:05:54 am »
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...
 

Offline German_EETopic starter

  • Super Contributor
  • ***
  • Posts: 2399
  • Country: de
Re: I2C & SPI Bus Tester
« Reply #12 on: March 08, 2015, 12:12:57 pm »
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.
Should you find yourself in a chronically leaking boat, energy devoted to changing vessels is likely to be more productive than energy devoted to patching leaks.

Warren Buffett
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf