6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Nov 22, 2024 5:04 pm

All times are UTC




Post new topic Reply to topic  [ 11 posts ] 
Author Message
PostPosted: Sat Feb 25, 2012 5:25 pm 
Offline

Joined: Fri Sep 19, 2008 8:06 pm
Posts: 17
Location: Bordeaux, France
Hello everyone,

I'm finding myself in a situation which would require me to build a telephone multiplexer (albeit a simple one!) for a school project. As of right now, I'm thinking of having 4 (phone) lines to multiplex (2 seems too little, and 8 too much).

This originally being a school project, It doesn't need a lot of bells and whistles, but I thought that the best idea would be to use a 65C816 with a RAM/ROM setup, and then leave some room to grow, in case this project is resumed sometime after school.

In terms of setup, I'll be having 2 "boxes", which will be identical hardware-wise. Courtesy of my "excellent" Paint skills (yes, those triangles are amp ops):

Image

It would basically be an op-amp driving the phone lines with data from the DAC to create the voice from the far away user, and the using that same data to cancel out the far away user's voice in order to sent the local user's voice to the far away user's telephone (if you see any simpler way, please tell me, I'm dreading having to configure those op amps properly to avoid echoes...). If anything seems unclear, please ask (I tend not to explain things very well).

I'm going to be using PCM for the voice modulation, which means nothing more to me than sampling/restoring audio channels 8000 times per second with an 8 bit resolution applied to them.

As far as analog/digital audio is concerned, I am still hesitant adding the DAC/ADCs directly to the "system bus" or to use 65C22 VIAs (so as to be able to cycle through all the DAC/ADCs in 125 microseconds).
Maybe privilege "multiplexed/latched" DACs/ADCs (several selectable inputs) over having one individual DAC/ADC pair per line?

As for the actual "Multiplex line", I was thinking of using a combination of frequency and time division multiplexing: select different frequencies for the different "boxes", and use a sending speed at 125/x microseconds, where x is the number of telephones connected to the line, and using some sort of simple AM modulation to transmit the actual signals, maybe with some simplistic error checking, after all, I'm not making industry-grade commercial products.

Any feedback (and corrections, as there probably are mistakes) would be appreciated.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Feb 25, 2012 8:00 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8543
Location: Southern California
If I'm not mistaken, echo cancellation has to do with cancelling the signal of your own voice from the other end so it doesn't drive you nuts as you try to talk. That takes a lot more intelligence. For your own end though, if we're talking about POTS lines (plain ol' telephone system), if you terminate with 600 ohms (the characteristic impedance of the phone lines) and do your circuit right, you will not reflect any signal, ie, will not send back an echo.

I did some experimenting with this stuff 15 years ago when it looked like we were going to make some POTS-interfaceable equipment, but the company it was for went belly-up before we got it done.

If it's for so few lines, the cheap-and-dirty way to do the switching would be with small relays. They will take very little room on the board compared to the rest of the circuitry. If you only have to have one line active at a time, then you can have a 600-ohm wet transformer leading into your analog circuit.

I've mostly been using the DAC0808 D/A converter. It does not need a clock. It's just a real-time conversion of the 8 data input bits, and puts out a current that gets turned to voltage by an op amp. You can't just put it on the bus because it doesn't have any select lines or latches, but you could put it on a 6522 port and just write to the port, or have a separate 74xxxx latch on the bus that latches the data when when the address-decoding circuitry says to. Writing to the D/A on my workbench computer is just STA $5001. I'm not looking at the data sheet, but I seem to remember that settling time is measured in nanoseconds, ie, well under a microsecond. I've written to it over 100,000 times per second (interrupt-driven from a timer) and there were no artifacts other than the software jitter. If your really wanted that kind of speed, you'll have to have a better op amp than just a run-of-the-mill LM324 or something like that, but that kind of speed is not needed for you particular project. I used a much faster (and more expensive) op amp for my raster graphics on analog oscilloscope from the same D/A's, shown at viewtopic.php?p=15348#p15348 .

For A/D, I've mostly been using the MAX153 which is basically a faster version of the ADC0820 which I started with. These are half-flash converters that also need no clocking. You just select, give enough time for the conversion, and read. They're more than fast enough for what you want, but not quite fast enough to just put one on the bus and read it like a memory location unless you run your 65xx clock speed at under a MHz. I put them on a VIA port, use a separate bit to select the A/D, select, and after a NOP or two, read the port, then deselect again. Reading the A/D requires five machine-language instructions (including a NOP for timing). You don't have to start a conversion and then come back later and see if it's done.

I've used the 6522's SR for a 9-level D/A for DTMF also, meaning you can generate that with the hardware you already have, without adding another D/A converter.

These are covered in my "Tip of the Day" column that starts at viewtopic.php?t=342 . The A/D and D/A ones are at the top of page 2.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Feb 26, 2012 9:23 am 
Offline

