PDA

View Full Version : Discussion looking for I2C bus monitor


13brv3
Feb 16, 2008, 12:46 PM
Greetings,

I need to be able to measure the update rate of an I2C motor controller that's being used on a quad copter. I know that putting a scope on an I2C bus is just short of hopeless, so I'd like to find a program that will analyze the bus to help me find the info I need. It's not something I'd do often, so I'm hoping to find something between free, and cheap. Ideally, this will be able to run on a Windows PC, and connect via USB or RS232. It doesn't need to be able to write to the bus, or even be an active device on the bus.

My searching so far has found mostly professional, standalone analyzers, mostly in the $250 range. I'm hoping for something closer to $50 that simply displays what's on he bus in an organized manner.

Any suggestions will be appreciated.

Cheers,
Rusty

BushmanLA
Feb 16, 2008, 01:08 PM
You are in luck.

I saw this little baby just the other night while cruising around the net.

It isn't free, but its probably one of the cheaper you will find. The software is free though, its a nice little terminal program.

Software
http://realterm.sourceforge.net/

Hardware
http://www.i2cchip.com/

Its 70 bucks :(, but that is waaaaaaaay less than some of the others like this I've seen. They sell the stand alone converter chip for just a few bucks if you want to make your own connection hardware around it, but as best I can tell they only sell 10 at a time.

13brv3
Feb 16, 2008, 02:00 PM
Great minds Google alike :-)

I almost included a link to this earlier, because I really like the adapter, and have no problem spending $70 for it.

The problem I have with this is the software. I can't tell that much about what the software will really do for me. It can read the bus, but how does it display the data. I'm not a programmers, so I need pictures :p

I also have to imagine that other software packages will work with this hardware as well, but I don't know that for sure either.

Thanks very much for the suggestion.
Rusty

Alan Hopper
Feb 16, 2008, 04:06 PM
might be worth a look
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en028600
not tried it, but it is cheap
Alan

BushmanLA
Feb 16, 2008, 05:19 PM
The problem I have with this is the software. I can't tell that much about what the software will really do for me. It can read the bus, but how does it display the data. I'm not a programmers, so I need pictures :p


http://realterm.sourceforge.net/#I2C%20Bus

basically the data shows up on the terminal window. You can choose to display it as hex, binary, or ascii etc.

I didn't realize the microchip one was so cheap, might be worth looking into.

13brv3
Feb 16, 2008, 09:58 PM
Thanks for the additional comments. I've used microchip stuff before, and never had a problem, but I think I like the i2cchip hardware better. I have to believe the realterm software will do what I need, but I might have to download it to find out.

FWIW, I will be looking at an I2C bus with 4 motor controllers on it. I would like to be able to see the data being sent to each controller, but mostly I need to see the timing. Having the data appear in a terminal window will be great, as long as there's a time-stamp associated with each entry. Surely there must be.

If there's no other suggestions, I'll likely order the i2cchip Monday.

Thanks,
Rusty

quax
Feb 17, 2008, 05:30 AM
If you only want to know the update rate, a scope normally reaches enough. You should see blocks of data and the distance of the blocks is the update rate. For example the MK triggers the data update every time when the next data are calculated.

cul
Bernhard

jeffs555
Feb 17, 2008, 06:50 AM
I don't think either the i2cchip or that microchip thing can be used as an I2C bus monitor.

The i2cchip people do show a bus monitor board on their site. http://www.i2cchip.com/bus_monitor.html
Their web store shows this board as $20 and $10 for the CD. However, the page for the board shows the software as "available soon". You may want to email them to check. If the software is available, $30 for an I2C bus monitor looks like a good deal.

Their software is probably a variation of the Milksop cheap i2c monitor, which was a Linux based monitor that used the parallel port to monitor the i2c bus. The description of i2cchips planned monitor software sounds like a live CD that boots into linux and runs the monitor. They have a link to the Milksop page, http://www.i2cchip.com/index.html#Other but the page has been removed. If you google for Milksop and I2C you will find some talk of it but I didn't see anywhere you can download it. If you are into linux, i have a old copy of the Milksop source code which is GPL software so I could send it to you if you can't find it anywhere else. However, there is very little documentation and the web page doesn't appear to be archived. It is a shame because it was a free way to monitor the I2C bus. If the i2cchip people have developed a live CD of this it would be the way to go.

Jeff

13brv3
Feb 17, 2008, 06:11 PM
Thanks for the comments, and additional research on the i2cchip stuff.

With any luck, the I2C data will not have significant gaps between the blocks of data, so it will be tough to tell what's going on with a scope. Rest assured that I'll try it, but I don't have much hope of success.

I'll probably end up emailing the i2cchip folks to ask them what they recommend. Interesting about the old Milksop software, because I found some really old dead links to it as well.

Thanks again,
Rusty

quax
Feb 17, 2008, 06:16 PM
I tried this sniffer a while ago and it worked :)
http://www.avrfreaks.net/index.php?module=Freaks%20Tools&func=viewItem&item_id=411


