Problems with Asyncronous Communications


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1
    Join Date
    Aug 2005
    Posts
    57


    Did you find this post helpful? Yes | No

    Default

    First check your cable/connector connections to be sure tx goes to rx in both directions.Ususally pin 2 to 3 and 3 to 2.I would troubleshoot the pic code connected to a pc first,since you can monitor the output of the pic,plus send data to the pic.

  2. #2
    BertMan's Avatar
    BertMan Guest


    Did you find this post helpful? Yes | No

    Default

    RX and TX are fine and I am connected to a pc for debugging. I am still having this issue if anyone can help.

  3. #3
    BertMan's Avatar
    BertMan Guest


    Did you find this post helpful? Yes | No

    Default

    Here maybe a pic will help. In this situation, would data between 182520 and max232 be inverted or true? I do not have access to the code on the 16f84 on the Micro 50, but I would assume it would be true because it was intended to communicate with a pc and it has a max232 in between. So then it would be safe to assume that data is inverted on the other side of the max232. So then if I am trying to connect a 18f2520 to the side that the pc would normally be on, then data would be inverted... correct?
    Attached Images Attached Images  

  4. #4
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    TTL <-> RS-232 level shifters invert in both directions. It is normally assumed that you will use such a device, so the setup when you use one is call 'TRUE' in PBP lingo.

    Inverted mode is necessary when no level shifter/translator is used, like when you connect a PIC directly to the serial port of a PC (but please put a resistor in series with the TxD line of the PC!)

    When running in TRUE mode, the output/input of the PIC will be high when in the idle mode, and pulse low when sending/receiving bits. Of course, it will be of opposite polarity on the "far side" of a MAX232.

    I see in your example code that your are writing '16416'. This number would indicate that bit 14 is set - meaning that you are sending INVERTED. To send/receive in TRUE mode at 19.2Kbaud, this number should be 32.

    If you are "talking" this fast, your PIC should be running faster than 4Mhz.

    Also, are you certain that you have your TRIS register set for output on the transmit line, and input on the receive line?
    Charles Linquist

  5. #5
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    With the 18F connected to the RS232 output of the MAX232 from the MICRO 50 board, you should insert a series limiting resistor (like shown in your PBP manual) for a direct RS232 serial connection, and use serin, serin2, debugin etc with inverted mode.

    Some of the "A" version 14-bit core, and the majority of the 18F series will flat out refuse to work with direct RS232 level voltage applied to an input pin.

    The best option is to just toss in another MAX232 converter. It can/will save you a ton of time & trouble. Some of the 14-bit "A" versions refuse to work even with the old series limiting resistor trick.

    You can use the 18F's hardware USART with HSERIN/HSEROUT if you use another MAX232 IC (or equivalent inverter circuit) on the 18F side.

    18F true mode: Can use any serial command or hardware USART
    18F tx > ttl in >|max|> rs232 out >--> rs232 in >|max|> ttl out >--micro 50
    18F rx < ttl out <|max|< rs232 in <--< rs232 out <|max|< ttl in <--micro 50

    18F inverted mode: serin/serout, serin2/serout2
    18F tx > -----------> rs232 in >|max|> ttl out >--micro 50
    18F rx < --/\/\/\----< rs232 out <|max|< ttl in <--micro 50

    Check the MICRO 50 board docs also to see if it requires handshaking. If you're not seeing anything output by the MICRO 50 board, it may be waiting for a control byte or handshaking signal before transmitting.

    And as Charles already mentioned, be sure to use an oscillator that supports the data rate.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  6. #6
    BertMan's Avatar
    BertMan Guest


    Did you find this post helpful? Yes | No

    Default

    Thanks!! I am starting to see data now coming from the M50 now that I added a pull down resistor to the output. Still not getting valid data though. I will take your advice and use another max232. I will let you know how it goes. Thanks for the help.

  7. #7
    BertMan's Avatar
    BertMan Guest


    Did you find this post helpful? Yes | No

    Default

    Sorry, one more thing. I am using the internal 8mhz clock for testing purposes. Is this fast enough to keep up with the 19200 baud?

Similar Threads

  1. Communications headset tester
    By skimask in forum Off Topic
    Replies: 20
    Last Post: - 13th December 2006, 15:40
  2. PIC Basic Pro <-> HP-IL communications
    By swr999 in forum Serial
    Replies: 0
    Last Post: - 6th March 2006, 19:30
  3. PIC Basic Pro <-> HP-IL communications
    By swr999 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 6th March 2006, 19:22
  4. Problems with 16F876 on interrupts an WRITE / READ
    By BigWumpus in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 20th December 2005, 15:38
  5. USART problems
    By egberttheone in forum mel PIC BASIC Pro
    Replies: 47
    Last Post: - 6th March 2005, 22:45

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts