All About Circuits Forum  

Go Back   All About Circuits Forum > Software, Microcomputing, and Communications Forums > Embedded Systems and Microcontrollers

Notices

Embedded Systems and Microcontrollers Discussion forum for projects and working with embedded systems and microcontrollers (FPGAs, PICs, AVRs). Get help with hardware issues and embedded programming.

Reply   Post New Thread
 
Thread Tools Display Modes
  #41  
Old 05-03-2012, 09:40 PM
Eric007's Avatar
Eric007 Eric007 is offline
Senior Member
 
Join Date: Aug 2011
Location: Paris, France!
Posts: 974
Default

Quote:
Originally Posted by MrChips View Post
Oops, my mistake. I forgot you are using a USB to UART bridge.
The PC will assign a COMx port to the USB when the cable is connected.
Usually it is consistent but it can be any number on a different PC. So you have to allow the user to select the COMx port.

ok! so like I was saying earlier...at program startup, PC automatically detects the COM port available in the computer and allow the user to select the port to which the cable has been connected to, correct?

But as for the baude rate, I must stick with one ONLY to avoid complexity, right?

a little question, the fact thaT ONLY one cable will be connected the program will display only one portname, right?
Reply With Quote
  #42  
Old 05-03-2012, 10:04 PM
MrChips's Avatar
MrChips MrChips is offline
Super Moderator
 
Join Date: Oct 2009
Posts: 8,355
Blog Entries: 23
Default

I don't think so. Your program has to ask the OS what ports are connected and the OS will respond with any number of ports. Otherwise your program has to try to open a specific port but you have no way of knowing which COM port is the serial port.

The way I determine it is I look at the COM ports via the Device Manager. When you plug in the USB cable you will see a new COM port appear in the hardware list.
__________________
Most computer problems can be attributed to a simple problem - a loosewire behind the keyboard.

Reply With Quote
The Following User Says Thank You to MrChips For This Useful Post:
Eric007 (05-03-2012)
  #43  
Old 05-03-2012, 10:45 PM
Eric007's Avatar
Eric007 Eric007 is offline
Senior Member
 
Join Date: Aug 2011
Location: Paris, France!
Posts: 974
Default PC and microcontroller

we been talking about direct communication between 2 PCs via cable earlier...and this was for the simulation

Now assuming you want to do the actual communication between the PC and microcontroller and that you already connected the USB to RS232 serial adapter on the PC.

So the null modem cable I am going to use to connect PC and microcontroller is as attached, right?
and there will be an RS232 adapter (female) on microcontroller side, right?
Thanks
Attached Images
File Type: png null modem cable1.png (249.1 KB, 2 views)
Reply With Quote
  #44  
Old 05-03-2012, 10:51 PM
Eric007's Avatar
Eric007 Eric007 is offline
Senior Member
 
Join Date: Aug 2011
Location: Paris, France!
Posts: 974
Default

And as for the 'USB to RS232 adapter' for both PCs I can use either of the one attached, right?
Attached Images
File Type: png usbto RS232_picture1.png (189.5 KB, 2 views)
File Type: png usbtoRS232_picture2.png (205.4 KB, 1 views)
Reply With Quote
  #45  
Old 05-04-2012, 03:39 AM
MrChips's Avatar
MrChips MrChips is offline
Super Moderator
 
Join Date: Oct 2009
Posts: 8,355
Blog Entries: 23
Default

For connecting the PC to the micro you only use the USB to RS-232 cable. You do not use the null modem. I assume you or someone is designing the microcontroller board. Hence you would connect the TXD and RXD pins from the MCU to a MAX232 (or similar) transceiver chip and you would wire the MAX232 RS-232 connections to match the RS-232 to USB cable.

(If you wanted you could configure the MCU to be Data Terminal Equipment (DTE), the same as a PC, in which case you would need a NULL MODEM cable. But what is the point?)
__________________
Most computer problems can be attributed to a simple problem - a loosewire behind the keyboard.

