ATmega1284 as an 8-voice 32 kHz synthesizer

A couple of things strike us about this 8-voice 32 kHz synthesizer. First is the cleanliness of the prototype. As you can see, each part has plenty of room on its own board and all are interconnected by 10-pin IDC ribbon connectors. But you’ll have to see the video after the break to enjoy the impressive sound that this puts out. You’ll hear it play the Super Mario Bros. theme; it does it with passion!

To get audio from the digital microcontroller [Mike] built his own R2R digital to analog converter. The resistor ladder is built from sixteen resistors, which feed a rail-to-rail amplifier. The sound is mono but the playback is polyphonic thanks to the work done by the ATmega1284. It is reading MIDI commands coming in from an external controller (we assume it’s the computer on which the hardware is sitting). The chip’s 128 KB of Flash memory leave plenty of room to store samples, which are selected from a lookup table based on the MIDI data. If more than one sample is to be played the chip averages the data and sets the 8-bit output port accordingly.

[Read more...]

An Adafruit Raspberry Pi extravaganza

The folks at Adafruit are busy as a bee working on bringing some of their really cool boards to the Raspberry Pi platform. Here’s a few that came in over the last few days:

16 servos is almost too many

Servos require a PWM output but the Raspi only has hardware support for PWM on a single GPIO pin; certainly not enough to build a gigantic, city-leveling robot. [Kevin] over at Adafruit put together a tutorial for using this 16 channel servo driver with the Raspi.

12 bit DAC

With only one PWM pin and no analog out, it was only a matter of time before someone hooked up the Adafruit 12 bit DAC to the Raspberry Pi.

16×2 LCD displays

Both the servo and DAC builds use the Adafruit I2C library and a bit of Python. Of course it’s possible to treat the GPIO pins on the Raspberry Pi as digital outs, just as [Mikey] did with his Raspi LCD display tutorial.

So, what distro are you using?

Of course all these builds use Adafruit’s Occidentalis distro, a maker-friendly Linux distro we’ve posted about before. It’s too useful to languish as a single Hackaday post, so here it is again.

Chiptune player uses preprocessed .MOD files

[Kayvon] just finished building this chiptune player based on a PIC microcontroller. The hardware really couldn’t be any simpler. He chose to use a PIC18F2685 just because it’s big enough to store the music files directly and it let him get away with not using an external EEPROM for that purpose. The output pins feed a Digital to Analog Convert (DAC) chip, which in turn outputs analog audio to an LM386 OpAmp. The white trimpot sandwiched between the chips controls the volume.

The real work on this project went into coding a program which translates .MOD files into something the PIC will be able to play. Because of the memory limits of the chip it is unable to directly use all of the instrument samples from these files. [Kayvon] wrote a program with a nice GUI that lets him load in his music and page through each instrument to fine-tune how they are being re-encoded. The audio track from the video after the break doesn’t do the project justice, but you will get a nice look at the hardware and software.

[Read more...]

From reference design to USB sound card

[Entropia] decided to try his hand at rolling is own sound card. He picked out a DAC chip, started his prototyping by studying the reference design from the datasheet, then went through several iterations to arrive at this working model.

He chose to base the board around the PCM2706. It’s a digital to analog converter that has built-in USB support; perfect for his needs. It’s got a headphone amplifier, but is also capable of putting out S/PDIF signals for a digital amplifier to pick up and use. Not bad for a part that can be had for right around eight bucks.

The first PCB he designed had a few electrical and footprint errors. But he was able to get it to run by adding some point-to-point jumpers, and bending the legs of his capacitors to fit the board area. With those issued accounted for he ordered a second batch of boards. These went together nicely, but the headphone output was incredibly loud. Turns out the filtering circuit had the wrong resistor and capacitor values. Changing them around, and swapping the audio output so that the correct channels were patched to the audio jack brings it to the first release version seen above.

Playing MP3s from an FPGA

Building an audio player is a fun project. It used to be quite a task to do so, but these days the MP3 decoder chips are full-featured which means that if you know how to talk to other chips with a microcontroller you’ve got all the skills needed to pull off the project. But that must have been too easy for [Ultra-Embedded], he decided just to build an MP3 player out of an FPGA.

It’s not quite as difficult as it first sounds. He didn’t have to figure out how to decode the audio compressions. Instead he rolled the Helix MP3 decoder library into the project. It had already been optimized to run on an ARM processor, and since he’s using a RISC soft processor the translation wasn’t tough at all. He’s using a 24-bit stereo DAC chip to bridge the gap between the audio jack and the FPGA output. Clocking that chip with the FPGA isn’t ideal and causes 44.1 kHz audio to run 3% too slow. He says it’s not noticeable, which we believe. But if you try to play along with a song the pitch shift might end up driving you crazy.

If you’d prefer to just stick to the microcontroller based players this one’s small and inexpensive.

Dabbling with CPLD generated VGA signals

It seems like all the cool kids are leaving the 8-bit hobby microcontrollers in the parts bin and playing with more advanced parts like Complex Programmable Logic Devices. [Chris] is no exception to the trend, and set out to generate his own VGA signal using one of the beefy semiconductors.

It seems that he’s using the acronyms CPDL and FPGA interchangeable in his post but according to the parts list this setup uses an Altera EPM7128SLC84-7N CPLD. In order to generate the VGA signal he needed a way to convert the digital signals from the chip into the analog values called for in the video standard. He chose to build a Digital Analog Converter for the RGB color values using a resistor network which he calculated using PSpice. The other piece in the puzzle is a 25.175 MHz oscillator to clock the CPLD. As you can see after the break, his wire-wrapped prototype works exactly as designed. The example code generates the rainbow bars seen above, or a bouncing box demo reminiscent of a DVD player screen saver.

Want to know more about programming CPLDs? We did a tutorial on the subject a while back.

[Read more...]

Your first Digital to Analog Converter build

Have you ever built a Digital to Analog Converter before? This is a circuit that can take the 0 or 5V coming off of several digital logic pins, combine them together, and spit out one analog voltage that represents that value. If you’ve never made one, here’s your chance. [Collin Cunningham] over at Make put together another lab video about DACs which we’ve embedded after the break.

The circuit above uses an R-2R resistor network – often called a resistor ladder – which you can learn much more about from the reference page that [Collin] links to. Although a DAC in an IC package is by far the most commonly found application, we do see these R-2R networks in audio hacks from time to time.

[Read more...]

Follow

Get every new post delivered to your Inbox.

Join 92,130 other followers