CPCWiki forum

General Category => Amstrad CPC hardware => Topic started by: Joss on 20:50, 18 January 13

Title: Question about audio input for CPC 464 to load programs
Post by: Joss on 20:50, 18 January 13
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?

Title: Re: Question about audio input for CPC 464 to load programs
Post by: beaker on 22:12, 18 January 13
Like this?

'Audio in' mod for Amstrad CPC 464 (http://www.youtube.com/watch?v=yfq3lnMlTUs#ws)
Title: Re: Question about audio input for CPC 464 to load programs
Post by: Bryce on 22:15, 18 January 13
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.
Title: Re: Question about audio input for CPC 464 to load programs
Post by: ralferoo on 23:10, 18 January 13
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! (http://ralferoo.blogspot.co.uk/2013/01/sounds-and-tapes-and-clocks-oh-my.html)

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!
Title: Re: Question about audio input for CPC 464 to load programs
Post by: 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  :)
Title: Re: Question about audio input for CPC 464 to load programs
Post by: ralferoo on 11:01, 19 January 13
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 (https://github.com/ralferoo/cpcfpga/tree/public/spice)

Oh, and it appears that this is where I got some ideas from: http://www.zxdesign.info/cassette.shtml (http://www.zxdesign.info/cassette.shtml)
Title: Re: Question about audio input for CPC 464 to load programs
Post by: Bryce on 16:51, 19 January 13
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.
Title: Re: Question about audio input for CPC 464 to load programs
Post by: Joss on 18:08, 19 January 13
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.
Title: Re: Question about audio input for CPC 464 to load programs
Post by: Joss on 22:19, 20 January 13
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 ;-)

(http://farm9.staticflickr.com/8223/8398874679_36119c2325.jpg) (http://farm9.staticflickr.com/8223/8398874679_36119c2325.jpg)
signal_A (http://www.flickr.com/photos/86293740@N05/8398874679/) by JossLucas (http://www.flickr.com/people/86293740@N05/), on Flickr
At the oscilloscope looks very weird :-)

(http://farm9.staticflickr.com/8073/8398876155_ca8b453ddb.jpg) (http://farm9.staticflickr.com/8073/8398876155_ca8b453ddb.jpg)signal_A_oszi (http://www.flickr.com/photos/86293740@N05/8398876155/) by JossLucas (http://www.flickr.com/people/86293740@N05/), 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 :-):

(http://farm9.staticflickr.com/8231/8398875219_c696b7b672.jpg) (http://farm9.staticflickr.com/8231/8398875219_c696b7b672.jpg)Signal_B (http://www.flickr.com/photos/86293740@N05/8398875219/) by JossLucas (http://www.flickr.com/people/86293740@N05/), on Flickr
At the oscilloscope looks very well :-)

(http://farm9.staticflickr.com/8361/8399962390_82caabce6b.jpg) (http://farm9.staticflickr.com/8361/8399962390_82caabce6b.jpg)
Signal_B_oszi (http://www.flickr.com/photos/86293740@N05/8399962390/) by JossLucas (http://www.flickr.com/people/86293740@N05/), 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:

(http://farm9.staticflickr.com/8228/8399962000_36f058ab14.jpg) (http://farm9.staticflickr.com/8228/8399962000_36f058ab14.jpg)
Signal_B_oszi_2 (http://www.flickr.com/photos/86293740@N05/8399962000/) by JossLucas (http://www.flickr.com/people/86293740@N05/), 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.

Title: Re: Question about audio input for CPC 464 to load programs
Post by: db6128 on 23:42, 20 January 13
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.
Title: Re: Question about audio input for CPC 464 to load programs
Post by: Joss on 00:00, 24 January 13
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" (https://www.circuitlab.com/editor/)


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 .....
Title: Re: Question about audio input for CPC 464 to load programs
Post by: ralferoo on 10:36, 24 January 13
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.
Title: Re: Question about audio input for CPC 464 to load programs
Post by: 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, 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. 
Title: Re: Question about audio input for CPC 464 to load programs
Post by: ralferoo on 14:43, 24 January 13
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).
Title: Re: Question about audio input for CPC 464 to load programs
Post by: Joss on 18:32, 24 January 13
You are right. The tape circuit can be found in the technical manual. For the part we are speaking about:

(http://farm9.staticflickr.com/8084/8408908973_8751995731_c.jpg) (http://www.flickr.com/photos/86293740@N05/8408908973/)


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 (https://www.circuitlab.com/circuit/xcp8jt/otro-disparador-con-histeresis/)
just in case you can spanish, here is the post:
http://www.zonadepruebas.com/viewtopic.php?f=25&t=2736 (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.





Title: Re: Question about audio input for CPC 464 to load programs
Post by: Joss on 23:07, 26 January 13
I was having success with the circuit proposed by McLeod  :) :


(https://www.circuitlab.com/circuit/bcd4q4/screenshot/540x405/) (https://www.circuitlab.com/circuit/bcd4q4/ear_cpc464/)


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


max volume:

(http://farm9.staticflickr.com/8196/8417030157_bb5818e16c.jpg) (http://www.flickr.com/photos/86293740@N05/8417030157/)


min working volume:

(http://farm9.staticflickr.com/8368/8417029991_720d26955a.jpg) (http://www.flickr.com/photos/86293740@N05/8417029991/)


signal not strong enough for the circuit:

(http://farm9.staticflickr.com/8358/8417030315_3ab8593da0.jpg) (http://www.flickr.com/photos/86293740@N05/8417030315/)




A couple of videos with the working circuit:
Carga Exploding fist sin casette en un Amstrad CPC 464 - parte 1 (http://www.youtube.com/watch?v=83zLxDjAP-w#)
Carga Exploding fist sin casette en un Amstrad CPC 464 - parte 2 (http://www.youtube.com/watch?v=esT48aOM4wc#)


:D
Title: Re: Question about audio input for CPC 464 to load programs
Post by: lynwen on 19:09, 22 February 13
that youtube video on the second post is one I saw weeks ago is that a user on here? really sexy irish man
Title: Re: Question about audio input for CPC 464 to load programs
Post by: Bryce on 11:07, 23 February 13
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.
Title: Re: Question about audio input for CPC 464 to load programs
Post by: kikendo on 10:14, 19 June 14
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?
Title: Re: Question about audio input for CPC 464 to load programs
Post by: pelrun on 11:35, 19 June 14
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.
Title: Re: Question about audio input for CPC 464 to load programs
Post by: pacomix on 12:48, 20 August 17
Quote from: Joss on 23:07, 26 January 13
I was having success with the circuit proposed by McLeod  :) :


(https://www.circuitlab.com/circuit/bcd4q4/screenshot/540x405/) (https://www.circuitlab.com/circuit/bcd4q4/ear_cpc464/)


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


max volume:

(http://farm9.staticflickr.com/8196/8417030157_bb5818e16c.jpg) (http://www.flickr.com/photos/86293740@N05/8417030157/)


min working volume:

(http://farm9.staticflickr.com/8368/8417029991_720d26955a.jpg) (http://www.flickr.com/photos/86293740@N05/8417029991/)


signal not strong enough for the circuit:

(http://farm9.staticflickr.com/8358/8417030315_3ab8593da0.jpg) (http://www.flickr.com/photos/86293740@N05/8417030315/)




A couple of videos with the working circuit:
Carga Exploding fist sin casette en un Amstrad CPC 464 - parte 1 (http://www.youtube.com/watch?v=83zLxDjAP-w#)
Carga Exploding fist sin casette en un Amstrad CPC 464 - parte 2 (http://www.youtube.com/watch?v=esT48aOM4wc#)


: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
Title: Re: Question about audio input for CPC 464 to load programs
Post by: pacomix on 14:23, 20 August 17
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
Title: Re: Question about audio input for CPC 464 to load programs
Post by: pacomix on 14:34, 20 August 17
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
Title: Re: Question about audio input for CPC 464 to load programs
Post by: Joss on 18:22, 20 August 17
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 .....
Title: Re: Question about audio input for CPC 464 to load programs
Post by: pacomix on 09:30, 21 August 17
Thank you very much!!! I'll try today again!


Enviado desde mi iPhone utilizando Tapatalk
Title: Re: Question about audio input for CPC 464 to load programs
Post by: pacomix on 16:21, 21 August 17
Definitely the input signal is lost when going through the first inverter (I'm checking it by using a small speaker) using the 74LS14.
I've tried using the amplifier shown here http://www.kernelcrash.com/blog/frankenstrad/2017/01/18/

but even I get output the cpc doesn't react.

I'm starting to think that this CPC is defective.


Enviado desde mi iPhone utilizando Tapatalk
Title: Re: Question about audio input for CPC 464 to load programs
Post by: Bryce on 08:24, 22 August 17
Are you trying to do all this without an Oscilloscope? That could be difficult.

Bryce.
Title: Re: Question about audio input for CPC 464 to load programs
Post by: pacomix on 09:42, 22 August 17
Yep. Unfortunately I don't own an oscilloscope since I barely have to mount this kind of circuitry. Having read BatJoss 🦇 post I assumed it was working perfectly.
Maybe if I start again studying electronics then will acquire one of those...

I think this circuit is interesting enough to be built professionally in a small batch.

I will try today to find another of my cassette faulty cpc's in order to try the circuit again. It is also strange I don't get sound from the sound output cable of the CP001 connector although I get it from the speaker connector.


Enviado desde mi iPhone utilizando Tapatalk
Title: Re: Question about audio input for CPC 464 to load programs
Post by: Bryce on 10:08, 22 August 17
The CPC speaker has an amplifier stage right before it. There will be sound at the CP001 connector if it's coming out the CPC speaker, but it probably isn't enough to drive a bare speaker at that point.

Bryce.
Title: Re: Question about audio input for CPC 464 to load programs
Post by: pacomix on 10:19, 22 August 17
Thanks for the tip! I'll connect it to an amp small circuit I've built in the same protoboard next to mcleod_ideafix circuit and check it then.


Enviado desde mi iPhone utilizando Tapatalk
Powered by SMFPacks Menu Editor Mod