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 #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 EDC Contest Entry: Shame On You!

[BDM] is helping others keep WiFi safe with “Shame On You!“, his entry in Hackaday’s Trinket Everyday Carry Contest. We all have that family member, friend, or neighbor who just can’t seem to get their WiFi locked down. Shame On You will show them how easy it is to detect such a hotspot, which hopefully will motivate them to correct the issue. [BDM] was a bit worried when he learned that Adafriut already has an open WiFi detector as one of their Pro Trinket example projects. However, we think he has added more than enough features to make his project stand out.

shame2Shame On You is using a Pro Trinket running at 3.3 volts, along with an ESP8266 WiFi module. Power comes from a LiPo battery and is handled by an Adafruit LiPo backpack. Like several other EDC contest entries, Shame On You is using a cell phone shell as a case. The display is a 1.27″ color OLED with an SD card. A disc style vibrator motor will also help get the user’s attention.

[BDM] hasn’t made much progress this last week, as he’s been battling some Christmas light cutting bandits. Logging each week’s work doesn’t always have to be technical, sometimes life intervenes!

We’re heading into our third week here in the Trinket Everyday Carry Contest, but there is still plenty of time to enter! The main contest runs until January 2, but we’re having random drawings every week! Don’t forget to write a project log before the next drawing at 9pm EDT on Tuesday, December 16th. You and all of the other entrants have a chance to win a BusPirate 3.6 from The Hackaday Store!

 

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!

Unbricking A BluRay Drive

All BluRay player, devices, and drives contain a key that unlocks the encryption and DRM present on BluRay discs. Since 2007, the consortium responsible for this DRM scheme has been pushing updates and revocation lists on individual BluRay releases. Putting one of these discs in your drive will brick the device, and this is the situation [stephen] found himself in when he tried to watch Machete Kills. Not wanting to update his software, he searched for a better solution to unbrick his drive.

Every time [stephen] played or ripped a disc, the software he was using passed a key to the drive. This key was compared to the revocation list present on the drive. When a match was found, the drive bricked itself. Figuring the revocation list must be stored on a chip in the device, [stephen] broke out the screwdriver and started looking around inside the drive.

There aren’t many chips inside a modern BluRay drive, but [stephen] did manage to find a few Flash chips. These Flash chips can be dumped to a computer using a BusPirate, and comparing the dump to a publicly available ‘Host Revocation List Record’, [stephen] was able to find the location on the Flash chip that contained the revocation list.

The next task was to replace the revocation list currently on the drive with an earlier one that wouldn’t brick his drive. [stephen]’s MakeMKV install made this very easy, as it keeps a record of all the revocation lists it runs across. Updating the Flash in the drive with this old list unbricked the drive.

This is only a temporary fix, as [stephen] still can’t put a new disc in the drive. A permanent fix would involve write protecting the Flash and preventing the drive from ever updating the revocation list again. This would be a very complex firmware hack, and [stephen] doesn’t even know what architecture the controller uses. Still, the drive works, saved from terrible DRM.

Reverse Engineering A GPS Watch To Upload Custom Firmware

 

Sometimes GPS watches are too good to be left with their stock firmware. [Renaud] opened his Kalenji 300 GPS watch, reverse engineered it in order to upload his own custom firmware.

The first step was to sniff the serial traffic between the PC and the microcontroller when upgrading firmware to understand the protocol and commands used. [Renaud] then opened the watch, figured out what the different test points and components were. He used his buspirate with OpenOCD to extract the existing STM32F103 firmware. The firmware helped him find the proper value to store in a dedicated register for the boot loader to start.

By looking at the disassembly code he also found the SPI LCD initialization sequence and discovered that it uses a controller similar to the ST7571. He finally compiled his own program which uses the u8glib graphics library. Follow us after the break for the demonstration video.

Continue reading “Reverse Engineering A GPS Watch To Upload Custom Firmware”

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.