PIC 18F22K14 as class D audio output amplifier, 2 components...
I have updated the asm file, this the latest one: ftp://panteltje.com/pub/audio_pic/
This is now a little universal module. This PIC has 3 extra inputs that you can connect a switch or logical signal to:
Pin assignement: pin 1 Vdd 5V pin 2 volume up (internal pullup present, switch to ground) range 1-100. pin 3 volume up same. pin 5 PWM out speaker + pin 6 PWM out speaker - pin 10 serial out for RS232, 19200 Bd, 1 start bit, 8 data bits, 1 stop bit. pin 11 mute, 0 V mutes, internal pullup active, so if left open no muting. pin 12 serial in for RS232. pin 13 test puse out, to measure AD conversion speed and time. pin 17 audio in, 2 Vpp, needs 1V DC bias. pin 19 1V out, can be used to bias pin 17 via a 100k resistor. pin 20 Vdd + 5V, needs to be decoupled.
You can set volume via RS232 too.
The code needs some cleaning up, to remove the not used stuff, probably more work then writing it... Have fun.