cul
quax

BushmanLA
Feb 18, 2008, 05:25 AM
Seriously, I'm gonna have to make one of these things now that works with any regular joe terminal.

It shouldn't be too hard to setup a PIC to do it since you can get them with I2C and USART hardware built in.

barb wire
Feb 18, 2008, 12:40 PM
Rusty,

this link may be of some use to you

http://hobbylab.us/USBOscilloscope/Home.htm

BW

13brv3
Feb 18, 2008, 05:35 PM
Very cool USB scope gizmo :cool: Still, I don't see that it specifically says you can measure time intervals between events. I'll definitely toss it on the favorites pile, and keep it in mind. I didn't think to look at USB scopes, but I'll have to look at a few others now too.

I sent the i2cchip folks an email last night, but haven't heard back yet.

Thanks,
Rusty

Fixion
Feb 21, 2008, 01:23 AM
If you just want to see the update rate, you could give the scope a shot. I don't think the i2c packets could be that long. Just adjust your time/div so that you can see the distinct packets. They probably aren't more than 32 bytes long, and at 100kHz one packet should only be about 3ms long.

jeffs555
Feb 21, 2008, 01:25 PM
You could also build the simple start detector circuit shown here to get a good trigger for your scope. http://www.i2cchip.com/bus_monitor.html

13brv3
Feb 22, 2008, 12:10 PM
Thanks for the additional comments. I've tried the scope method, and it's just a mess. I even tried using a D flip flop to act as a trigger for "start" commands, but that wasn't much better. I'm also interested in seeing the data, so a real monitor would be the way to go.

Unfortunately, my email to i2cchip has gone unanswered for almost a week, so either they can't do what I need, or they just haven't replied.

Unfortunately, the cheapest real monitor I've seen is nearly $200, with better ones being around $300. I might still go that route, but I'm trying to resist.

Cheers,
Rusty

jeffs555
Feb 22, 2008, 03:50 PM
You might try this freeware(really crippleware, saving is disabled). It claims to do a lot of things, and one of them is to monitor and decode I2C through the parallel port. http://www.programmersheaven.com/download/50025/download.aspx
I downloaded it just to look. I didn't connect anything to the parallel port, but did see that it has 4-bit logic analyser with an option for decoding I2C. I kept getting an "invalid floating point operation" when I told it to start monitoring, but it may work on your PC. Worth a try since it is free.

Here is the companys download page. http://www.elrasoft.com/download.htm
You have to click the password registration on the download page and give them your email address. They email you a unlock code.

KreAture
Feb 23, 2008, 10:05 PM
Sounds like a job for a small avr or similar. Coupled directly to a FTDI chip it can give a virtual serial port on the PC via USB and allow up to 2.5 Mbaud datarates.

Since i2c is such a well documented bus it is easy to write a decoder for it. The issue is uing the internal hardware of the avr as you do not know the number of bits used in the protocol of the i2c. Start and stop are easy. As are the datarate as it is dictated by the clock. How many bits are sent in a command however is not. Better make it flexible.

Address of i2c is fixed at 7 bits I think?
Then the last bit is read or write flag?
What comes next between end of first byte and stop condition can be anything...

quax
Feb 24, 2008, 04:53 AM
Sorry, but I cannot see, why you don't give this sniffer a try:

http://www.avrfreaks.net/index.php?module=Freaks%20Tools&func=viewItem&item_id=411

It monitors the complete I2C-I/O and need not to know the I2C-address, that is also monitored.

cul
quax

KreAture
Feb 24, 2008, 09:53 AM
100khz clock max?
Not very fast, is it?

13brv3
Feb 24, 2008, 11:01 AM
Thanks for the additional comments, particularly the elrasoft link. I might play with the demo sw some, but I may also consider stretching the budget enough to get their analyzer package. I downloaded the demo version of their full software as well.

The problem with many of the suggestions is that I'm looking for a tool, not another project. Under other circumstances, I might be interested in building adapters, and fiddling with programming to make it work, but I've got too many projects already. For now, I'd like to find something quick and easy, that works right out of the box.

Cheers,
Rusty

quax
Feb 24, 2008, 03:10 PM
100khz clock max?
Not very fast, is it?

The limit is the serial output with 115kBaud in this case, not the record speed. But without any serial modification the serial limits the max clock, that's true.

cul
quax

KreAture
Feb 24, 2008, 03:28 PM
If you run a AVR at 20 MHz you can get the USART to go up to 2.5 Mbaud with 1.7% error. This is good enough for reliable operation. I love the FTDI and Prolific serial2usb chips as they can easily handle this rate. You can't use level converters at these rates but the direct TTL connections work very well.

I have tested the Prolific chip up to 6Mbaud with beautiful flanks on the signal.
The question is, how fast can a decoding loop be if not done in hardware?
Second question would be; assuming 8 bit/byte setup, How fast can the internal twi communicate? Does it support 1 MHz clock? How about 2?

I am actually intrigued by this. Maby I should design a logger.