Serial communication between two 16F877As


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Jun 2007
    Posts
    24

    Default Rs-232

    Hi Cameron,
    I wasn't sure whether you were using the rs-232 still but these invert the signal as well as increasing the voltage to 12V. Could this be your problem?

    Mike

  2. #2
    Join Date
    Jun 2007
    Posts
    5

    Default

    Mike,

    Since I now have communication between two microprocessors, i have no need for RS232 communications anymore. However, when they were being used before, the logic levels were stepped up using a MAX232 IC included in the dev board i am using, so that was taken care of for me.

    The problem was that for some reason serout2 leaves the TX pin high at the end of whatever you are sending, at least when using driven true modes. I ended up just using driven inverted modes, and it seemed to alleviate the problem. However i do not know WHY it did so. Knowing WHY is like being taught how to fish. Knowing that it solved your problem is like being given a fish.

    Cameron

  3. #3

    Default RS-232 idle state

    RS-232 idles in steady MARK. The start bit is a SPACE bit. After the character has been sent the stop bit(s) are again MARK. MARK is defined as a negative voltage and SPACE is a positive voltage at the high level RS-232 interface.

    The MAX-232 chips are inverters. In order to get a steady MARK after the character, SEROUT2 is doing the right thing and leaving the TTL line out of the PIC as a high (5V) level.

    In order to get the correct state BEFORE sending a character with SEROUT, I find it pays to "condition" the line by setting the serout pin HIGH with a PAUSE longer than a character duration.

    HIGH SeroutPin
    PAUSE 10
    SEROUT pin, mode, [data,data,data, etc]

    HTH
    Brian

Similar Threads

  1. Wireless serial communication question
    By Ahmadabuomar in forum Serial
    Replies: 3
    Last Post: - 21st December 2009, 03:49
  2. Bootloader,MCSP and Serial communication
    By surfer0815 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 3rd March 2006, 10:52
  3. Serial Communication using 12F629
    By charudatt in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 14th March 2005, 04:24
  4. Serial communication PIC to PIC help.
    By Rubicon in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 24th January 2005, 15:45
  5. Replies: 8
    Last Post: - 11th November 2004, 20:08

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