+ Post New Thread
Results 1 to 4 of 4
  1. #1
    Junior Member level 1
    Points: 108, Level: 1

    Join Date
    Mar 2018
    Posts
    15
    Helped
    0 / 0
    Points
    108
    Level
    1

    Hardware for RS232 with PIC

    Hi.. The hardware such as PIC16F877A, MAX232, USB to UART cable(i.e. one end compatible with usb port in PC, and other end is DB9 connector), 8MHz crystal oscillator, 33Pf (2 no.), 10uF(4 no.), are used in my UART project. I'm connecting these in bread board. I used pickit3 to program my IC.
    1). PIC16F877A
    - 13th and 14th are connected by oscillator and osc is grounded by two 33pF capacitors.
    - 11th pin is connected to supply(+5V), 12th pin is grounded.
    - RC6(TX) pin is connected to MAX232 10th pin(Tx), likewise RC7(RX) pin is connected to MAX232 9th pin(Rx).
    2).MAX232
    - 16th pin is connected to supply(+5V), and 15th pin is grounded.
    - 10uF is connected across 16th pin and 2nd pin.
    - 1st and 3rd pins are connected by 10uF similarly 4th and 5th pins, and 6th pin is grounded.
    - DB9 connector Rx(2nd pin) is connected to 7th pin, and Tx (3rd pin) is connected to 8th pin.
    - 5th pin of DB9 connector is grounded.
    This is my setup and i'm trying to send a single character with LED indication, the code is attached below. My IC is programmed well using pickit3. I also checked the code in Proteus, it generated A in virtual terminal.
    In real time i received nothing in terminal window, i've checked the baudrate, parity, stop bits, etc... also i downloaded several codes like this and dump the hex code and checked, but i didn't get any output. Software - MPLAB X IDE.
    Please give me a solution i'm doing this project for a long time. Whether my hardware setup is correct?

    •   Alt18th May 2018, 08:12

      advertising

        
       

  2. #2
    Super Moderator
    Points: 58,794, Level: 59
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    11,981
    Helped
    2776 / 2776
    Points
    58,794
    Level
    59

    Re: Hardware for RS232 with PIC

    Hi,

    A schematic is by far more informative than a textual description.

    Usually
    Rx <-- Tx and
    Tx --> Rx:
    Be sure your connection is correct. Please check that the output of one device goes to the input of the other device. (Read datasheets)

    Klaus
    Please dont contact me via PM, because there is no time to respond to them. Thank you.



    •   Alt18th May 2018, 09:39

      advertising

        
       

  3. #3
    Advanced Member level 4
    Points: 7,724, Level: 20
    Achievements:
    7 years registered
    paulfjujo's Avatar
    Join Date
    Jun 2008
    Location
    France 01120
    Posts
    1,276
    Helped
    260 / 260
    Points
    7,724
    Level
    20

    Re: Hardware for RS232 with PIC

    hello


    MAX232 ... and 6th pin is grounded.
    No, you must insert a capacitor capacitor - on pin 6 and capacitor + to ground
    more details [B]here [/B]

    some MAX232 requier less value of capacitoe , like 1F instead of 10F

    today, it is more easy to use a USB/TLL cable like Prolific or other ( with FTDI device integrated).



    •   Alt18th May 2018, 12:50

      advertising

        
       

  4. #4
    Super Moderator
    Points: 26,514, Level: 39
    andre_teprom's Avatar
    Join Date
    Nov 2006
    Location
    Brazil
    Posts
    7,965
    Helped
    995 / 995
    Points
    26,514
    Level
    39
    Blog Entries
    5

    Re: Hardware for RS232 with PIC

    The MAX232 is outdated, being recommended the MAX233 which has fixed some issues on its predecessor, particularly when interfacing with computers having no legacy serial ports, as in the case of USB/Serial adapters. Unfortunately, both devices are not pin compatible.
    --------------------------------------------------------------------------------------------------
    Part of the world that you live in, You are the part that you're giving ( Renaissance )



--[[ ]]--