If I have an unkown device which talk I2C or SPI how can I reverse engineer the protocol. Basically I am looking for something similar as snoop or tcpdump.
For software Mac is preferred but can also run PC under parallels.
I think that you have to consider using the Bus Pirate, an open hardware project that costs just 30 dollars including worldwide shipping.
It works with a GUI for Mac OSX and Windows.
Just about any of the modern USB-based logic analyzers also have protocol analyzers for common serial protocols like RS-232, SPI, & I2C. I know of none that have shipping Mac OS X drivers. However, the Saleae Logic logic analyzer has been getting good press and they promise some cross-platform drivers in the future.
I have an Intronix LogicPort USB analyzer and it's okay. I run it out of either a VMWare WinXP VM on my Mac or on an old throw-away laptop running WinXP. If you're a Mac user doing hardware hacking, I highly recommend getting VMWare or similar so you can run the occasional bit of Windows-only software.
First off you need something to capture the signals. The standard way of doing this is with a Logic Analyzer. I've collected a list of PC-based logic analyzers, basically how they work is they capture the signal data and transfer it for display and processing on your PC. Most of them include software for decoding SPI and I2C, showing you what bytes were sent and received by the devices.
The OpenBench Logic Sniffer is open source hardware and retails for around $30-$40
It supports the Sump client that runs under Java and it has I2C & SPI protocol analyzer plugins. I run it under OS X & Linux