i'm trying to communicate with modem using uart chip.
please give me the code,link or anything else which might be useful to write modem driver.
modem driver needed
RE:modem driver needed
If it's a real hardware modem that's connected to your system through a serial connection w/ uart it's pretty easy. You just make a serial connection and send commands over. A modem command is just something like the letters ATI0 or ATDT to dial.A search on google for MODEM AT COMMANDS turns up lots of listings.
-Chase
-Chase
RE:modem driver needed
Basically, you just treat a modem like a serial port only you use AT commands like Chase said. The AT commands are sent to the modem like you were going to send them through the serial port. The modem catches all of the commands that start with "AT".
Here are some common AT commands:
ATDT [number] - Dials a phone number
ATZ - Reset the modem to its factory settings
ATH0 - Hang Up
ATH1 - Answer or "pick up" phone
Make sure to use "ATH1" before dialing a number and hang hang up with "ATH0" when you're done.
Once you connect to another modem your modem sends you "CONNECT" usually followed by a baud rate or something else. Once you connect you are in online mode. Once in online mode all data sent to the modem that does not begin with "AT" will be treated as data to send to the other end of the connection.
I hope that this helps!
~ TripleFault !)
Here are some common AT commands:
ATDT [number] - Dials a phone number
ATZ - Reset the modem to its factory settings
ATH0 - Hang Up
ATH1 - Answer or "pick up" phone
Make sure to use "ATH1" before dialing a number and hang hang up with "ATH0" when you're done.
Once you connect to another modem your modem sends you "CONNECT" usually followed by a baud rate or something else. Once you connect you are in online mode. Once in online mode all data sent to the modem that does not begin with "AT" will be treated as data to send to the other end of the connection.
I hope that this helps!
~ TripleFault !)
RE:modem driver needed
thanks.Here is my first attempt to program the modem but in the following nothing is getting printed on screen,although the modem is set in loop back mode.
i ckecked the code for com1,com2,com3.The uart chip on my system is 16550A.
please tell me what's causing the problem.
#define PORT1 0x3e8
void main(void)
{
int c;
int ch;
outportb(PORT1 + 1 , 0);
/* PORT 1 - Communication Settings */
outportb(PORT1 + 3 , 0x80);
outportb(PORT1 + 0 , 0x03);
outportb(PORT1 + 1 , 0x00);
outportb(PORT1 + 3 , 0x03);
outportb(PORT1 + 2 , 0xC7);
outportb(PORT1 + 4 , 0x0B);
printf("\nSample Comm's Program. Press ESC to quit \n");
do {
c = inportb(PORT1 + 5);/* Check to see if char has been */
/* received.*/
if (c & 1){
ch = inportb(PORT1); /* If so, then get Char */
printf("%c",ch); /* Print Char to Screen*/
}
if (kbhit()){
ch = getch(); /* If key pressed, get Char */
outportb(PORT1, ch); /* Send Char to Serial Port */
}
}
while (ch !=27); /* Quit when ESC (ASC 27) is pressed */
}
I checked the properties of modem in window 98 and it showed that my modem is connected on com3.
i ckecked the code for com1,com2,com3.The uart chip on my system is 16550A.
please tell me what's causing the problem.
#define PORT1 0x3e8
void main(void)
{
int c;
int ch;
outportb(PORT1 + 1 , 0);
/* PORT 1 - Communication Settings */
outportb(PORT1 + 3 , 0x80);
outportb(PORT1 + 0 , 0x03);
outportb(PORT1 + 1 , 0x00);
outportb(PORT1 + 3 , 0x03);
outportb(PORT1 + 2 , 0xC7);
outportb(PORT1 + 4 , 0x0B);
printf("\nSample Comm's Program. Press ESC to quit \n");
do {
c = inportb(PORT1 + 5);/* Check to see if char has been */
/* received.*/
if (c & 1){
ch = inportb(PORT1); /* If so, then get Char */
printf("%c",ch); /* Print Char to Screen*/
}
if (kbhit()){
ch = getch(); /* If key pressed, get Char */
outportb(PORT1, ch); /* Send Char to Serial Port */
}
}
while (ch !=27); /* Quit when ESC (ASC 27) is pressed */
}
I checked the properties of modem in window 98 and it showed that my modem is connected on com3.
RE:modem driver needed
do you guys know how to detect the number of serial comm ports on a PC? Would you just 'ping' the io ports they respond to to see if they are active?
BTW, wow looks like it is pretty simple to write a modem driver. Is it just as generic with PCI? Probably a little more complex but similar i'd guess. This should be all one wouldneed to connect to an ISP over 56K via ppp right?
good job
mr. xsism
BTW, wow looks like it is pretty simple to write a modem driver. Is it just as generic with PCI? Probably a little more complex but similar i'd guess. This should be all one wouldneed to connect to an ISP over 56K via ppp right?
good job
mr. xsism
RE:modem driver needed
The safest way is probably the best way, the BIOS data area does return the info, but I'm not sure how reliable it is
PCI modems do exist that emulate a serial port in which case the process is essentially the same, but be aware that there are a lot of HSP (Host Side Processing) or WinModems which rely on the host to provide DSP services - these are MUCH more complex, and indeed I think linux on recently got these to work - don't expect to get these working in your own OS any time soon.
The protocol discussed so far is just the modem protocol (Hayes AT), this will allow one modem to connect to another one. To connect to an ISP you need either SLIP (Serial Line Interface Protocol) or PPP (Point-to-Point Protocol). PPP is more common these day, PPP is a whole other protocol and again more complex than so far discussed. PPP is defined in RFC1661, and more info can also be found here http://www.samba.org/ppp/index.html
PCI modems do exist that emulate a serial port in which case the process is essentially the same, but be aware that there are a lot of HSP (Host Side Processing) or WinModems which rely on the host to provide DSP services - these are MUCH more complex, and indeed I think linux on recently got these to work - don't expect to get these working in your own OS any time soon.
The protocol discussed so far is just the modem protocol (Hayes AT), this will allow one modem to connect to another one. To connect to an ISP you need either SLIP (Serial Line Interface Protocol) or PPP (Point-to-Point Protocol). PPP is more common these day, PPP is a whole other protocol and again more complex than so far discussed. PPP is defined in RFC1661, and more info can also be found here http://www.samba.org/ppp/index.html