data packet definition, data acquisition!

Discussion in 'Embedded Systems and Microcontrollers' started by Eric007, Apr 29, 2012.

  1. Eric007

    Eric007 Thread Starter Active Member

    Joined:
    Aug 5, 2011
    1,000
    33

    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?
     
    #41
  2. MrChips

    MrChips Moderator

    Joined:
    Oct 2, 2009
    11,752
    3,010
    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.
     
    #42
    Eric007 likes this.
  3. Eric007

    Eric007 Thread Starter Active Member

    Joined:
    Aug 5, 2011
    1,000
    33
    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
     
    #43
  4. Eric007

    Eric007 Thread Starter Active Member

    Joined:
    Aug 5, 2011
    1,000
    33
    And as for the 'USB to RS232 adapter' for both PCs I can use either of the one attached, right?
     
    #44
  5. MrChips

    MrChips Moderator

    Joined:
    Oct 2, 2009
    11,752
    3,010
    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?)
     
    #45
  6. Eric007

    Eric007 Thread Starter Active Member

    Joined:
    Aug 5, 2011
    1,000
    33
    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??
     
    #46
  7. Eric007

    Eric007 Thread Starter Active Member

    Joined:
    Aug 5, 2011
    1,000
    33
    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!
     
    #47
  8. Eric007

    Eric007 Thread Starter Active Member

    Joined:
    Aug 5, 2011
    1,000
    33
    Somebody address my posting #46 and #47 please...

    Thanks!
     
    #48
  9. bertus

    bertus Administrator

    Joined:
    Apr 5, 2008
    13,917
    1,752
    #49
  10. t06afre

    t06afre AAC Fanatic!

    Joined:
    May 11, 2009
    5,939
    1,222
    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.
     
    #50
    Eric007 likes this.
  11. Eric007

    Eric007 Thread Starter Active Member

    Joined:
    Aug 5, 2011
    1,000
    33
    You got me perfectly right!

    I'm trying to hook up with some connectors...

    Thanks!
     
    #51
  12. Eric007

    Eric007 Thread Starter Active Member

    Joined:
    Aug 5, 2011
    1,000
    33
    Big Thanks to T0fafre and Mrchips!!!

    All my connections worked perfectly and I was able to do a serial communication with 2 Pcs...

    When I have a chance I will discuss the same thing but this time between the microcontroller and a PC. This will be for my own learning...knowledge...no school thang....

    Thanks !
     
    #52
Loading...