Joined: Fri Sep 19, 2008 8:06 pm
Posts: 17
Location: Bordeaux, France
As much as I'd love to use relays to hear some clicking noises, I'm afraid I need to consider using all 4 lines at the same time. And unless I'm mistaken, I'm pretty sure relays clicking on and off at 8000 times per second, unless in a perfect world, die rather quickly and create terrible noise on the line. Unless I completely misunderstood what the relays are supposed to be used for (to be used for line termination instead of a wet transformer?)

Now its just a matter of deciding how many VIAs to get (2 ports per VIA <=> 1 VIA per line? I'm pretty sure that since VIAs have 2 select pins, this would be easily doable with a single quad-AND gate). Using this method would require more hardware, but make software easier.

I completely forgot about matching termination impedance! I'm still trying to figure out whether or not lines can share transformers or not if they are active. I'm going to guess a "no" because of crosstalk between users. As for the design of the "wet" transformer, I found this rather interesting document on the internet with some schematics (although I'm afraid it might be a bit too complex for my purposes):

http://www.randolph-telecom.com/articles/AN-5,%20Transformer-based%20phone%20line%20interfaces%20_DAA,%20FXO_.pdf

I think I better understand the concept of inductance and reflections on phone lines now, but I still have a lot to learn.

As for the the D/A, to get a voltage, all I need to do is hook a resistor onto the output of the DAC and the use an appropriately configured amp-op.

And thanks for your tips of the day! They actually are really handy. I actually compiled them onto a document and printed them out to put on the board in my room.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Feb 26, 2012 9:55 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8543
Location: Southern California
I may be misunderstanding what you want to do; but the idea with the relays is that any given relay stays engaged for the duration of the call. Echo-cancelling and any DSP for it is not necessary for keeping the other person from hearing themselves a fraction of a second later if the phone line is terminated in its characteristic impedance. It is only necessary to keep you from hearing your own voice when there's a mismatch somewhere else that you have no control over. If you want to have something like three-party calling with two POTS lines though, I'm sure you will need a separate analog front end for each line to prevent the crosstalk and mismatch situations.

I do want to add more diagrams and pictures to the Tips, and my motivation just experienced an increase now with my new website coming online (URL below). I just added about 130 related links there, and I think the Tip of the Day column was one of them.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Feb 26, 2012 10:27 am 
Offline

Joined: Fri Sep 19, 2008 8:06 pm
Posts: 17
Location: Bordeaux, France
Oh, I get it now. Relay "kind of equals" impedance termination with a wet transformer in my case because I have a relatively simple setup. I had understood using relays as in switching on and off to share the DAC/ADCs. In retrospect, I don't know why I thought that, as it is a very, very bad idea.

So I'd just have the relays and transformers hooked up on the phone lines, add a 600 Ohm impedance to avoid echoes, and then all I'd have to do it send the far away user's voice onto the line (where it will be echo-cancelled by the actual phone hooked up), and read in the local user's voice (where it will be cancelled out by the relay and impedance). I'm assuming now that I won't need to cancel out any sound when I sample as the line now takes care of it, as I understand it.

As for what I actually want to do, for more clarity (and background):

Have 2 boxes with 4 telephone jacks, and one (coaxial?) I/O for multiplexing. I would then hook up 4 telephones per box, hook up the boxes together, and when i pick up all the telephones, it would be as if the telephones where connected to each other.

It's a project meant to demonstrate how telco's work without having too many bells and whistles attached to it, so that I can change a couple of variables (eg, sampling rate, the use of the A/"mu"-laws, or any sort of compression...), and compare the qualities of the different calls using the ITU's E-model from their recommendations (specifically, G.107), and to compare my results and hardware to actual telco results and hardware if possible. In reality, I'm supposed to ask telco's for the information first, but I'm having a hard time getting any responses from them.

It's a very, very ambitious project, considering my experience, but I do have until the the very beginning of June to finalize it, where it will be subsequently presented as a 10 minute oral to specialists of the subject (in my case, multiplexing). It probably won't get that far, but I'll try my best to get there. I am very motivated in this project now that I actually defined some goals for it (which wasn't the case some 4 months ago)

Then, over summer break, I'd like to expand upon it to see if i can get a 56K modem data call running over it, but that is completely optional :D . I hope that explains a bit more what I'm trying to do.

I guess I'll get started in the schematics then!

EDIT/NOTE: I've decided to track my own progress and use this page to organize my thoughts, if anyone is interested:
http://electronics.nicot-family.com/


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Feb 29, 2012 2:34 pm 
Offline

Joined: Wed Feb 29, 2012 11:26 am
Posts: 3
Location: The Midlands, UK
Hi Mr LG.
This looks to be quite an ambitious project, but also a lot of fun. Good luck with it.

My only advice, as someone who has marked such projects, is to break it down into subsections that can stand alone as smaller projects. Whilst I don’t know exactly what your project marking scheme may be, there will be marks allocated for several parts, which would be something like the following. 1/ introduction about the project, 2/initial research, 3/ proposed design, 4/ building the project and getting it working, 5/ analysis and evaluation of how well it does what you wanted, 6/what you would need to do to get it working as it should (nothing ever works perfectly), 7/ your write up, and presentation. Looking at your web site, I think you are probably aware of this, as it is a good start.

To maximise your marks, you need to make sure you have something for every bit so you must have at least something working and evaluated even if it is not the full project. You have been discussing the need for proper termination of the telephone lines here, so building a twisted pair opamp Rx circuit with 600 Ω termination would be a good self contained bit of the project. You could evaluate the effect of incorrect and correct values of terminating resistors by sending pulses down a long length of twisted pair and looking at the reflections on an oscilloscope. If you get no further, at least you have learnt something about the important topic of line termination and have a report on it to give in.

Also I would add that if I understand you correctly, I think you are using some incorrect terminology. You refer to “echoes” when I think you mean “reflections. The part of the signal that gets returned from incorrect terminating impedance is called a "reflection". It would not normally cause the effect of being a distinct echo that you could hear, being of the order of microseconds. More likely it would cause distortion of the signal. Echoes heard on telephone lines, on the other hand, are more likely to be caused by your voice being retransmitted back by the phone at the other end somehow, being of the order of tenths of a second. You have no simple control over these echoes.

Cheers


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Feb 29, 2012 4:11 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
Welcome to the group, TCSC47. And thanks for your thoughtfully-written post.

-- Jeff


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Feb 29, 2012 4:12 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8543
Location: Southern California
Quote:
Also I would add that if I understand you correctly, I think you are using some incorrect terminology. You refer to “echoes” when I think you mean “reflections." The part of the signal that gets returned from incorrect terminating impedance is called a "reflection". It would not normally cause the effect of being a distinct echo that you could hear, being of the order of microseconds. More likely it would cause distortion of the signal. Echoes heard on telephone lines, on the other hand, are more likely to be caused by your voice being retransmitted back by the phone at the other end somehow, being of the order of tenths of a second. You have no simple control over these echoes.

They're basically the same thing except that longer delay times can be introduced by digital buffering in the routing system between the two ends. I frequently talk to somone in one of our offices 1200 miles away; and although the signal's round trip should take under 20ms by fiber optics, I sometimes get an annoying echo that's delayed 20 times that long (about a third of a second).

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Feb 29, 2012 4:44 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8505
Location: Midwestern USA
GARTHWILSON wrote:
I frequently talk to somone in one of our offices 1200 miles away; and although the signal's round trip should take under 20ms by fiber optics, I sometimes get an annoying echo that's delayed 20 times that long (about a third of a second).

You need to tighten up that string that's stretched between the two tin cans. :lol:

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Mar 05, 2012 9:38 am 
Offline

Joined: Wed Feb 29, 2012 11:26 am
Posts: 3
Location: The Midlands, UK
Hi Garth
As you say, it is most certainly an echo to the person on the telephone and is often referred to it as such. However, as LG is going to hand in a write up for marks, he needs to know that the technical term is "reflections" with regard to transmission lines and how it occurs, or he may lose marks. Whilst I have seen the word echoes used in conjunction with transmission lines it is for specialised situations such as "forward echoes" etc., it would seem safer to me to use the term “reflections” all the same.
Cheers


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Mar 22, 2012 8:55 pm 
Offline

Joined: Fri Sep 19, 2008 8:06 pm
Posts: 17
Location: Bordeaux, France
Hello again everyone,

Sorry if this is a little late( I've been busy lately), but a very big thanks for your helpful advice concerning this project. Even though I haven't updated the website as regularly as I was planning to, I am getting bits and pieces of it done as I go along on pieces of paper and basically putting those in a box, so to speak.

Quote:
My only advice, as someone who has marked such projects, is to break it down into subsections that can stand alone as smaller projects.

Chopping up big projects into smaller ones is indeed a key solution for more complex projects, if not it is impossible to treat it as a whole.I'm hoping to be able to begin ordering parts for different segments of the project within the next too weeks, I'm practically done with phone line termination, handling phone line audio conversion and hooking up the digital parts, I just need to work on the multiplexer, mainly on frame synchronization and sending control data along with audio, and a couple of practical problems that present themselves, most notably the choice of amp ops and DAC/ADCs.

The MAX 153, for instance, seems to be well suited for the job, but is a tad bit expensive, unless I'm looking in the wrong places (it seems to be around 16 euros a piece for small orders, and since i am going to need 1 of them per multiplexer/line, it gets a bit expensive). I thought about sharing it between lines, but I think that it would create I'm not looking to overdo it, but I don't want to be on the edge of specifications when it comes to sampling and outputting audio, just to discover that i need to order a new batch of op amps...

As for assembling the thing, I'm planning on using wire wrapping and assembling everything in small modules to ease maintenance and repairs (as there will be errors with the first prototypes...). I just hope 4 MHz is OK for wire wrapping...

Thanks,

John


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 32 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: