SEROUT2 takes 1400ms to execute?


Closed Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2004
    Location
    Calabasas, CA
    Posts
    84

    Default SEROUT2 takes 1400ms to execute?

    SerOut2 PORTB.6,N2400,["A",w2]

    I've timed this on a tight loop and it takes almost 1500ms to execute! Whats taking so long? How can I speed this up to us? Is the "A" just for a handshake? I just copied it from the manual. No define or anything needed to use it?
    The compiler is set to XT and both PIC's have 3.58 oscillators and program defines osc 3.
    Last edited by droptail; - 15th March 2006 at 04:49.
    James

  2. #2
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    droptail, The statement will "WAIT" for an ascii "A" to be received before looking for the variable. I don't see any timeout so what it taking so long is the receiving of the ascii "A" which is coming from some external device.

    Dave Purola,
    N8NTA

  3. #3
    Join Date
    Nov 2004
    Location
    Calabasas, CA
    Posts
    84


    Did you find this post helpful? Yes | No

    Default clarification of qualifier & external device please

    master PIC: SerOut2 PORTB.6,N2400,["A",w2]
    slave PIC: SerIn2 PORTB.0,N2400,[wait ("A"),w2]

    Not sure if I understand completely. The delay has been determined @ SEROUT2 statement, no external devise is part of this, not waiting at the SERIN2 statement. I have included the modifier "wait" and qualifier "A" for timing purposes to transmit byte w2, a marker if you will. This qualifier "A" isn't anywhere else in the program, I assumed it is generated at the time of the Serout2 statement execution (instantly). Actually, I need to know if using the qualifier "A" in SEROUT is OK, I can't find any reference to it in the manual in SEROUT or SEROUT2, but I believe it is necessary to send if SERIN is expecting to see it? Why the long delay in transmittal? Need I establish the use of the qualifier elsewhere first?
    Last edited by droptail; - 15th March 2006 at 19:29.
    James

  4. #4
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    droptail, I spoke incorrectly. At first glance I thought you were receiving the string but after comming back to the message I noticed that you were sending the command. There is no reason for the pic to wait before sending the string "A",w2. I only ask is the variable w2 a word or a byte? Next time I will read the post twice before replying. Sorry.

    Dave Purola,
    N8NTA

  5. #5
    Join Date
    Nov 2004
    Location
    Calabasas, CA
    Posts
    84


    Did you find this post helpful? Yes | No

    Default

    W2 can be a word. After some comparison I found that SEROUT2 takes 735ms to execute while SEROUT takes some us long. Aren't using the flowpin option so don't need SEROUT2. Am satisfied with the results. Still wanted to understand the source and role of the qualifier "A".
    James

Similar Threads

  1. Serout and 18F87J50
    By Glenn_Webber in forum Serial
    Replies: 8
    Last Post: - 20th November 2009, 14:26
  2. Serout to serial servo
    By azmax100 in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 12th August 2009, 16:46
  3. SLOW Serin2 and Serout2
    By dragons_fire in forum General
    Replies: 3
    Last Post: - 26th June 2009, 02:38
  4. Gps with 16f628
    By dragons_fire in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 8th June 2006, 03:38
  5. TMR1 interrupt question
    By ronjodu in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 15th February 2006, 03:02

Members who have read this thread : 1

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