CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Embedded Internet Kit: PC dials up to PIC

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Marky



Joined: 04 Jan 2004
Posts: 3

View user's profile Send private message

Embedded Internet Kit: PC dials up to PIC
PostPosted: Sun Jan 04, 2004 2:24 am     Reply with quote

Hallo all,

i have the embedded internet kit and some problems with it. I want to do the following:

There is a PC in one location and the Internet board in another location. The PC should dialup a connection over the phoneline (not to a provider) to the PIC board. The PIC should listening on the line and realizing the incoming call. The PIC should than unhook an answer with a data sequence. If the connection is made the PC sends data to the PIC and ends the connection. That's it.

I hope someone has a resolution of my problem.

Many many thanks.

Hopefully Rolling Eyes

Marky
rwyoung



Joined: 12 Nov 2003
Posts: 563
Location: Lawrence, KS USA

View user's profile Send private message Send e-mail

PostPosted: Sun Jan 04, 2004 11:28 am     Reply with quote

So you are saying that you want a PIC with a Modem attached to a POTS line (POTS = Plain Old Telephone System).

PC dials out (ATDT5551212 for example) and the PIC's Modem is configured to autoanswer and negotiate a connection.

Once the connection is negotiated the PIC is supposed to send back an acknowledgement. If the PC recognizes the ACK it is supposed to send a little data to the PIC and then the PIC modem is supposed to go back "on-hook"?

No Internet protocols involved here, just a modem-to-modem connection over phone lines?

If this is the case I would search the old postings for phases like MODEM and PHONE LINE. I have done this in the past but for a commercial application so I can't give specifics on how it was done. The biggest issue was the configuration strings for the PIC's modem. Other than that it was just an exercise in writing code for the PIC's UART and decoding data streams.

PIC Code Outline:
1) Initialize I/O, timers, UART etc for PIC
2) Send initialization string(s) to modem. Each string must be answered by the modem correctly before the next string is sent. We had a total of three strings. All the configuration codes could have been put into one string but by using 3 it was a little easier to debug since we could tell which groups of codes we had set wrong.
3) DUMP THE RECEIVE BUFFER OF THE PIC AND MODEM
4) Wait for the phone to ring! If this is all the PIC is doing then it could be a simple polled loop on KBHIT. But if you are asking the PIC to do other things, look into using the UART receive interrupt and a software receive buffer.
5) Decode incoming data from modem and PC
6) Respond appropriately
7) Back to #3
_________________
Rob Young
The Screw-Up Fairy may just visit you but he has crashed on my couch for the last month!
Marky



Joined: 04 Jan 2004
Posts: 3

View user's profile Send private message

PostPosted: Thu Jan 08, 2004 1:24 am     Reply with quote

Hallo Rob,

thank you very much for the fast answer. But I have a few questions about modem-to-modem connection. Hope you can help me. Rolling Eyes

The situation:
----------------
My friend is calling my PIC-Board with the Hyperterminal software. He has a analog modem.
My telephone rings and the PIC-Board-Modem autoanswers after 1 ring (AT-command "s0=1").

I'm monitoring the PIC with Hyperterminal. The PIC-Software on PIC-Board I wrote is configured to send each button (pressed in hyperterminal) from the PIC-modem to the POTS.
Now the problem:

If I press any key in hyperterminal the modem ends the connection and answers with "NO CARRIER".

Is this a problem of initializing the PIC-modem or the modem of my friend?
Or is it a HW-problem?

I hope you can help me. Embarassed


the hopefull Marky
Marky



Joined: 04 Jan 2004
Posts: 3

View user's profile Send private message

Problems
PostPosted: Thu Jan 08, 2004 5:48 am     Reply with quote

rwyoung wrote:
So you are saying that you want a PIC with a Modem attached to a POTS line (POTS = Plain Old Telephone System).

PC dials out (ATDT5551212 for example) and the PIC's Modem is configured to autoanswer and negotiate a connection.

Once the connection is negotiated the PIC is supposed to send back an acknowledgement. If the PC recognizes the ACK it is supposed to send a little data to the PIC and then the PIC modem is supposed to go back "on-hook"?

No Internet protocols involved here, just a modem-to-modem connection over phone lines?

If this is the case I would search the old postings for phases like MODEM and PHONE LINE. I have done this in the past but for a commercial application so I can't give specifics on how it was done. The biggest issue was the configuration strings for the PIC's modem. Other than that it was just an exercise in writing code for the PIC's UART and decoding data streams.

PIC Code Outline:
1) Initialize I/O, timers, UART etc for PIC
2) Send initialization string(s) to modem. Each string must be answered by the modem correctly before the next string is sent. We had a total of three strings. All the configuration codes could have been put into one string but by using 3 it was a little easier to debug since we could tell which groups of codes we had set wrong.
3) DUMP THE RECEIVE BUFFER OF THE PIC AND MODEM
4) Wait for the phone to ring! If this is all the PIC is doing then it could be a simple polled loop on KBHIT. But if you are asking the PIC to do other things, look into using the UART receive interrupt and a software receive buffer.
5) Decode incoming data from modem and PC
6) Respond appropriately
7) Back to #3


Hallo Rob,

thank you very much for the fast answer. But I have a few questions about modem-to-modem connection. Hope you can help me.

The situation:
----------------
My friend is calling my PIC-Board with the Hyperterminal software. He has a analog modem.
My telephone rings and the PIC-Board-Modem autoanswers after 1 ring (AT-command "s0=1").

I'm monitoring the PIC with Hyperterminal. The PIC-Software on PIC-Board I wrote is configured to send each button (pressed in hyperterminal) from the PIC-modem to the POTS.
Now the problem:

If I press any key in hyperterminal the modem ends the connection and answers with "NO CARRIER".

Is this a problem of initializing the PIC-modem or the modem of my friend?
Or is it a HW-problem?

I hope you can help me.


the hopefull Marky
rwyoung



Joined: 12 Nov 2003
Posts: 563
Location: Lawrence, KS USA

View user's profile Send private message Send e-mail

PostPosted: Thu Jan 08, 2004 8:49 am     Reply with quote

Marky,

I can't say from your description what is happening but I would attack the problem by simplifying your system. Test and verify small portions first then start putting them together into the larger configuration.

What I would try to do is simplify the set up first. Instead of using the modems between the two systems, do it all on your desk with a serial line between PC #1 and Hyperterm (that represents your friend's PC accross town). From PC #1 use a null modem cable to your PIC-board without its modem. You may need to build or hack in some MAX232 drivers. This eliminates the modem initialization issues at both ends. Then you would monitor your PIC-board through its second serial port (I'm not clear on your setup but you implied you could talk to your PIC-board via Hyperterm in PC #2).

Now you can comment out all the modem initialization code for your PIC-board and just test how it is passing characters back and forth. Once you are happy with that then you can start to test the modem stuff.

Other issues I've delt with in modems is the proper driving of the CTS/DTR lines. Some modems can survive just fine with a simple 3 wire (GND, TX, RX) connection and others must have some degree of hardware handshake.

In the last project I did with modems, the initialzation strings were pretty complicated and arrived at after lots of fiddling around.
_________________
Rob Young
The Screw-Up Fairy may just visit you but he has crashed on my couch for the last month!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group