View previous topic :: View next topic |
Author |
Message |
Joris H
Joined: 24 Sep 2003 Posts: 14
|
Communication problem RS232 |
Posted: Sun Jan 25, 2004 8:17 am |
|
|
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
|
RS232 configuration |
Posted: Sun Jan 25, 2004 9:29 am |
|
|
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. |
|
|
Joris H
Joined: 24 Sep 2003 Posts: 14
|
|
Posted: Mon Jan 26, 2004 8:56 pm |
|
|
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
|
|
Posted: Tue Jan 27, 2004 9:05 am |
|
|
|
|
|
Justy
Joined: 28 Jan 2004 Posts: 6 Location: Montr�al
|
|
Posted: Wed Jan 28, 2004 1:55 pm |
|
|
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)) |
|
|
|