Re: Tinker, 6502 in a can.
Posted: Tue May 09, 2023 4:38 am
barnacle wrote:
GARTHWILSON wrote:
What I have not done, but thought about a lot, is actually calculating the waveforms in software. It would take quite a bit of processing from one timer interrupt to the next, but I think a 65c02 running near 20MHz would have the processing power to combine quite a few complex voices and put the summed output out to a D/A converter,
Quote:
Not much more effort to do multiple samples rather than one, but it depends how complex you get with attack and decay which you'd want to manage without a multiply or divide
Yeah; for that, you'd kind of have to keep the sounds separate and put each one through a digital pot or multiplying D/A before combining them. In an experiment I did in 2014 for a work project, I found that ¼dB and even ½dB steps were inaudible if I applied the change at the zero crossings.
Quote:
Less convenient that the ear is incredibly good at hearing sampling noise, so the bigger the waveform the better, as a general rule.
My experience is that you'll be fine as long as the anti-alias filter cuts off adequately below the Nyquist frequency. If the number of bits of precision is adequate, the first distortion products will be beyond the Nyquist frequency, regardless of the frequency of the signal. For example, if you sample at 16ksps and sample a 200Hz sine wave such that there are 16k/200=80 samples per cycle, the first distortion products will be the 79th and 81st harmonics, which are 15.8kHz and 16.2kHz, way beyond the anti-alias filter's cutoff. With a 2kHz sine wave and the same sample rate, the first distortion products will be the 7th and 9th harmonics, which are 14kHz and 18kHz, again way beyond the filter's cutoff.
About USB: Since the PC host is pretty much a black box anyway, I don't have much trouble with treating the USB-to-UART adapter as part of the PC, even though it's external. I would want it external to the 65xx project too though. I have an FTDI USB-COM232-PLUS1 adapter, and the software that came with it is very clumsy compared to what I was doing with a DOS machine and its RS-232 port. On the latter, what I do is mark a block in a source-code file, and "print" it to the COM port, without suspending the text editor or using any terminal software or anything else. The block marked can be as little as one character or as much as dozens of pages. The text editor thinks it's just printing to a serial line printer, and the target computer takes the text in as if from a lightning-fast and 100% accurate typist an RS-232 keyboard, and compiles, assembles, or interprets, on the fly, as appropriate.
It is my understanding that RS-485 is about three times as fast as RS-422, 35Mbps at 33 feet, which is nearly three times the speed of USB 2.0 also, and at twice the distance. Intelligence could be implemented for things like polling what kind of device is attached. Even some RS-232 devices and controllers had speed negotiation. I much prefer the situation where intelligence is possible but not required.
I also prefer it when there's a standard connector, or at least we can make up our own cables on the workbench. I have USB devices with lots of different connectors (there are 11 altogether), and I keep cables for the three I use most plugged into the PC. In one of our work products I designed a few years ago, I was required to put a micro USB connector on it for battery charging. Mouser only had one that met the requirements. Unfortunately they keep breaking, so now on the production line, we have to put JB Weld epoxy on them all. I have a little camera card interface that plugs into the PC by USB, and its USB connector failed about the third time I used it.
A popular FTDI chip has been counterfeited in China, labeled with the same brand and logo, and people buy it online; so FTDI made the software driver brick the counterfeits. Apparently there's an un-brick-it solution, at https://hackaday.com/2015/02/08/unbrick ... ftdi-chip/ .