Reply With Quote
  #46  
Old 05-04-2012, 11:54 PM
Eric007's Avatar
Eric007 Eric007 is offline
Senior Member
 
Join Date: Aug 2011
Location: Paris, France!
Posts: 974
Default connection

the connection for PC to PC will be as attached (between male and female), right?

Now what kind of connectors to use to do this kind of connection??
Attached Images
File Type: png da_connection.png (145.6 KB, 6 views)
Reply With Quote
  #47  
Old 05-05-2012, 08:39 AM
Eric007's Avatar
Eric007 Eric007 is offline
Senior Member
 
Join Date: Aug 2011
Location: Paris, France!
Posts: 974
Default

Quote:
Originally Posted by t06afre View Post
If you do not use handshake. And also turn it off then using a terminal program like hyperterm. Or in your program. It will work using only pin 5, 3, and 2. Pin 2 and 3 must be crossed in the cable.
Hope this will help you
I will have to cross pin2 and pin3 as you said. Pin5 connected to pin5.
These connection will be done one at a time.

My concern is: what type of connectors must I use? Wires I use when breadboarding or there are some special connectors?

Remember connection will be done between a pin and a hole (RS232 pin with null modem cable hole or socket) like I showed in that image in above picture.

Thanks!
Reply With Quote
  #48  
Old 05-05-2012, 08:53 AM
Eric007's Avatar
Eric007 Eric007 is offline
Senior Member
 
Join Date: Aug 2011
Location: Paris, France!
Posts: 974
Default

Somebody address my posting #46 and #47 please...

Thanks!
Reply With Quote
  #49  
Old 05-05-2012, 09:04 AM
bertus's Avatar
bertus bertus is offline
Super Moderator
 
Join Date: Apr 2008
Location: Amsterdam,Holland (GMT + 1)
Posts: 11,605
Default

Hello,

Have a look at this page from "the hardwarebook":
http://www.hardwarebook.info/Nullmodem_%289-9%29

Bertus
__________________
You don't have to know everything, if you know where to find it.
When you do ask questions, you may look stupid.
When you do NOT ask questions, you will STAY stupid.

It would be nice to have the Timezone ( GMT +/- x ) in the location field in the profile.
(User CP -> Edit Your Details)
Reply With Quote
  #50  
Old 05-05-2012, 09:45 AM
t06afre's Avatar
t06afre t06afre is offline
Senior Member
 
Join Date: May 2009
Posts: 5,835
Default

Also remember in a proper null-modem cable the crossing will be done inside the cable. For your project you will have to use 9 PIN D-SUB FEMALE connector to connect to the USB to serial connector. In the other end you can use the connector you think will be best. What is important is that the transmit signal/pin in one end. Is connected to the receive signal/pin in the other end. The signal leaving as outgoing in one end. Must necessarily become an input signal in the other end. Nothing good will come out of connecting to transmitters to each other.
Reply With Quote
The Following User Says Thank You to t06afre For This Useful Post:
Eric007 (05-05-2012)
Reply   Post New Thread

Tags
, , ,


Related Site Pages
Section Title
Worksheet Shift registers
Worksheet Flip-flop circuits
Worksheet Digital communication
Worksheet Timer circuits
Worksheet Latch circuits
Worksheet Multiplexers and demultiplexers
Worksheet Signal modulation
Worksheet Characteristic Impedance
Video Lecture Wire and Cable - Basic Components and Technical Notation
Textbook Network protocols : Digital Communication


Similar Threads
Thread Thread Starter Forum Replies Last Post
how can i send the digital digits and voice between transmitter and receiver neha sharma Radio and Communications 14 10-04-2011 05:11 AM
my first project please need your help abdelrahman Homework Help 3 07-05-2011 10:30 PM
AT89C51ac3 serial data packet problem swinch Embedded Systems and Microcontrollers 2 01-26-2010 12:29 AM

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:20 AM.


User-posted content, unless source quoted, is licensed under a Creative Commons Public Domain License.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.