ATTiny85 as a software modem

I've found certain PC applications that are able to detect and generate the audio squelches that dial-up modems make to interface to hardware over a phone line and it occurred to me... we already know the PLL function of the Tiny allows some pretty decent sound reproduction. We also know that audio alone can be used to communicate with a fax machine or computer or whatever, over a phone line, so it follows (at least in my limited understanding) that the Tiny should be able to act like a dial-up modem all by itself with no help from ICs or shields, so long as it can interface with the phone line correctly - and I have already figured that part out. So I'm curious if anyone has developed a library yet, that translates modem commands into audio squelches, which can run on AVRs?

What sort of modem, each different baud rate used different ways of mapping the data signal to the audio signal.
Transmission is OK but reception might be a lot more tricky.

The other vital thing is that the free running oscillator clock is unlikely to be accurate enough.

The ADC on the ATtiny85 is miserable. I had to give up using it and move a project which involved the demodulation of 1200 baud (Bell 212A or V.22) telephone caller ID data to an ATTiny84 instead. You'd also need an external DAC if you want to create a modulated signal.

Would it still be possible at very low baud rates? 1200 baud is probably a lot more than I think I would need.

Mike: Suppose I wanted to send a fax at the lowest supported baud rate. I don't know much about the technological or programmatical differences but I'm just looking for something that will support the most basic communication (for example, sending a string of characters to a remote computer's terminal window or sending a fax that prints a sentence).

Haven't been able to find any audio mapping thus far but as long as I have that, i can probably write my own library to carry it out.

I should also add that beyond the basic handshaking that's needed to sustain a connection, I don't really want to receive anything. All the receiving is to be done by the hardware that is properly designed for it (real modems and fax machines, etc.)

If you're just interested in audio signalling there's this on the transmit side: Arduino Playground - DTMF

A while back I played with HC-SR04 ultrasonic range finders to do point to point communications and had rudimentary FSK and PSK code working at very short ranges just using square waves driving the transducer. Problems at range were likely due to echos or the resonant properties of the transducer. A PPM scheme worked at a couple meters, but throughput was limited to maybe 100 baud because of echo persistence.

Suppose I wanted to send a fax at the lowest supported baud rate.

Well even if you have the modem part working a fax takes a lot of memory to hold the mage so that won't happen on an AT85.

I should also add that beyond the basic handshaking that's needed to sustain a connection, I don't really want to receive anything.

But that handshaking is receiving something so your system would have to have the receive capabilities.

sending a string of characters to a remote computer's terminal window

That is a lot simpler but you will need something at the computer end to act as a demodulator. Look at something like a radio ham's RTTY system, that is about as simple as it comes. RTTY from it:-

The transmitting part of the modem converts the digital signal transmitted by the teleprinter or tape reader to one or the other of a pair of audio frequency tones, traditionally 2295/2125 Hz (US) or 2125/1955 Hz (Europe). One of the tones corresponds to the mark condition and the other to the space condition. These audio tones, then, modulate an SSB transmitter to produce the final audio-frequency shift keying (AFSK) radio frequency signal.

Grumpy_Mike:
Well even if you have the modem part working a fax takes a lot of memory to hold the mage so that won't happen on an AT85.
But that handshaking is receiving something so your system would have to have the receive capabilities.
That is a lot simpler but you will need something at the computer end to act as a demodulator. Look at something like a radio ham's RTTY system, that is about as simple as it comes. RTTY from it:-

  • I hadn't thought about the memory requirements on the ATTiny85 being a bottleneck for fax. Then again, I haven't researched the tech yet so if the data is too large then I guess that idea's out

  • I understand the handshaking requires full duplex but I was just saying that the receiving part should be minimal. If receiving is impossible on the avr's hardware then it's indeed a problem but if it's just not very good, at least it doesn't have to happen for long...

  • Aren't there programs like Bitware that will use the modem to pick up the phone, receive faxes, receive data, etc.? I assumed that as long as a modem exists, software can be used to make it pick up the phone and follow the AT commands it receives. I've got plenty of modems and computers to run them so this project is more useful if we assume that my home is always going to be the client and some remote location would be the host (via AVR + phone line).

I understand the handshaking requires full duplex

No you can do it with half duplex.

Aren't there programs like Bitware that will use the modem to pick up the phone, receive faxes, receive data, etc.?

Yes but as I understand it, it uses the sound card to do an input and the much more powerful processor on the Windows machine.

was just saying that the receiving part should be minimal.

But it is irrelevant how much it is used, it is the functionality you need.

It is simple enough to use minimum hardware to convert the tones into TTL logic levels and then receiving should just be the standard software serial stuff. Going to a Uno with it's crystal clock should make reception a lot more stable.

software can be used to make it pick up the phone and follow the AT commands it receives.

Possibly but I have had little experance of that sort of thing because it is illegal in the UK. Even a home built acoustic coupled modem is illegal in the UK. Everything attached, in what ever way, to a phone line needs to be "type approved" which means expensive testing outside the range of an individual.