Cassette Interface Assistance
bhilpert at shaw.ca
Tue Feb 28 14:34:07 CST 2017
On 2017-Feb-28, at 7:55 AM, Jim Brain via cctalk wrote:
> Analog, which is my nemesis, curses me again.
> I have a cute idea for a cassette port project for the Tandy line of computers (the ones with the cassette port). I have a Coco 3 on the bench, so I scoped the output line while doing 'csave "jim"'. The signal looks to be just under 1V PtP (0-1V on the scope), and rests at about .3V when not sending data.
> I have tried 6 different ways to boost the signal to 5V digital, to no avail, and so I ask humbly if someone with analog knowledge might be able to assist.
> I first tried to boost the signal with a transistor (with variations using a N channel FET as well). Arguably, that was foolhardy, and it did not work.
> My second attempt was based on this link that was shared with me:
> The output from the Coco3 does not appear to be "loud" enough to work with this circuit.
> So, I finally decided a comparator solution would be required.
> First, I tried a design using a 741 op-amp, which failed miserably, but probably would have worked, but I tried to merge the design from the Coco1, and replace the LM339 in the Coco 1 design with the 741, and I feel I did not merge the designs well :-)
> I then tried using the comparator in an Atmel AVR, and had minimal success. By biasing one input via a variable resistor to around .8V, I was able to get a digital stream, but it did not look like the data stream of the cassette format.
> I then pried an LM339 out of my Coco1 and replicated the circuit int the Coco 1, as noted in the tech manual:
> Color Computer Technical Reference Manual (Tandy).pdf <http://www.colorcomputerarchive.com/coco/Documents/Manuals/Hardware/Color%20Computer%20Technical%20Reference%20Manual%20%28Tandy%29.pdf>
> I was shocked that I had no success with that design at all. I assumed (wrongly, it appears) that the Coco cassette input circuit would read the output of it's output circuit. Beyond the possibility that my components are defective or I wired it up wrongly, I can only theorize that Tandy assumed that all tape recorders would AGC the output and then feed a 2V PtP signal back to the Coco (the Coco 1 circuit looks to bias the comparator at 1.05V (not sure about the feedback resistor's impact))
> I can fiddle around with the AVR solution, which might work if I can smooth out the spikes and bias the comparator right, but it just bothers me that the Coco 1 circuit does not work, as I assumed I would at least have success by copying a working design.
In answer to the final point, and the interests of some analog education, looking at your reffed pdf, page 75, the reason (or one reason)
your duplicated Coco input circuit is not working is the gross impedance mismatch between the coco tape output and input circuits.
The output is high impedance: a 75K/24K voltage divider.
The input is quite low impedance: a 220-ohm resistor to GND right at the front.
When you connect them together they form another voltage divider which drops the coco tape output down to a few millivolts across
the 220-ohm R, which then is the input to the 339 comparator (pin 10).
The trip point for the comparator is set at 1.05V by the 56K/15K voltage divider at pin 11.
If you want to play with the 339 comparator circuit, you could try adjusting the comparator trip point voltage divider
(replace one of the 56K/15K appropriately) to get, say, 0.25V at pin 11;
strip away all the input stuff at pin 10 and feed it directly from the tape output.
(Could be a good exercise, watching the 399 output along with the tape output on a 2-chan scope).
Using the internal AVR comparator sounds like a better final solution (fewer components), but in devising an
input circuit for the AVR you may be running into the same issue of loading a high-impedance source.
The 8.2K/6.8K R divider in the rakettitiede AVR circuit you tried is still quite disparate to the coco tape output and will load it,
reducing the level seen by the AVR comparator. The blocking cap and biasing also changes the levels you would be looking for at the comparator.
You could try multiplying the Rs of that divider up into the 10-100Ks range (probably best to reduce the 0.47 shunting C by a similar factor or more).
However, considering you have a known and fixed source circuit (the coco tape output) you might try something even simpler for the
AVR comparator input, such as just a 1K series R followed by a 220K to 470K R to GND. The comparator should then be seeing essentially the coco output
wave shape and levels, without you having to adjust the software detection for biasing introduced by the input circuit.
(This topic reminds me of my first assembly program as a teenager in the 70s, to make tape storage for a MEK 6800 SBC.
I wanted to keep the hardware as minimal as possible and did pretty much the same thing, R divider to drive to the tape, simple comparator
to digitise the sig from tape, simple encoding scheme with different pulse widths for 0/1, and timing loops in software to produce and detect the pulse widths.)
More information about the cctech