News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_Joss

Question about audio input for CPC 464 to load programs

Started by Joss, 20:50, 18 January 13

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Joss

Could it be possible to use the pin in the connector CP001 of the Amstrad CPC 464 PCB as an audio input to load programs? I mean I want to connect an mp3 player output or PC line-out direct to it.
As I see in the circuit diagram of 464, the pin is connected direct to PPI port. In the circuit diagram of 664, it occurs to be the same and nothing is put in the way to adapt the signal. Am I right? Or can I burn something on it?


beaker


Bryce

Yeah it will work fine, you'll just need to experiment with the volume to find the right level. And make sure you have no funny equaliser settings, bass boost or anything turned on in the player that modifies the frequencies.

Bryce.

ralferoo

IIRC, the tape connector on the motherboard is TTL levels and there's an opamp in the tape deck to amplify the signal. The typical signal of a line-in is 1V peak-to-peak, centred on ground and so you're unlikely to get this to work just connecting it up directly.

If you don't want to use an op-amp, you could use a circuit similar to this: ralferoo's blog: Sounds and tapes and clocks, oh my!

You might want to change the resistor values - I worked these out for 3.3v level inputs (and still had to tweak them a bit) and they might need adjusting for TTL. Also, you can optimise out the parallel and series resistors - they were based on what I had lying around at the time!

Joss

@Bryce, Beaker: in my case I want to remove the cassette deck, so only pins in motherboard will be available. I have such a mod done in one 464 and I experience more problems with loading over this audio input as over a cassette adapter for MP3 players ?:-)


@ralferoo: that's the information I wanting to know. So the problem is the signal is going to be weak for the TTL-input .... funny because I thought I could have too much power out of the PC line-out or the mp3-player headphone signal  :D . Nice link and blog  :)

ralferoo

Actually, just so it's clear, this is what the circuit is doing:

R17 is used to try to keep the voltage at the GND if there's nothing connected (actually, I think this might not be desirable).

C2 is used as a biasing capacitor, so it removes the DC component from the signal. That is, you just get the waveform part, and the circuit is isolated from the GND reference voltage. In other words, the signal would be the same going from -0.5V to 0.5V as 1.5V to 2.5V.

(R18/R22) and (R19/R61) are used as a voltage divider to form the reference voltage that the waveform is centred on. In this case, it's 5700:8245, so the reference voltage at the centre junction is 8245/(5700+8245)=3.3v*8245/13945=1.95V.

The waveform will oscillate around that reference voltage and so for 1V peak-to-peak will be 1.45V-2.45V.

The transistor allows the load to be drawn from VCC rather than the tape input, but drops the voltage by about 0.6V depending on type, so the final voltage will be about 0.85V to 1.85V. The reference voltage needs to be tweaked so you get acceptable results based on the input thresholds of your chips. It'd need to be around 3.6V for TTL.

R21 is stop too much current going through the transistor from VCC to GND.

Hopefully, that's enough information to figure out the values you need. I actually used a spice model to play with different values, although it still needed to be tweaked afterwards. If it helps, my experiments are available here: cpcfpga/spice at public · ralferoo/cpcfpga · GitHub

Oh, and it appears that this is where I got some ideas from: http://www.zxdesign.info/cassette.shtml

Bryce

Quote from: Joss on 07:57, 19 January 13
@Bryce, Beaker: in my case I want to remove the cassette deck, so only pins in motherboard will be available. I have such a mod done in one 464 and I experience more problems with loading over this audio input as over a cassette adapter for MP3 players ?:-)


@ralferoo: that's the information I wanting to know. So the problem is the signal is going to be weak for the TTL-input .... funny because I thought I could have too much power out of the PC line-out or the mp3-player headphone signal  :D . Nice link and blog  :)

Ah, I thought you intended using the amplifier stages of the tape deck, connecting directly to the mainboard won't work as Ralf has just explained.

Bryce.

Joss

Quote from: Bryce on 16:51, 19 January 13
Ah, I thought you intended using the amplifier stages of the tape deck, connecting directly to the mainboard won't work as Ralf has just explained.
Right ... I wanted to know what do the amplifier stages of the tape deck .... I didn't know about them .... as I say, I want to take the tape deck off.

Joss

A have another question .... I was making some test and taking some pictures ... it could help just in case my english should not good enough ? :-X

