$10 ATA Part 2

This project is coming together – I am starting to think it really is possible to home-assemble a basic ATA for around $10! Since the first $10 ATA post we have managed to get the following building blocks prototyped:

  • -48VDC DC-DC converter. This is pretty neat: 7-12V in, -48V out. The AVR and a simple control loop generate PWM pulses to drive the switcher and provide voltage regulation.
  • Loop current based on and off hook detection. One of the AVR A/D inputs measures loop current and can sense when the phone is off hook.
  • tx and rx audio sampling and playback.

To test the tx/rx audio I rigged up a system using a Host PC. In playback mode, the PC reads an audio file and sends samples down a SPI link to the AVR. The AVR then writes the samples to the PWM port at a sampling rate of 32 kHz. I created a bit-bashed SPI port on the PC using the LPT port pins. This approach allowed me to put the minimum amount of code on the AVR. The code for changing sample rates, ulaw conversion etc was on the Host PC where it was easy to debug. It really is a pleasant surprise that the simple, built-in A/D and D/A hardware is good enough for telephone quality audio.

Here is a sample of the AVR A/D audio that I recorded using this system. Below is a plot of the audio signal. Note that it is 8 bit unsigned – the “DC” line is at about 127, and it ranges between 0 and 255.

Here is the latest schematic, and I have set up a $10 ATA SourceForge project for the software and hardware files. You can check out the $10 ATA files using SVN (type this all on one line):

$ svn co
https://lowcostata.svn.sourceforge.net/svnroot/lowcostata/trunk lowcostata

I have been working with an Atmel ATmega16 development system, the avr-gcc toolchain, and avrdude for programming. Below is a picture of my $10 ATA prototype. The DC-DC converter is mounted on a small PCB I scrounged from my other FXS port work. The LEDs are used to indicate on/off hook and the various states of the software.

I am starting to get my head around using the AVR. It’s actually a pleasant change after the gazillion-file, multiple level Makefile world of the Embedded Asterisk project work I usually do.

There is still quite a bit of work to do to get to that exciting “first phone call” stage:

  • Implement a ring generator, perhaps by sweeping the DC-DC converter set-point using a 20Hz triangular signal. This means the hook detector will need a little more work to deal with going off hook with a large ring signal superimposed on the -48V.
  • Implement some 8 kHz mulaw to 16/32kHz unsigned code on the AVR. I have prototyped this code on a PC but some assembler will probably be required to make the AVR run fast enough.
  • Write a (probably Zaptel) Asterisk channel driver for the $10 ATA. Make sure this can run on low-end platforms like a WRT54G, i.e. use fixed point code rather than float.
  • Experiment with Ethernet/USB/RS232 interfaces to the host.
  • Work out a way to easily move the design between different microcontroller families like the PIC/AVR.

While working on this project, it occurred to me that it might be possible to use the same algorithms to develop a low cost ($100) high density (64 port) FXS channel bank using an FPGA. You see the algorithms are very simple and (with the possible exception of the A/D) could easily be implemented in an FPGA. For example the PWM driving the DC-DC converter and tx audio D/A is easy to implement in a FPGA, being purely digital. Only a small amount of discretes per channel would be required – most of the “smarts” would be in the FPGA.

Another idea: if we use a microcontroller with a USB port, we can then use a OLPC for the host machine. This will allow a OLPC to be a low cost PBX with multiple FXS ports.


$10 ATA Part 1
Low Cost ATA Google Group
$10 ATA schematic
loan advance online payday moneyadvance payday software loancredit loans bad mortgage adverseloans faqs 401kisland 5 acre loans7 payday 20,10 loan company8 payday loan discount 12loan lender credit auto a bad Mapamerica credit federal union firstonline nursing degree accreditedadvantage credit federalunited credit union federal 1stcredit us acerbad mortgage 2nd creditaccept software credit card 20online accredited education Maptowers tiffany moviesmovies boobymovies adult free animehot teen movies girlauditions for movie teenspooping moviesmovie porn trish stratusbooty big movies Mapmovie playboymovie ivy the poisonmovies fuck tittymovies teen girlmovie black milffree daily sex moviestaboo incest moviesintention movie cruel Mapbig pornstar breastbreasted porn redheads bigbig porn brother cbsbig brother porn housebig porn btrastporn big butbutt sexy porn bigbutt big pornstars Maphole asssex oceangay bondageamateur wivesboys nudegalleries 89hairstyles teenanal penetration Map

