>> Im currently programming a dial up adapter for the pic74 and >> wanted to verify the procedure for talking to a modem- >> >> 1) Set DTR and RTS lines to high >> 2) > Output through UART the char "+" (repeated 3 total times), then > delay a second or so {Some modems don't require this, but they SHOULD.} > This tells the modem to go into command mode, so ATDT to follow > isn't ignored as being DATA! The modem has a command mode (where it acts on AT commands) and a data mode (where it passes every octet to the far end). Hayes created an escape mechanism to switch from data mode back into command mode. They used 3 plus signs ("+++"). To prevent a long string of plus signs embedded in a normal data stream from inadvertantly switching the modem back into command mode, the original specification required that the line be quiescent (no characters) for a minimum of 1 second both before and after the escape sequence. Also, by default the escape character is a plus sign ("+") character. It can be reconfigured to any other character by changing an S register value (ATSn=m). If you're sharing the modem with anything else, you might want to reprogram the escape character to plus sign during initialization. >> Output through UART/RS232 port the ascii chars - "ATDTphonenumber" >> then "0x0d"(carriage return?) >> 3) Should receive from the modem the ascii chars - "CONNECTbaudrate" >> 4) Should then receive data from the dialled computer By definition, the modem must now be in data mode. >> 5) To disconnect - > Output through UART the char "+" (repeated 3 total times), then > delay a second or so, THEN, once you're again in command mode, Again, send no characters for 1 second or more, send 3 plus ("+") characters, and send no characters for 1 or more seconds. > Output "ATH" then "0x0d"(carriage return?) to the modem Yes, 0x0D is ASCII carriage return (with either odd parity or no parity). > 6) Should receive "OK" from the modem Given that parity can be configured every which way, I'd suggest you mask each character with 0x7F (i.e. strip parity bit) when looking for responses to commands you've send the modem. > 7) Reset DTR and RTS lines to low Some modems will hang up on DTR going low. Some modems won't. And some will or won't depending on configuration. Lee Jones