Hserin / out Woes..


Closed Thread
Results 1 to 12 of 12

Hybrid View

  1. #1
    Join Date
    Jan 2013
    Location
    Texas USA
    Posts
    229

    Default Re: Hserin / out Woes..

    Andy,

    You can always just use a "HSERIN" bogus statement to throw away anything in the buffer before you execute your regular "HSERIN" statements.
    Since the EUSART has a 2 byte buffer you may need to do two of the bogus "HSERIN" statements with timeouts just to make sure you don't get stuck waiting.
    Regards,
    TABSoft

  2. #2
    Join Date
    May 2012
    Location
    Merseyside, UK
    Posts
    237

    Default Re: Hserin / out Woes..

    Hi

    Thanks for reply ...

    Will try tomorrow and post what happens ...

    Thank you for advice

    Andy

  3. #3
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,623

    Default Re: Hserin / out Woes..

    Hi,
    You can always just use a "HSERIN" bogus statement to throw away anything in the buffer before you execute your regular "HSERIN" statements.
    Just keep in mind that if there is no garbage data in the RX buffer then the bogus statement will throw away the real data when it comes so if you go down that route make sure you specify a very low timeout value for the initial bogus statement.

    Here's another way to flush the buffer:
    Code:
    RCIF VAR PIR1.3    ' Alias to the RX Interrupt flag for USART 1 on an 18F25k22
    Dummy VAR BYTE
    WHILE RCIF
       Dummy = RCREG1
    WEND
    /Henrik.

  4. #4
    Join Date
    May 2012
    Location
    Merseyside, UK
    Posts
    237

    Default Re: Hserin / out Woes..

    Quote Originally Posted by Tabsoft View Post
    Andy,

    You can always just use a "HSERIN" bogus statement to throw away anything in the buffer before you execute your regular "HSERIN" statements.
    Since the EUSART has a 2 byte buffer you may need to do two of the bogus "HSERIN" statements with timeouts just to make sure you don't get stuck waiting.
    Hi

    I just put your suggestion in place and it seems to be working for me .... I just used 50 as a time out figure... thank you!

    I will try the other suggestions also thank you as always Henrik

    For now I need sleep !!!!!

    Br
    Andy

Similar Threads

  1. SPI woes
    By Charles Linquis in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 27th September 2013, 15:04
  2. Capture woes...
    By ardhuru in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 22nd May 2011, 09:36
  3. LCDOut Woes
    By LetTheSmokeOut in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 11th June 2008, 02:45
  4. ICD Woes
    By spad13m in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 14th February 2008, 06:56
  5. Still HSEROUT woes
    By Charles Linquis in forum mel PIC BASIC Pro
    Replies: 34
    Last Post: - 11th July 2006, 22:13

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