On Sat, Oct 8, 2011 at 2:34 PM, Michael Watterson wrote= : > I wrote a Wave to PWM audio to play sound on the PC speaker in Modula-2 > on a 286. Native (DOS only used to load the program and PC speaker > really can only be turned on/off). The frequency just needs to be > 2x > the max audio frequency. 5bit resolution is really poor but > recognisable. 8bit can be reasonable. 10bit PWM resolution is quite > good. Unless you are doing HiFi, 16bit is overkill. I'll be using the MSP430 and CCR for PWM, so 16 bits is no more expensive than any fewer bits. > Higher means less/easier filtering but more FET switching loss. You can > just rely on the mechanical filtering of the loudspeaker for a simple > application where speaker & supply is close to FET! I don't have any 3V logic-level FETs on-hand, so I was planning to use the three-transistor gate drive circuit that received a fair bit of discussion a month or so back, so I think I should be able to turn the gate on and off rather quickly. I do plan on doing a finger test on the TO-220 heat sink tab to get a feel for losses as I up the frequency. > For better output range and no DC offset you need 4 fets in bridge, but > only one or other of the low side FETs needs PWM drive. (or 2 x PNP > transistors and two FETs, use 4 PIC pins) I have read the design notes on half-bridge vs. full-bridge drive, but in this particular application I'd prefer to just stick with a simple 1-rail power supply. I can cope with only 1/2 of available cone travel. > About 80KHz is minimum for really good non-HiFi. For HiFi you might want > higher PWM frequency. Ensure PWM harmonics are not on an AM station. If > in doubt put all in screened box :-) Had not thought about this. Since I have so many bits to play with, I could easily adjust the PWM frequency to spread out any noise. I think I will definitely have to experiment with this now. It is unfortunate that my only measurement equipment would be ab actual AM radio. -p. --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .