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

serial coms hardware

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



Joined: 28 Aug 2007
Posts: 99
Location: New Zealand

View user's profile Send private message

serial coms hardware
PostPosted: Sat Sep 08, 2007 6:33 pm     Reply with quote

is this a good way to connect a pic to the serial port of a pc or is there a better way?

http://www.best-microcontroller-projects.com/image-files/rs232_pic_connections_schematic.png
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Sat Sep 08, 2007 6:56 pm     Reply with quote

Quote:

is this a good way to connect a pic to the serial port of a pc or is there a better way?

It is not. Correct the wiring according to this:
Code:


  MAX232        PC Connector

   T1OUT  ----> PIN3  Tx
   R1IN   ----> PIN2  Rx


Humberto
umka



Joined: 28 Aug 2007
Posts: 99
Location: New Zealand

View user's profile Send private message

PostPosted: Sat Sep 08, 2007 7:47 pm     Reply with quote

are you sure as i ahve looked at a few different schematics and they all have it com pin 2(rxd) to max pin 14 and com pin 3(txd) to max pin 13
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Sat Sep 08, 2007 9:08 pm     Reply with quote

Usually signals names are labeled from the standpoint of the DTE device. In this case
the PC is a DTE device. RS232 comunications are single point only. Any project using
RS232 that comunicate with a PC becomes in a generic DCE device, hence the
output is wired to a DB9 female connector as its own connector.
In the real world, nobody connect a wire directly from an RS232 transceiver
pins to a comm port connector of a PC, as shown in your drawing. Usually the are
standard cables that make that link.
Regarding the linked schematic, the DB9 connector should shown the RS232 project
connector, not the PC connector which is in the outside world.
To shown it properly, the DB9 female connector of your project should have PIN2
named Tx and PIN3 Rx.
I realize that this is confusing.


Humberto
umka



Joined: 28 Aug 2007
Posts: 99
Location: New Zealand

View user's profile Send private message

PostPosted: Sat Sep 08, 2007 11:35 pm     Reply with quote

do you have a schematic of how it sohuld be? in the linked schematic if i change the T1out from MAX232 to connect to pin3 and R1in from MAX232 to connect to pin2 on a female serial plug it will work? is there a differant way to do it or is this the best way?

Quote:
In the real world, nobody connect a wire directly from an RS232 transceiver
pins to a comm port connector of a PC, as shown in your drawing. Usually the are standard cables that make that link.


when you say that do you mean one normally uses an extension cable and are not actually puting the wires into the plug at the back of the computer?
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Sun Sep 09, 2007 7:52 am     Reply with quote

Quote:

do you have a schematic of how it sohuld be? in the linked schematic if i change the T1out
from MAX232 to connect to pin3 and R1in from MAX232 to connect to pin2 on a female serial
plug it will work

The electrical schematic you posted is right, BUT the plug should be female with
different names:
Code:

   T1OUT   to   PIN2 but rename the pin to Tx
   R1IN    to   PIN3 but rename the pin to Rx


Quote:

is there a differant way to do it or is this the best way?

It is not the best way, is the right way.


Quote:

when you say that do you mean one normally uses an extension cable and are not
actually puting the wires into the plug at the back of the computer?

Yes, you are right. Once you connect the female plug in your project, you will need to
made an external cable with a connector in each end wired according to this:
Code:

 DB9 Male             DB9 Female
 PIN2  (Tx)    to     PIN2  (Rx)
 PIN3  (Rx)    to     PIN3  (Tx)
 PIN5  Gnd     to     PIN5  (Gnd)


Finally, connecting the male to your project and the female to the PC comm plug
your whole RS232 cabling will be according to the standard, and running.!!


Best regards,

Humberto
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