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

Communication problem RS232

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



Joined: 24 Sep 2003
Posts: 14

View user's profile Send private message

Communication problem RS232
PostPosted: Sun Jan 25, 2004 8:17 am     Reply with quote

When I connect the PIC(16F877) via RS232 to my PC and using HyperTerninal everting works fine.
When I connect the modem to the PC and also using HyperTerminal all At-Commands work fine.
When I connect the PIC to the modem notting works and the Pic seams to lock up.
What do I have wrong here?

Thanks
Joris H
Charlie U



Joined: 09 Sep 2003
Posts: 183
Location: Somewhere under water in the Great Lakes

View user's profile Send private message

RS232 configuration
PostPosted: Sun Jan 25, 2004 9:29 am     Reply with quote

I'll start with the simplest suggestion and hope that this is your probem. The PC is configured as a DTE (data terminal equipment) and the Modem is most likely configured as DCE (data carrier equipment). This (usually) requires a "straight through" cable, with the pins wired 1-1, 2-2, etc. If your PIC is communicating with the PC, then it too is most likely configured as DCE. For the PIC to communicate with the Modem, you need to swap the transmit and receive data lines, at a minimum.

In addition, modems usually require the use of some of the other RS232 control signals. Have you looked at these also? They include RI, DCD, DTR, DSR, CTS, and RTS as well as the Receive and Transmit Data. Your PC may be setting these correctly, allowing communication, but your PIC set may not be.

Just a thought. Idea
Joris H



Joined: 24 Sep 2003
Posts: 14

View user's profile Send private message

PostPosted: Mon Jan 26, 2004 8:56 pm     Reply with quote

Thanks for the Help.
I made a null modem cable with loop back handshaking with no good results.
Then I made a 3 wire null modem cable(RX,TX and ground) with this cable I can send instructions from the PIC to the modem but no instructions from the modem to the PIC.
Any ideas?

Joris H
Charlie U



Joined: 09 Sep 2003
Posts: 183
Location: Somewhere under water in the Great Lakes

View user's profile Send private message

PostPosted: Tue Jan 27, 2004 9:05 am     Reply with quote

Justy



Joined: 28 Jan 2004
Posts: 6
Location: Montréal

View user's profile Send private message

PostPosted: Wed Jan 28, 2004 1:55 pm     Reply with quote

if you are programing your Pic16F877, plug your debugger on com2 an your programer on com 1 ...When you open hyper terminal set you Com at Com1.

Than you can program those lines into whatever program you are using for your C language.

#include "16F877.h"
#use rs232 (baud=9600, xmit=pin_(pin out of the pic if it's a Pic16F877 put : pin_c6), rcv=pin_(pin in.....16F877 pin_c7))
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