Learning I2C with the Bus Pirate

When an air quality display project needed a display, [Inderpreet] looked into small character-based LCDs. [Inderpreet’s] chosen LCD used an I2C interface, which was new to him. Rather than shy away, [Inderpreet] grabbed his Bus Pirate and dove in!

I2C or Inter-Integrated Circuit serial interfaces are often mentioned here on Hackaday. They generally are easy to use, but as with all things, there are little gotchas which can make the road a bit more bumpy the first time you travel it. One of those things is voltage interfacing – I2C uses bidirectional open drain lines, so interfacing 3.3 V and 5V circuits requires a voltage level shifter circuit designed to handle that requirement. Thankfully in [Inderpreet’s] case, both his TI launchpad target devboard and the LCD used 3.3 volt logic levels.

buspirate2Before using the TI though, [Inderpreet] wanted to test with the Bus Pirate first. This would allow him to verify the hardware, and to make sure he was correctly using the I2C bus. The Bus Pirate can operate at 3.3V or 5V logic levels, and has on-board programming specific to the I2C bus. Controlling the Bus Pirate is as easy as hooking up a serial terminal program and plugging in a USB cable.

The I2C bus protocol is relatively simple, but can still be confusing to a new user. Each transaction needs an address, read/write bit, and a start command sent in the proper sequence before the data bytes can begin flowing. There are also acknowledge bits which prove that the data bytes are actually being received by the LCD. The Bus Pirate made all this easy, allowing [Inderpreet] to quickly display “Hello” on his LCD module.

The I2C bus is just the tip of the iceberg for the Bus Pirate. If you’re interested in learning more, check it out over at The Hackaday Store!

[via Dangerous Prototypes]

TRINKET EDC CONTEST DRAWING #4 RESULTS

The fourth of five random drawings for Hackaday’s Trinket Everyday Carry Contest was held tonight. The winner is [davish] with his entry, Trinket Watch. 

twatch3[davish] loves the current crop of smartwatches, but he wants one he can truly call his own. He’s using the Pro Trinket along with an Adafruit 1.3″ OLED for display duties. That little OLED can show a lot more than just numbers though. [davish] already has Adafruit’s logo demo running on the device. Trinket Watch is going to start out as a simple Arduino coded “dumbwatch”. After the basics of time and date are out of the way, [davish] hopes to add a Bluetooth module and turn Trinket Watch into a full-fledged smartwatch.

trinket-prize-cordwoodWe hope [davish] enjoys his new Cordwood Puzzle from The Hackaday Store. No jigsaws here, cordwood is a puzzle that involves solder! If you get a piece wrong, it’s time to break out that solder wick and fix your mistake. The puzzle is built using the cordwood assembly technique which was popular in the 1950’s and 1960s. We’re not kidding about it being a puzzle either – there are no instructions for this kit! [davish] will know he’s got it right when all 3 LEDs light up.

teensy-3-point-1-in-storeIf you didn’t win this week, all is not lost, you still have one more chance to win a random drawing! Our next drawing will be on 12/30/2014 at 9pm EST. The prize will be a Teensy 3.1 and audio adapter as a prize. To be eligible you need to submit your project as an official entry and publish at least one project log during the week.

The main contest entry window closes on January 2, 2015 – but don’t wait for the last minute! Hit the contest page and build some awesome wearable or pocketable electronics!

Trinket EDC Contest Drawing #3 Results

We’ve held our third drawing for the Trinket Everyday Carry Contest. Once again we’ve used a Pro Trinket to pick the random winner. This week’s winner is [Scissorfeind] with his project Stylin’ safety jacket

jacket3In true hack style, [Scissorfeind] went into this project with two goals: A jacket that will be visible at night, and keep him “looking f*cking sick”. The jacket itself is a faux leather affair from a thrift store. [Scissorfeind] added some studs for bling, and he’s working on adding a ton of electronics for light.

The Pro Trinket will be driving a series of LED matrices, which [Scissorfeind] is working on turning into POV displays. The matrices come from an LED clock which [Scissorfeind] saved from the landfill. In fact, most of the parts in the jacket are upcycled from e-waste. The jacket is just starting to come together. We can’t wait to see the final results!

buspirate2

