Note: if you want to download the gerber for this post's MSOP .5mm to PDIP adapter board, you can get it from PCBWay's Project Page, here.
OK on to the post:
Hmm...again: 10K audio from an Atmel 328. Possible?
It can be done using a lookup table and GPIO with parallel resistor ladder DACs, or via its on board PWM.
This post covers a variation of the PWM idea but it sounds kinda crappy.
The idea: for the last few weeks I have been working on an audio waveform generator based on an Atmel 328P and Embedded C.
That's an 8 bit microcontroller with no DMA or I2S, and so far I've found it too slow to produce high fidelity audio--low frequencies can be produced easily, but anything above about 300hz exhibits varying degrees of distortion.
But I read (here for instance) that you can use an 8 bit Atmel Microcontroller's PWM to get up to about 8K at output by varying a PWM signal's duty cycle then turning the PWM signal back into an acceptable analog voltage using a low pass filter.
Fine, but let's have additional fun--let's see if we can use a PWM DAC, such as an LTC2645, instead of the filter.
What is a PWM DAC? To understand that, you need to have a basic idea how PWM works--a good description is here.
For the PWM to DAC IC, pulse width modulated signal(s) go in, and based on the signal's duty cycle, the chip produces one or more analog voltages at its output(s).
PWM ICs have many applications in electronics, you see them frequently in power supplies for instance. I am not sure how often PWM to voltage is used in DiWhy audio, but what the heck, I can't see why this wouldn't work, let's try it!
Sample and Hold: I got a few LTC2645's; its datasheet looks straightforward, and the IC replaces the various filter RC components, potentially making the entire audio generation circuit's footprint small and simple.
But one problem for a DIY maker is that the LTC2645 is tiny--MSOP, 16 pins, 5mm between pins:
The LTC2645 compared to a U.S. Nickel. For our friends abroad, a nickel is 21mm across. |
That's really, really small.
What to do? I reached out to my sponsor, PCBWAY, for help, and I designed a simple 16 pin 5mm MSOP to PDIP breakout board. Then, I uploaded the gerber. Happily I got 5x PCBs from PCBWAY within a few days (!!) along with a stencil they created for the project and got to work.
Overall fab for 5mm MSOP's wasn't easy due to its extremely small size, but with some patience I got it working using the same hot air/SMD stencil process you can read about in the post here.
If you want to play along at home, please download the files and gerbers for this adapter board from PCBWAY's Project pages, the gerber is here.
Next, on to some almost useless but slightly entertaining bench photos:
Not looking too bad....each board can accommodate two MSOP chips, but for sanity I just populated one half. That gives me a bit more room to tape down the PCB for fabrication. |
Oops, this chip got installed upside down, oh well! |
Pin time.... |
No photo but: After soldering the pins, I used a dremel tool to saw each board in half, and was left with 2 dusty BoB's.
In need of some tidying up, but ready to go.... |
After a quick clean with flux remover, I was ready to test.... |
....with things not looking too bad under the microscope. |
VDD for the LTC2645 is 5V; filter cap is .1uF |
No comments:
Post a Comment