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.
$ svn co
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