Serial port connection and software

Discussion in 'General Electronics Chat' started by hunterage2000, Feb 8, 2013.

  1. hunterage2000

    Thread Starter Active Member

    May 2, 2010
    400
    0
    Hi,

    Does anyone know how I would go about connecting a PIC16F877A to my PC via a serial port? I am using PCW and CSS Compiler, there is a serial port monitor within PCW.
     
  2. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    Do you have any serial port or USB to RS232 converter on your PC. That will be the first step
     
  3. hunterage2000

    Thread Starter Active Member

    May 2, 2010
    400
    0
    No, no cable yet. I have attached a schematic.
     
  4. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
  5. Markd77

    Senior Member

    Sep 7, 2009
    2,803
    594
  6. hunterage2000

    Thread Starter Active Member

    May 2, 2010
    400
    0
    brilliant! So do I need a serial to usb cable or female to male serial cable because it looks like some Microcontroller pins are connected to a female ended serial.
     
  7. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    A USB to RS232 converter or a PC serial port will look like this. In the most simple form. You will only ned to use PIN 2,3, and 5. Remember to cross the signals. It is quite logic. The Transmit data signal out of one RS232 unit. Must evidently become a input signal then conected to another RS232 unit ;)

    [​IMG]
     
  8. JMac3108

    Active Member

    Aug 16, 2010
    349
    66
    Hmmm ... why are we talking about USB? Do you have a PC without a serial port?

    Your schematic shows a microcontroller with its logic level serial port connected to a RS-232 transciever to generate RS-232 levels, which are then connected to a standard 9-pin-D connector. All you need is a standard serial cable to connect the 9-pin connector on your board to the 9-pin serial connector on your PC. Make sure, as others said, to use a cable that crosses pins 2 and 3 (TX to RX and RX toTX). This is called a "null-modem cable".

    As far as software on the PC side, you can just use HyperTerm which comes with Windows. If you don't have HyperTerm you can use any terminal program that can be downloaded free such as RealTerm or TeraTerm.
     
  9. JMac3108

    Active Member

    Aug 16, 2010
    349
    66
    Actually, I took a closer look at your schematic and you need a "straight-through" cable, not a "null-modem" cable.

    On a serial connector pin2 is RX and pin3 is TX. Your board already has these connections reversed, you have pin2 TX and pin3 RX. This means when you connect your board to a PC with a straight-through cable the signals will be crossed as they need to be to communicate.
     
    Last edited: Feb 8, 2013
  10. hunterage2000

    Thread Starter Active Member

    May 2, 2010
    400
    0
    This isnt the circuit I am making, its just an example showing a serial end. All I have so far is a PIC16F877A and a k150 programmer. I just needed to know how the PIC would connect to a PC. My PC has a spare male serial port
     
Loading...