There’s a special place in our hearts for chip tunes generated with your favorite microcontroller. But why stop there? Full-featured audio is a great challenge and it’s not often we see examples of this caliber. It puts out CD-quality audio using not much more than a microcontroller.
How do you get 16-bit audio out of an 8-bit microcontroller. We’ll give you a hint: two pins are used. Not helping? Here it comes: two 8-bit
DACs PWM outputs are used on this chip, the ATmega1284. One is used for the lower eight bits, the other handles the upper. The two are combined using carefully calculated precision resistor values and the results are beyond what you imagine. This is produced at a bitrate of 44077.135, slightly off from the 44100Hz standard but we challenge you audiophiles to tell the difference. The wave files are served from an SD card read by the chip using the Petit-FatFs library.
There are so many great things about this project. First off, following [Wancheng Zhou’s] example will let anyone with even basic microcontroller skills build a digital audio player for an [Andrew Jackson] and a couple of [Washingtons]. Secondly, those with a medium uC skill level will want to take the idea and implement/debug it for themselves. Bringing it home, [Wancheng] shows how to gauge the quality of the audio output using FFT.
If you didn’t figure it out by the time of year, this is yet another example of a Cornell ECE 4760 final project. Shout out to [Bruce Land] for inspiring awesome projects and requiring extensive documentation of the projects which itself promotes deeper understand all around.
15 thoughts on “8-Bit Chip Rocks 16-Bit 44.1kHz Tunes”
Why not use build 38 1 bit DACs from tubes connected to a boatload of ATTiny boards which communicate with a Rpi via serial? You could use 16 for left and 16 for right with 6 to spare. Then all you have to do is embed to entire thing into a chair or something.
Aha, so, it seems the shoe is on the other foot. Often times, even suggesting a project like this one is considered too “serious” or “boring”. People tend to prefer sillier projects, but this time my friend… *ahem*… YOU are the one who is missing the point.
No, I’m just tryning to start a meme.
I actally really like the project and when I’m done with the details, perhaps I’ll even have something topical to say about it, but for now.. It’s memes.
Was the song selection a desperate cry for help?
Voxmulla’s comment was the desperate cry for help
You make all worth it!
Didn’t the Mozzi Library on arduino already do something similar? iirc Mozzi generates all it’s noises in realtime though….
Actually I tried arduino before…u can never achieve 44.1KHz. It is difficult even with 22.1KHz. I think the reason it generates so much noise is the imbalance between the time of audio data retrieving and consuming…
The poster really needs to read the original article before posting. The atmega1284 series chips do not have DACs other than as part of a feedback circuit in the ADC. This devices uses PWM for audio output, not DAC. That said, is one heck of a build.
Quite right, fixed.
How does temperature affect the values of the combination of precision output resistors and the risk of distortion of the audio signal?
The resistance change would be the tempco parameters of the resistors he uses.
Don’t over look the actual value (probably in the order of 30-40 ohms), the change of the output driver impedance over operating temperature/voltage (much larger than resistor tempco) and that it is not symmetrical between ‘0’ & ‘1’.
Great job dude, ripped of the player from elm-chan site, just like the Petit FAT FS.
I knew elm-chan’s project based on ATtiny85, that’s an amazing job. However, it seems that chan’s player can only be separately programmed to play either stereo or mono, and this one looks like to be able to process all kinds of wave files, that’s an improvement.
That’s because Elm-Chan has chosen to implement in the smallest chip he could find so he doesn’t have four PWM outputs available at the same time but I agree that the principle is exactly the same.
Please be kind and respectful to help make the comments section excellent. (Comment Policy)