Code and Life

Programming, electronics and other cool tech stuff

Supported by

Supported by Picotech

A bit of audio tinkering

I’ve been quite busy the last two weekends, first on a weekend holiday trip to Tallinn, Estonia, and then playing in the Helsinki Casual go tournament which successfully took most of my time last weekend. This has somewhat delayed my continuation to the composite video decoder project.

However, I haven’t been resting on my laurels completely even electronics-wise. My trip to Tallinn had one good by-product, namely new Audiotechnica ATH-M50 headphones. They are a marked improvement over my previous HD-500 Sennheisers, and got me inspired to getting a headphone amp, a tube-based Little Dot mkIII to be more exact. The 32 ohm ATHs don’t necessarily need an amp, but now I’ll at least be prepared if I ever end up getting something like HD-650s.

While researching for a proper USB DAC I came across an amazing audio blog by NwAvGuy. Compared to a lot of “audiophile” coverage he seems to have a solid engineering perspective to audio issues, and he has put an amazing effort to long articles that deal with many issues that surround headphone amp gear.

In addition to great scientific info, NwAvGuy has also designed a USB DAC called ODAC, which I ordered from Head’n’Hifi (they conveniently ship inside EU so no customs). And while I was at it, I couldn’t resist getting a DIY version of NwAvGuy’s O2 headphone amplifier. Read on for my experiences on building it and pitting it against the Little Dot mkIII tube amp.

Read post

Color composite video decoding with Picoscope 3206B

I recently finished an improved version of the NTSC composite video decoder previously featured here at Code and Life. With the bigger buffer of Picoscope 3206B, I was able to capture enough samples per frame to add color. A Youtube demonstration video has just finished uploading and you can view it below.

I already talk a bit about the techniques used in the new version, as well as the new features. For the readers of this blog, I’m planning a more detailed technical explanation, which I’ll put up as soon as I get the infographics for that one done.

Enjoy the show! If you want to take a look at the sources (or better yet, have a 3000 series Picoscope at hand), you can grab the source package. My code is licensed under GPL, see README.txt inside the archive for details.

Update: Technical details now published! Implementation details to be added in another post a bit later.

Read post

Donations, ATtiny2313 Breadboard Headers Left

In case anyone missed it the first time around, there are codeandlife.com ATtiny2313 breadboard headers still available for donations that exceed $10 ($10.01, $15, etc.) to the blog. If you want one, please send me an e-mail (jokkebk at codeandlife.com) with your postal address after donating, and I’ll ship one of these cuties to you as a small thanks!

All proceeds from the PayPal donations will go towards acquiring new interesting stuff to write about in this blog, so if you like the content, please consider donating!

Read post

Breakout Bonanza and DS1307 Realtime Clock

As if I didn’t have enough things on my “to try when I have the time” list already, I recently did a little shopping in both Adafruit and SparkFun. Both had several nifty breakout boards available that promised to speed up and streamline my breadboard projects a lot. In addition to some SMD breakouts that are still in their sealed bags, here’s what I got:

I had a lot of fun soldering the breadboard headers to these little guys. Many are for future projects, like the frequency generator which I’m planning to use for some RFID experiments, and some are just to avoid stripping apart stuff like the connector breakouts. As today’s main topic, I’m covering the DS1307 realtime clock (RTC) breakout in more detail. If you are interested in some of the other items, drop me a comment and I’ll get back to it!

DS1307 Realtime Clock

A realtime clock is simply something that keeps record of the time. Usually, these types of clocks are paired with a small coin cell battery that enables them to keep on counting even if the rest of the circuit is powered of. Such is the case with this breakout, too. Adafruit has an excellent tutorial covering the assembly of this device, all you need is some solder and an iron.

After getting it together, it took me a while to get it working. I used Bus Pirate to communicate with the chip, with the following connections:

Read post

Tips and Tricks: Flashing already soldered MCUs

I have been wanting to try this one out ever since I soldered together my USB password generator six months ago, just to realize that I would’ve actually liked to make a few changes to the firmware. The problem with my design was, that I had managed to pack everything so tightly, that there was no hope of reaching the ATtiny85 pins via normal methods to reprogram it.

I initially tried to use a 8-pin DIP socket and press it against the MCU, but it soon became apparent, that I could not keep it stable for all the pins to keep contact long enough. Lacking proper microhooks, I had to postpone the idea shown in the above photo until I just recently put my hand on this set of IC hooks from SparkFun.

The five IC hooks came one hook short of the six needed by the ISP header, but fortunately/unfortunately one of the pins was impossible to access even with these tiny hooks, so I manually held a yellow jumper wire against the MISO pin while running avrdude. Did it work? Look for yourself:

Definitely not rocket science, but for $4.95, I’d say it’s a pretty good deal!

Read post

Picotech sponsorship & Site updates

I have some great news regarding the site. As long time readers probably remember, I’ve done several hacks with my Picoscope 2204 in the past, including a $5 logic analyzer and the latest composite video decoding article. Since I really like their product, I contacted Picotech and asked if they would be interested in working together more closely.

To my delight, the friendly people at Picotech had also noticed the hacks and agreed to sponsor the Code and Life with the extremely capable Picoscope 3206B. In return, I’ve added a “Sponsored by” box to the right which features Picotech and their Picoscope products, and will continue to feature Picoscope-related stuff in the future, and they’ll also have the permission to use those articles on their own. My warmest thanks to Picotech for their donation!

The first concrete result of the new, beefier 200 MHz scope is that I was able to redo many of the measurements in my Raspberry Pi GPIO benchmark. While excellent otherwise, my older Picoscope 2204 with 10 MHz bandwith and 100 MS/s sampling rate was not capable of analyzing the 14-22 MHz waveforms generated by the Pi very accurately, while this was no problem for the 3206B which has 10x the maximum sampling rate: See Benchmarking Raspberry Pi GPIO Speed for details!

Now that I have a scope with more buffer memory, I’m also going to revisit the composite video decoding and see if I can get full resolution, maybe even colors out of my Raspberry Pi composite output using the 3206B. After I get some experience with the new scope, I’ll likely do a review similar to my previous Picoscope 2204 review.

Read post