Today 12:13
Forum: The Lounge
Starter: Tim
Views: 0
Replies: 2
+ Reply to Thread
Page 15 of 15 FirstFirst ... 5131415
Results 141 to 143 of 143

Thread: Invisible RS232 Serial Buffering code3993 days old

  1. #141
    Junior Member labges's Avatar
    Join Date
    Feb 2012
    Posts
    2
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    0

    0 Not allowed!

    Thumbs up Re: Invisible RS232 Serial Buffering code

    Thanks for this TIP Alan, I was having problems with lockups using this routine.
    By adding the "movf RCREG" as you suggested, my lockups seem to have totally vanished (touch wood)

    Your hint seems to have totally fixed my problem.
    Quote Originally Posted by Alan R. View Post
    I think what is a framing error or similar. I had this issue with a large test-bed that randomly cut power the the units under test. Sometimes this was while there were sending RS232 data and my pic would hang. See below for the solution....

    (From this topic, one year ago)
    There is a tiny bug in the BUFFERED_USART.inc file:

    Under the error handling section inside the interrupt, it traps on two errors but only handles one of them.

    movlw 6 ' Yes. So Mask out unwanted bits
    andwf RCSTA,W ' Check for errors
    bnz _UART_ERROR ' Was either error status bit set?

    bit 2 FERR: Framing Error bit
    1 = Framing error (can be updated by reading RCREG register and receiving next valid byte)
    0 = No framing error
    bit 1 OERR: Overrun Error bit
    1 = Overrun error (can be cleared by clearing bit CREN)
    0 = No overrun error

    Adding a ‘movf RCREG” inside the error handling section will clear the framing if necessary

    _UART_ERROR:
    movf RCREG ' Clear Framing error by reading RCREG
    Clear RCSTA.4 ' Clear receiver status
    Set RCSTA.4
    retfie Fast

    Alan R..

  2. #142
    Member hassawfaa's Avatar
    Join Date
    Mar 2008
    Posts
    208
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    1.29 GB

    0 Not allowed!

    Default Re: Invisible RS232 Serial Buffering code

    Where is the files for
    • Invisible RS232 Serial Buffering code




    Speech is Silver , Silence is Golden :eek: [url]www.hitronics.net[/url]

  3. #143
    Senior Member SimonJA's Avatar
    Join Date
    Mar 2006
    Posts
    768
    Thumbs Up
    Received: 20
    Given: 14
    Total Downloaded
    465.13 MB

    0 Not allowed!

    Default Re: Invisible RS232 Serial Buffering code

    C:\Users\**username**\PDS\Samples\New Samples\Buffered_Hrsin

    That's where mine is (Windows 10).

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. USB to serial RS232
    By Ken_K in forum The Lounge
    Replies: 10
    Last Post: 1st October 2011, 13:32
  2. Problem with serial code (groan)
    By Peter Truman in forum Proton Plus Compiler v3
    Replies: 18
    Last Post: 8th September 2011, 14:55
  3. Invisible RS232 Serial Buffering code By Les
    By PAKirk in forum The Lounge
    Replies: 9
    Last Post: 23rd June 2011, 20:44
  4. Invisible Buffered Hsrin
    By speeder in forum Proton Plus Compiler v3
    Replies: 5
    Last Post: 8th December 2008, 11:23

Members who have read this thread : 166

Actions :  (Set Date)

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

Tags for this Thread

Posting Permissions

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