Serial Com Pic to Pic


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Feb 2003
    Location
    Delaware
    Posts
    30


    Did you find this post helpful? Yes | No

    Default

    Well now. You need two serial ports on a pic that only has one hardware uart. I recently overcame this same problem by using a triple dual channel analog mux/demux (CD4053) between the pic and the max202E. The 202 already has two channels and the 4053 has 3 pairs of switches. I use them for Tx, Rx, and two LEDs. I use a pin on the pic as an output called com. select (CMSL) to toggle which serial port the UART is connected to. I will attach a schematic if the chip with pin discriptors. This works well if you always listen to one port and then after you get data you switch to another. Some ideas if this isn't possible would be to have a pic send data until it gets an ack from the master. Then the master could poll the different pics.

    Gotta go.

    Hope this helps.

    Joe Kupcha
    Attached Images Attached Images

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Use the SERIN2 timeout option. But i feel sure it can't provide that 1 minute delay. So have a Xsecond Timeout delay, once you jump to the Timeout label increment a counter, once the counter reach the right delay... Get out of you SERIN stuff.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    Apr 2005
    Posts
    32


    Did you find this post helpful? Yes | No

    Default

    thanx your kind response..

    serin serialinputpin, 396,2000,LineX,RX[0]

    works with timeout delay . how can ı use serin2 with timeout delay ?

    serin2 serialinputpin, 396,2000,LineX,RX[0] didn't work with timeout.

  4. #4
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    If either...

    1. There is noise on the line (in typical wireless applications)

    or

    2. The comms line idles in the wrong polarity

    You will not timeout from SERIN.

    If you did a SEARCH on SERIN and TIMEOUT you will discover a dozen threads on this issue.

  5. #5
    Join Date
    Apr 2005
    Posts
    32


    Did you find this post helpful? Yes | No

    Thumbs up

    i solve my problem. thx a lot....

    here is the solution

    ......


    serout2 serialOutput, 396, ["Report ",hex SlaveSelect]
    pause 200

    serin2 serialInput, 396,2000,loop,[wait("+"),RX[0]]

    If RX[0] != "+" Then ReadPic

    loop:
    .......
    ....


    ReadPic:
    Lcdout $fe, 1, "PIC Reading...."
    counter = 1

    while counter != 16 'receive 166 char.
    serin2 serialinput, 396,[ RX[counter]]
    counter = counter+1
    Wend

    Lcdout $fe, 1,str RX \16 ' recevied data
    pause 1000
    RX[0]=0
    hserout["+",Str RX \15,"+"] ' transmit received data to the other port
    hserout [13,10]
    pause 100
    goto StartPoint
    Return

Similar Threads

  1. 2 PIC, serial communication
    By lightgreen in forum Serial
    Replies: 6
    Last Post: - 21st November 2009, 16:20
  2. PIC to PIC "wired" serial one-way communication - SERIN2/SEROUT2
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 14th April 2008, 21:02
  3. Automatic VB6 to pic serial connection
    By arniepj in forum Code Examples
    Replies: 13
    Last Post: - 10th January 2008, 08:57
  4. Serial Pic to Pic using HSER
    By Chadhammer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 12th March 2005, 00:14
  5. Serial communication PIC to PIC help.
    By Rubicon in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 24th January 2005, 16: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