14 thoughts on “$10 ATA Part 2”

  1. Making FPGA for high density FXS is a very good idea.

    I think currently the cost of ATA / FXS is more of a limitation rather than the host / computer . If cost of FXS can be brought under control than the product can beat all other proprietory PBX .

  2. Hi David,

    In your schematic, what is J1 for? It appears you have isolated whatever is connected to J1 from the AVR using the several 74HC07 hex buffers.

    BTW, couldn’t checkout files from the svn.

  3. Hi,

    J1 is the SPI connector used (1) to program the AVR from the host and (ii) for communications between the AVR to the host, which is currently using an SPI protocol (see Google group posts for more info).

    I can’t check out from sourceforge SVN either, lets try again later, it might be a temporary thing. SVN browse appears to be working.

    – David

  4. David,

    I was thinking about this project, specifically with ref to getting it to work for the TTC. I was wondering if you could piggy back on the hacked routers by software hijacking their PHY and having it send special fames that your ATA can handle, instead of trying to physically hack into onboard usb or serial lines.

    Would your current audio code fit on an attiny? allowing for parallel processing of the audio signals for multiple hard phones, and perhaps a more RAMmy chip for router communication?

  5. I guess it’s possible to receive ethernet frames if the format is known and if there is enough memory on the AVR.

    Now sure if the code will fit into an attiny, but pls feel free to try.

    – David

  6. Hi David,

    I just ran into your blog, however I don’t see any recent comments. Is this project of yours still alive? If yes, might this http://www.embedded-projects.net/index.php?page_id=165 be of any help? It seems that it already has the USB functionality ready using National Semiconductor’s USBN9604 and an ATmega32L where one could do most of the work of interfacing between the host and the Silicon Labs 3210. The cost isn’t terrible, so, what do you think?

  7. The project is hibernating at present. For the USB option I am thinking a PIC with build in USB might be a more elegant approach.

  8. Hi David,

    Why not you are waking-up such wonderful project from hibernation??

    Do you think there is a possibility of using uChips ENC28J60 as an working Ethernet interface instead of using USB? If then this solution can easily replace those expensive ATA/gateways and can directly be used from the same LAN where our Asterisk server will be located!!

    any comment ?

  9. Hi David,

    Please, lets wake this project up from hibernation.. anyways what you think about adding an ENC28J60 from microchip for an Ethernet interface instead of using USB with host? both the Atmega and ENC have SPI!! do you think the ATmega can handle the overall DSP and data traffic in that case ?

    any idea ?

  10. Hi David/all,

    Without any disregard to the Ethernet ATA idea (which seems more promising and does not need a PC to run on – however, it needs external power, whereas the idea with the USB ATA is that it will draw all the power it needs from the PC and it will be portable), I have done some extensive homework on a PIC-based USB design. The idea is to use the 3210/3201 chipset along with a PIC 18F2550 as the USB driver. The same idea can be used for an Ethernet ATA as well. I don’t know however if the cost of the 3210 and the circuitry that it requires around it will be prohibitive for the 10$ target of the project. Anyway, I am in the process of designing (and, if all goes well, building) a prototype board using these components. Even if that fails the 10$ target, it could serve just as another open design, and that wouldn harm to anyone. David, if you think that you and/or other people would be interested in the details, I ‘d be happy to share them, either on your blog, or in private.

  11. Hi Angelos,

    Your design sounds interesting. In small volumes the Si Labs 3210/3201 chipset would probably blow your $10 budget, but in higher volume it is possible. There is also the problem of soldering these chips, although some larger surface mount packages are possible – I have hand soldered a few prototypes.

    Tim (Mithro) actually did a University project on a very similar design, a USB PIC with FXS ports. Email me directly and I will put you in touch with him.

    Also email me a postal address and I will send your some FXS modules with the Si labs chipset already on board. Will help you get started.



  12. I should mention that we are ramping up on a new project that combines an ATA with a Wifi mesh router running Asterisk. This will be a low cost, high volume commercial product designed for developing world telephony. We call it the Mesh Potato! I will post on it in detail over the next few weeks.

Comments are closed.