How to receive multiple bytes using the hardware usart in the PIC18F2550


Closed Thread
Results 1 to 7 of 7

Hybrid View

  1. #1
    Join Date
    Jan 2006
    Location
    Toronto
    Posts
    109

    Default

    Has anyone at all had any experience with this? I still cannot successfully receive more then 1 byte without problems. ANy help at all would be greatly apreciated.

    Thanks

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959

    Default

    When using ON INTERRUPT the interrupts don't get handled until the currently executing PBP statement has finished.

    At 9600 baud it only takes 1.04ms per byte. With the USARTS 2 byte buffer, the longest that any statement can take is 2.08ms. Anything taking longer will cause the buffer to overflow. Then with [DEFINE HSER_CLROERR 1] the program never even knows it lost data.

    With PAUSE 50 in the MainLoop, you could easily loose 15-20 bytes at a time.

    If you were using ASM interrupts, that wouldn't be a problem.

    HTH,
    DT

Similar Threads

  1. rs232 with hardware USART
    By Smity42 in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 28th April 2011, 04:51
  2. How to receive stream of bytes using PIC USART
    By unifoxz in forum mel PIC BASIC Pro
    Replies: 34
    Last Post: - 20th June 2009, 11:38
  3. Benefits of hardware usart over software?
    By sccoupe in forum Serial
    Replies: 2
    Last Post: - 19th March 2009, 02:16
  4. Serin/Out for multiple bytes
    By mankan in forum General
    Replies: 1
    Last Post: - 5th June 2006, 20:58
  5. receive ASCII with usart
    By harryweb in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 9th February 2004, 09:57

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