The Joy of Bit-Banging(blog.jgc.org)
blog.jgc.org
The Joy of Bit-Banging
http://blog.jgc.org/2012/09/the-joy-of-bit-banging.html
16 comments
The Saleae Logic is a beautiful device. I can't believe I tried to analyze digital traffic with my old scope before this.
You might be interested in this talk: http://lwn.net/SubscriberLink/515569/aab5102c0daa0f5d/
Yeah, I've played with a Bus Pirate on the bench. I just feel more comfortable throwing the Saleae around than the exposed Pirate PCB. Saleae's customer service is also completely awesome.
I am really tempted to get it. I have a $390 LogicPort [0] which is a 34 channel, 500 MHz probe (quite a bit beefier than the Logic's 8 channel, 24 MHz). The hardware is great but the software is rather terrible. There is no way to add your own protocol decoders. Export features are limited. I wanted to write my own GUI so I contacted the company and asked if they had any documentation on the USB protocol. Their response was snarky and rude. Sad, because I really wanted a Linux version. Maybe reversing the protocol wouldn't be too difficult...
[0]: http://www.pctestinstruments.com/
[0]: http://www.pctestinstruments.com/
Sigrok [1] plans to support your LogicPort but doesn't yet. Help them out instead of buying a Saleae.
[1]:http://sigrok.org/wiki/Supported_hardware#Logic_analyzers
[1]:http://sigrok.org/wiki/Supported_hardware#Logic_analyzers
Thank you for showing me this! I didn't know about the project before. It would be a big motivation if others are working on reversing the protocol as well!
[deleted]
Absolutely. One of the guys here at HP got one and within weeks our group owned half a dozen. No reason not to have one in each cube. I have an expensive mixed-signal scope that I used for LA before but now only switch it on if I have to look at analog.
The Linux kernel has built-in support for bit-banging I2C and SPI interfaces, which I used way back when I was writing a driver for the MyHD HDTV tuner card. The thoughtful developers of earlier TV drivers had written a plethora of tools for probing and debugging I2C buses.
I love bit-banging, sometimes you want to go that route even if the uC does have specialized hardware. I remember having to bit-bang I2C on multiple occasions because the standards are so loose.. good times.
Recently I had to bitbang I2C through a voltage level translating buffer that had a direction setting pin that needed to be manipulated when sampling SDA on input. The uC's hardware I2C block obviously couldn't handle that extra signaling oddity. Not the fastest approach but then this I2C application wasn't that high speed to begin with. Good times indeed!
... and often the specialised hw doesn't go far enough. ie- i2c and spi hw that doesn't have enough buffering to be left on its own. Either we babysit the interface or we can leave it to do its own thing until we get an interrupt for completion. Do a halfway job on the hw and we revert to the babysit case. Not bitter, just ranting.
I bitbanged an eMMC interface on a MSP430 - enjoyed it greatly but then we switched to a micro with a built in MMC/SDIO interface so it's just a memory now.
I've seen some bit-banged USB interfaces (ie using gpio and discrete level shifting) on avr's and pic's. It was a very neat hack, if very very wrong.