Interfaceing with modem whoes.

buntay

Senior Member
using:
Axe91 proto board
picaxe 20x2
boca 14.4 external serial modem

program:
Code:
setfreq m8
main:
high b.5          'pulls terminal ready line high (terminal is ready)
pause 3000        ' gives modem time to see terminal is ready signal was received 
serout b.6,t9600_8, ("ath1",cr)   ' take phone line off the hook
pause 3000                     ' waits for modem to take line off the hook
serout b.6,t9600_8,("ath0",cr) ' hang up phone line on hook
pause 3000        ' waits for modem to hang up line
low b.5           'pulls terminal ready line low (terminal is not ready)
pause 3000     ' waits for modem
goto main

Problem:
There is an OH (off hook) light on modem that should come on when it gets the "ath1" command and it doesn't

verified:
modem working on laptop using xp hyper terminal
can see the RD (receiving data) lighting up when picaxe sends the data
3.7v on the serial lines from picaxe


am I missing something? Anybody play with external serial modems. I would love any advise
 

g6ejd

Senior Member
Many modems use LF to terminate a line, but depends on settings, so if the modem is not set to convert CR = CR+LF then it's not getting a terminated command - that's my view of why it's not working as expected, just a add a line feed (LF = 10) to the end of your commands.
 

buntay

Senior Member
i did try it with

serout b.6,t9600_8, ("ath1",cr,lf)

and that did not work either. Can you tell me what (lf=10) means?
 

lbenson

Senior Member
"lf" is now a defined value in PICAXE BASIC. That value is 10, the ASCII value for linefeed. Before it was predefined, one could define it with "symbol lf=10".

Would your problem be that the Boca modem is looking for RS232 voltage levels, and the picaxe is putting out TTL levels?
 

premelec

Senior Member
Line Feed

ASCII codes for Carriage Return and Line Feed 13 & 10 - carried forth from the good old mechanical device days...
 

hippy

Ex-Staff (retired)
Also, why T9600 ? How are you connecting the modem ?

You may also need to wire up the modem handshaking lines.
 

buntay

Senior Member
Would your problem be that the Boca modem is looking for RS232 voltage levels, and the picaxe is putting out TTL levels?
have picaxe running through the onboard max232 converter chip

Also, why T9600 ? How are you connecting the modem ?

You may also need to wire up the modem handshaking lines.
have tried values of t9600,t4800,t2400 and none work also tried the equivalent "n" values but when use "n" values rd (recieving data) light does not light. connecting modem through the DB9 connector on the axe91 proto board. have verified the rx and tx lines

set up xp terminal with "no" hand shaking and still works fine only thing I dont know is how to do is write code for printer port serial.
time to do some googleing.
 

john2051

New Member
Hi Buntay,
Years ago whenI used to use external 56k modems, the main problem was cabling, depending whether it was DCE, or DTE. The next thing was baud rate and parity etc.
Also I think the modem has to be in command mode to accept at commands.
Have a look at the modems command list for your modem. Mine used CTRL C for command mode.
adtd <number> to dial number and enter data mode. Hope this helps.
Good luck.

Regards john
 

SD2100

New Member
I had an 08m connected to an external modem a while back, here's some code and connections that might help.

#Picaxe 08m
serout 2,T2400,("ATZ",13) 'Reset Modem
serin 1,T2400,("OK") 'Wait for modem response


Picaxe to external modem connections
------------------------------------

Picaxe pin 2 -> MAX232 pin 11
Picaxe pin 1 <- MAX232 pin 12

MAX232 pin 13 <- modem pin 3
MAX232 pin 14 -> modem pin 2

Modem DB25 - Connect pins 5(CTS) - 6(DSR) - 20(DTR) together

Modem pin 7 GND - connect to picaxe 0v
 

BeanieBots

Moderator
When using 'T' type baud rates, remember to initially set the serial I/O line high or the first character of your transmission will be corrupt.
 

buntay

Senior Member
hey all,

just wanted to say I have picaxe taking the line on and off the hook now (had the silly rx and tx lines reversed :eek:) I am planning on posting a complete document and posting it in the finished projects section of the forum when I am finished for other who would like to communicate with an external modem as this isnt very well documented on the forum.
 

MPep

Senior Member
Yep, the crossing of those two signals lines is very common, especially if you are connecting D9 to D25!!
Sometimes it is also hard to know which around they are, as some manufacturers dictate from the PC perspective, and others from the modem perspective.
ie TX could be Transmit from the PC, OR to the PC. Bloody confusing.

Well done it getting it to work. What is the final goal of this project? Just curious.
 

Paix

Senior Member
Indeed, the best advice I used to think was that when connecting disparate RS232 sources was to always check for the transmit pin with a telephone earphone and listen for the click that said it was transmit. The perspective of a narrator often became confused. If in doubt, check it out.

Glad that you got it sorted however. :) Another bit of kit to add to the toolbox. (earphone with croc clips)
 

buntay

Senior Member
Well done it getting it to work. What is the final goal of this project? Just curious.
picaxe will be monitoring and controlling different aspects of my house and need a way to talk to it when I am away. and since I always have a laptop (not necessarily an internet connection) I will know any time I have a phone line available.
 
Top