We hope that [Scissorfeind] enjoys his Bus Pirate V3.6  from The Hackaday Store. The Bus Pirate was designed by former Hackaday writer [Ian Lesnet] as a Swiss Army knife of electronic communications. If you’re trying to connect to a circuit with  SPI, I²C, JTAG, or UART, the Bus Pirate has you covered. It can do plenty more though – from reading analog data to programming components. Check out [Brian Benchoff’s] full review on the Bus Pirate V3.6 product page!

trinket-prize-cordwoodIf the pseudo random number gods didn’t smile on you this week, don’t worry, there are still two more chances to win a random drawing! Our next drawing will be on 12/23/2014 at 9pm EST. The prize will once again be a Cordwood Puzzle! To be eligible you need to submit your project as an official entry and publish at least one project log during the week.

The main contest entry window closes on January 2, 2015 – but don’t wait for the last minute! Hit the contest page and build some awesome wearable or pocketable electronics!

Trinket Everyday Carry Contest Drawing #2 Results

We’ve held our second drawing for the Trinket Everyday Carry Contest. This week we used a Pro Trinket to pick the random winner. The winner is [mikeneiderhauser] with his project WorkoutAid!

workoutaid[Mike] loves hitting the gym, but hates pulling out his phone or fumbling with his headphones to change songs during his routine. WorkoutAid is designed to fix this problem. It’s essentially a Bluetooth media display and remote. Track metadata will be displayed on a 128×64 OLED. 6 buttons will allow the user to change tracks, volume, or perform other functions. The whole device will communicate with a custom Android application through an RN42X Bluetooth radio.

trinket-prize-cordwoodWe hope [Mike] enjoys his new Cordwood Puzzle from The Hackaday Store. No jigsaws here, cordwood is a puzzle that involves solder! It’s built using the cordwood assembly technique which was popular in the 1950’s and 1960s. We’re not kidding about it being a puzzle either – there are no instructions for this kit! [Mike] will know he’s got it right when all 3 LEDs light up.

buspirate2

If you didn’t win this week, don’t worry, there are still three more chances to win a random drawing! Our next drawing will be on 12/16/2014 at 9pm EST. The prize will be the ever handy Bus Pirate V3.6. To be eligible you need to submit your project as an official entry and publish at least one project log during the week.

The deadline for the big contest is January 2, 2014! More than 60 projects are entered so far, but only the top 50 will receive custom t-shirts. The top three projects will win some seriously awesome prizes, including a Rigol DS1054Z Oscilloscope, a Fluke 179 meter, and a Hakko/Panavise soldering bundle.

So what are you waiting for? Get off the couch and get hacking!

Faster Benchmarks With Slower Hardware

hardware

The Bus Pirate is a cheap, simple, Swiss army knife of electronic prototyping, capable of programming FPGAs, and writing to Flash memory. The uISP is possibly the most minimal way of programming Atmel chips over USB, using less than $5 in components. Although the uISP is using a slower chip and bit-banging the USB protocol, it turns out it’s actually faster when operating as a programmer for SPI Flash memories.

Most of [Necromancer]’s work involves flashing routers and the like, and he found the Bus Pirate was far too slow for his liking – he was spending the better part of four minutes to write a 2 MiB SPI Flash. Figuring he couldn’t do much worse, he wrote two firmwares for the uISP to put some data on a Flash chip, one a serial programmer, the other a much more optimized version.

Although the ATMega in the uISP is running at about half the speed as the PIC in the Bus Pirate, [Necromancer] found the optimized firmware takes nearly half the time to write to an 8 MiB Flash chip than the Bus Pirate.

It’s an impressive accomplishment, considering the Bus Pirate has a dedicated USB to serial chip, the uISP is bitbanging its USB connection, and the BP is running with a much faster clock. [Necro] thinks the problem with the Bus Pirate is the fact the bandwidth is capped to 115200 bps, or a maximum throughput of 14 kiB/s. Getting rid of this handicap and optimizing the delay loop makes the cheaper device faster.

THP Judge: Ian from Dangerous Prototypes

ian-dangerous-prototypesAs we start to get into the swing of The Hackaday Prize we want to take some time to talk to the judges.

[Ian Lesnet] is an accomplished hardware developer. He is, of course, near and dear to our hearts as a Hackaday writer emeritus.

