Hacker News new | ask | show | jobs
by salehenrahman 1898 days ago
I could almost swear that you can even create a class-D amplifier with the ATTiny85, with a clock rate of ~15kHz.

Obviously it's not going to be ideal for an audiophile, but the quality is not too shabby. A fun project for those curious.

Still, stick to off-the-shelf class-D amplifiers, such as the PAM8403.

https://www.youtube.com/watch?v=O8of40tFsD8

2 comments

> I could almost swear that you can even create a class-D amplifier with the ATTiny85, with a clock rate of ~15kHz.

Pretty sure you can do that. A Class D amplifier is to a class A/B traditional one what a switching power supply is to a linear one, so I would expect to be able to make a class D amplifier using for example a PWM driven H bridge usually employed to drive electric motors, or a chip used to make switching power supplies. If they can work at high frequencies (say 50KHz or more) then they should work; all it's needed is modulating their input or feedback pins the right way. Probably not HiFi for the sensitive ear, still good enough.

That would be really cool. Never got around to trying it, but I'm really curious about the subjective quality on the 12bit A/D conversion looping back to PWM D/A.

LoFi effects pedals could be fun.

-The 12 bit A/D provides a (theoretical) 72dB of S/N, so if you can do that at a decent sample rate to get sufficient bandwidth, the digitizing should be good.

As long as the PWM D/A has a good clock to keep the PWM ratio accurate, I think it should be eminently listenable, given a proper reconstruction filter and a decent power supply.

It would be fun to try this.

Check this out -- really good discussion of bits and SNR: https://www.xiph.org/video/vid2.shtml jump to the 11:00 mark to find out just how many 'equivalent bits' those old cassette 'mix tapes' of yours had...