infiniteneslives wrote:313K assumes the APU channels have a max volume of 300mV. Take it for what it's worth, but based on my testing a single APU square @ max volume is more like 150-200mV. 300-350mV is both squares summed, I'm guessing that is what your and lidnariq's tests were measuring.
Exactly.
If the OEM pulse channels are 150mV each into 20kΩ, then that's 7.5µA at max; 5V and 7.5µA is 670kΩ. To match the NES's built-in 20kΩ and the typical 47kΩ added, I'd assume you'd want a ≈600kΩ resistor out of the PWM DAC ...
if it's still only one channel being mixed in.
Personally, I'd be tempted to mix multiple channels.
uXe wrote:My problem is that I would not be using a DAC with amplitude settings, and be able to just reduce the signal down that way. I'm looking at a PWM pin on an 8-bit AVR, or likely just software PWM on a digital pin, so it's either on or off, 0 or 5V, full stop.
It's completely ridiculous, but you could add an external resistor DAC to add volume control without having to manage the IRQs from a PWM DAC.
Something like:
Code: Select all
PWM ---R---+
PA0 ---R---+
PA1 --2R---+
PA2 --4R---+
PA3 --8R---+---500k---expansion port
And you could then toggle bits in DDRA to adjust the volume.
I say "ridiculous" because in practice, your microcontroller is probably not too busy to manage updating the PWM value to serve as a DAC.
FrankenGraphics wrote:The max volume of the APU squares aren't very useful, IMO. There's many times i've wished for an "x.5" setting but i've never felt the need for maxing the squares. Rather, i avoid it.
In thinking about this, it occurs to me that we could sink current out of the mixing node to add software-controlled master volume control.
If we had something like this:
Code: Select all
||
+--- expansion port --- 20k --- mixing node
/ ||
PWM ---R-+-+---|< npn ||
| | \ ||
R C | ||
| | | ||
+-+------+--gnd ||
although it might be more useful to pull the mixing node up to 5V (instead of pulling it down to ground as in this schematic) for greater dynamic range.