I was taking everything I need from the 464 out of the case. To load programs I used a cassette adapter which works fine connected to the headphone output of a Macbook Pro. I was taking pictures with an oscilloscope to see which signal comes out of the laptop (Signal A) and which signal comes to the PPI in the (Signal B).
Signal A is marked with a red arrow. The dots help to follow the signal to the cassette adapter ;-)


signal_A by JossLucas, on Flickr
At the oscilloscope looks very weird :-)

signal_A_oszi by JossLucas, on Flickr
@ralferoo: it is 120mV peak to peak. As you said, very weak .....
I was measuring too at the connector CP001, I named it Signal B, where I will put the input in the future without the cassette deck ..... I was checking first that PinE@CP001 Connector (fourth from the botton) is straight connected to PIN25@8255 and PinB@CP001 Connector (second from the upper side) is connected direct with PIN21@8255 with a polymeter (it peeps :-):

Signal_B by JossLucas, on Flickr
At the oscilloscope looks very well :-)


Signal_B_oszi by JossLucas, on Flickr

It looks like 0-3,5V. @Ralferoo, perhaps with your proposed amplifier (the same values) will work. I could not test today because I didn't have more time ..... but I will try it this week.


But now the question:
I was measuring without signal, I mean without playing anything at the audio input, and the pin25@PPI or PinE@CP001 shows an signal of 3,5 V (logic one). Does it means I have to invert the signals? or without input it hast to be pulled up (I am not sure if I understand this concept). It is direct connected to the 8255 chip and I'm afraid it could be burned somehow ....
Signal looks like this:


Signal_B_oszi_2 by JossLucas, on Flickr
Thanks for watching ;-) and for the answers :-)


P.S.: I was playing the first pitch played by every program. It should be 1500 Hz.


db6128

That's a DC offset, and as you see from your picture of signal B, it persists when an input signal is present. I'm sure that's easy to solve in circuitry, assuming the other issues are surmountable.
Quote from: Devilmarkus on 13:04, 27 February 12
Quote from: ukmarkh on 11:38, 27 February 12[The owner of one of the few existing cartridges of Chase HQ 2] mentioned to me that unless someone could find a way to guarantee the code wouldn't be duplicated to anyone else, he wouldn't be interested.
Did he also say things like "My treasureeeeee" and is he a little grey guy?

Joss

I was thinking about it and trying your circuit ..... I have to refresh my electronic class I had a looooong time ago ..... I used an online simulator I found on the web:
CircuitLab - Editing "Unnamed Circuit"


I see the problem that the output signal can be very slow and perhaps doesn't work for every frequency (I played with different values and I'm not sure if all parameters in simulation are working fine). If I understand the signal well, only the frequency is important and not the amplitude ....


I think the simplest way could be use only an op-amp without feedback connection. Output should jump from 0V to saturation, in this case 5 V and over the needed TTL level. I am only concerned about the output connection that will go direct to the 8255 pin .....

ralferoo

Quote from: Joss on 00:00, 24 January 13
I see the problem that the output signal can be very slow and perhaps doesn't work for every frequency (I played with different values and I'm not sure if all parameters in simulation are working fine). If I understand the signal well, only the frequency is important and not the amplitude ....
The other option is to use smaller value resistors, although the current consumption will increase by doing so. A lot of this stuff is new to me too - I found previously some places where I was using 10k pull-up resistors in other places the signals were really glitchy, but with a 2k2 they were fine. I guess a lot of 8-bit era devices use 4k7 everywhere. But anyway, this design uses 10k and 47k all over the place. I might try to reduce the numbers to see if it improves response.

As an aside, my circuit seems to have behaving less reliably than before. I made the 47k in parallel with the 10k fix a while back and everything was well, but a few days ago something changed and the reference voltage seems too low now. It's probably a dry joint, but worth bearing in mind that an opamp solution might actually be easier to get working as you don't need to straddle the fine line between having a voltage that's almost on and almost off.

Bryce

A pure resistor solution will be generally quite unreliable, as it will vary due to many other things such as temperature, power supply fluctuations and current being pulled from other parts of the circuit. This means you'd be continuously fine tuning it to get it to work. An Op-Amp solution will give you a repeatable, reliable solution. Why not just build the CPC tape circuit on a small board? All the parts (or equivalents) are still easy to source.

Bryce. 

ralferoo

Quote from: Bryce on 10:44, 24 January 13
A pure resistor solution will be generally quite unreliable, as it will vary due to many other things such as temperature...
Good to know. I think I'll re-design this part of my FPGA as I do seem to have problems with it (or even have it on a break-out board as you suggest).