During his time here he came up with an idea for an amazing tool that would let you work with components using a multitude of protocols before heading off to write your firmware. The tool was called the Bus Pirate and [Ian] built an formidable Open Hardware community up around this and several other tools and unique ideas.

[Hackaday] Why do you think people should put together an entry for The Hackaday Prize?

[Ian] There’s never a bad time to hack something together, but with an incentive like SPACE!!! how can you refuse?

[Hackaday] If you could enter, what style of project would you build and where would you try to go with the idea?

[Ian] We like to make electronics hardware that helps debug stuff, but lately we’re rocking more potentially deadly machines that do things. I’d finish up our death chomp robot that slices and dices reels of components into handy kit-sized lengths, while printing values and part numbers on the back paper. Definitely not a winner, but it looks great when it’s chewing parts!

[Hackaday] Is there anything that participants can do with their project write-ups to make your life easier as an adjudicator?

[Ian] Writing and English classes are a special hell for me, but there are some good tips for clear communication. I always start with an overview – “tell them what you’re going to tell them”. This usually means a description of the hack, the major components used, and how they work together. The introduction should have enough info that another hacker can piece everything together without digging through the whole writeup. An overview illustration or hand drawing explaining the methodology is really helpful for visualizing a complex hack.

[Hackaday] You have vast experience with Open Hardware projects. I think one of the tough things for beginners is navigating the Open Hardware licenses available. Do you have any advice for noobs to learn more about licenses and perhaps on narrowing them down?

[Ian] If you want the world to be a better place put all your work in the Public Domain (Creative Commons Zero) for anyone to use however they want. That’s the license with the least bullshit attached. If you have a billion dollar secret idea by all means keep it in your closet and show it to no one, because that’s about the only thing that will protect it from innovators and imitators. Other licenses fall somewhere in the middle, but for our stuff we’ve decided to go Public Domain wherever possible.

[Hackaday] We’ve seen a lot of collaborative projects come out of DP. Do you have any advice you can share for finding collaborators for a hardware project?

[Ian] The best advise I’ve heard (not mine) is to wait until a project is done to decide ownership share. Hackers are quick to settle on equal ownership, but during the project (or the long haul support period) collaborators may loose interest or be unable to continue as planned. With equal ownership remaining team members must finish the whole project just get a portion of the future gains. It demotivates the remaining team members and kills momentum. By waiting to see how things play out you’ll have a much better idea how to divide ownership for a successful long term collaboration.

[Hackaday] Can you name a favorite piece of bench equipment and tell us why it is at the top of your list?

[Ian] For years I used $10 “fire starter” soldering irons, even for surface mount soldering. An adjustable iron is a nice thing to have though, along with a bright light and head magnifier. A hot air rework station is the tool I can’t live without. It’s for fixing mistakes, which I make constantly, and when it dies everything crashes to a halt.

[Hackaday] What do you think of the evolution of the kit and small-run electronics industry over the last decade? Where would you like to see it go, and do you have any insights about what will get it there, or possible barriers that stand in the way?

[Ian] It’s huge now. Crowd source funding sites alone have become home to how many cool hacks, designs, and projects? Local, short-run assembly houses using a fairly standard set of components would make it a lot easier to get into hardware without 1337 soldering skillz.


SpaceWrencherThe Hackaday Prize challenges you to build the future of connected devices. Build the best and claim a trip into space or one of hundreds of other prizes.

The Arduino Operating System

WGPIOhile Arduino and its libraries are the quickest way to interface with a sensor and blink an LED, sometimes you shouldn’t have to write and compile code to do something exceptionally simple. [Oliver] realized most of the overly simple functions of a microcontroller could be done from a command line running on that microcontroller and came up with the MiniPirate, the Arduino command line tool.

The MiniPirate is just a sketch compiled on the Arduino that allows pins to be set high or low, set a PWM value, or reading and writing I2C bytes. It’s basically an extremely slimmed down version of the Bus Pirate meant for extremely simple modifications of circuits and peripherals.

[Oliver] demos his MiniPirate by taking a DS1307 real-time clock, wiring up the I2C bus, and writing values to set the time. It’s a very simple implementation meaning he needs to write everything in hex, but it’s still easy enough to find a use in many other projects.