Joss

You are right. The tape circuit can be found in the technical manual. For the part we are speaking about:




But perhaps it can be done with less components. My first try is only to "play" programs. No record in sight :-/ I am discussing this topic in a spanish forum  and the user McLeod_Ideafix was having for his build of an spectrum ULA plus with a FPGA  a similar problem. He proposes a circuit with looks more simple as the original from the CPC:
CircuitLab - Otro disparador con histéresis
just in case you can spanish, here is the post:
http://www.zonadepruebas.com/viewtopic.php?f=25&t=2736


He propose a buffer with hysteresis. I think that's a Schmitt trigger and propose before the trigger an amplification+stabilization of the signal.






Joss

I was having success with the circuit proposed by McLeod  :) :





Oscilloscope to show input in blue and output in yellow of the circuit.


max volume:




min working volume:




signal not strong enough for the circuit:






A couple of videos with the working circuit:

Carga Exploding fist sin casette en un Amstrad CPC 464 - parte 1

Carga Exploding fist sin casette en un Amstrad CPC 464 - parte 2


:D

lynwen

that youtube video on the second post is one I saw weeks ago is that a user on here? really sexy irish man

Bryce

It's not me :) It's another CPC fan with an incredibly sexy Dublin accent :D Don't think he is a member here though. I think there's only two Irish members here and a psuedo Irish member (Beaker).

Bryce.

kikendo

I was wondering if this is possible to do on an Amstrad 6128.
Can I put an Audio input jack taking the signals from the TAPE port of the 6128?

pelrun

You don't need to do anything complicated on the 6128 - just connect your line-in directly to the appropriate pins on the tape port.

pacomix

Quote from: Joss on 23:07, 26 January 13
I was having success with the circuit proposed by McLeod  :) :





Oscilloscope to show input in blue and output in yellow of the circuit.


max volume:




min working volume:




signal not strong enough for the circuit:






A couple of videos with the working circuit:

Carga Exploding fist sin casette en un Amstrad CPC 464 - parte 1

Carga Exploding fist sin casette en un Amstrad CPC 464 - parte 2


:D
Hi Joss!!!

Could you show how exactly you wired the circuit in the protoboard? I'm trying to implement it but I get no sound output at all. I didn't have any 100ohm resistors available so I skipped R1 and the 74hct14 wasn't available at the electronic store so they assured me the 74ls14 is an equivalent so I took it.

I attach some pictures of mine. GND is the - line of the protoboard and 5V is on the + line. GREEN cable is the read pin, blue the WRITE pin, thin BROWN cable is GND, BROWN thick cable is 5V. I also have the speaker connected. When I save a program I can hear it through the speaker (it is connected straight from the WRITE pin of the CP001 connector). GREY cable states it is sound but I don't get sound from the cpc. I can get it from speaker's output though.

Forearm thanks!!!


Enviado desde mi iPhone utilizando Tapatalk

pacomix

Taking a look at my pictures I realized I missed the GND connection of the 74LS14.
After wiring it I still don't get output but at least I hear some noise when I connect/disconnect the jack from my iPhone.

Could my problem come from not using the 100ohm resistor or perhaps the output of my iPhone (6S+) is not powerful enough?

Doing the other mod (soldering straight to the cassette board) works perfectly though.


Enviado desde mi iPhone utilizando Tapatalk

pacomix

Taking a look at my pictures I realized I missed the GND connection of the 74LS14.
After wiring it I still don't get output but at least I hear some noise when I connect/disconnect the jack from my iPhone.

Could my problem come from not using the 100ohm resistor or perhaps the output of my iPhone (6S+) is not powerful enough?

Doing the other mod (soldering straight to the cassette board) works perfectly though.


Enviado desde mi iPhone utilizando Tapatalk

Joss

Quote from: pacomix on 12:48, 20 August 17
Hi Joss!!!

Could you show how exactly you wired the circuit in the protoboard?
[...]


Hola PacoMix!


I did it a long time ago, and I didn't have it in an "end-version", no idea, how it was in 2013. You can try to simulate the circuit of McLeod online without the 100 Ohm resistor. Perhaps helps to understand the circuit .....

pacomix

Thank you very much!!! I'll try today again!


Enviado desde mi iPhone utilizando Tapatalk

Powered by SMFPacks Menu Editor Mod