[SOLVED !] Les serial buffer transparent - Discussing the methods of parsing


Closed Thread
Results 1 to 6 of 6
  1. #1
    wirecut
    Guest wirecut's Avatar

    0 Not allowed!

    Default Les serial buffer transparent - Discussing the methods of parsing

    I've been using for the first time the serial buffer made available by Les (thanks again LES) on a 18F4550 and the demo "Buffered_Hrsin.zip" taken from the tread "Invisible RS232 Serial Buffering code" works well.
    Now I have to extract from incoming data, what I need, but I do not have very clear ideas about the method to use.
    I would like to have several examples of "parsing", perhaps optimized for the LES program in order to understand the different techniques used and identify the best for my use.

    Ciaio

    Leo

Attention

This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

The advertisements we display are relevant to this web site and your browsing history

Please consider supporting us by disabling your ad blocker.


Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

If you can, please report issues in the forum area WebSite / Forum Issues


Thank you for your attention.

  • #2
    wirecut
    Guest wirecut's Avatar

    0 Not allowed!

    Default

    Salve,

    ci sono di esempio che posso studiare?

    Ciao

    Leo

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #3
    pverburg
    Guest pverburg's Avatar

    0 Not allowed!

    Default

    There is no real difference apart from that you can check if the buffer is empty.

    So your code dont have to wait, and get on with what its doing until there are characters available.

    Paul V.

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #4
    wirecut
    Guest wirecut's Avatar

    0 Not allowed!

    Default

    I agree that there should be a real difference, but as with 18F microcontroller family can use string functions, there might be some new method more efficient.

    If you receive a fixed sequence of four characters, with the first two are the trailer and the other two the payload, there is an efficient way to recognize and extract the payload directly.

    example

    "#] 01" where "#" and "]" are the trailer and "01" the payload

    Regards

    Leo

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #5
    pverburg
    Guest pverburg's Avatar

    0 Not allowed!

    Default

    You can wait until there are more then four characters in the buffer before emptying but it could be the payload and the beginning of the next trailer.

    if you know there are always groups of four then you could wait until 7 or more as you would always find one set in the buffer.

    Still the main reason for the buffer program is that if you have parts of code that take a long time eprom writing etc. you don't have to worry that you lose characters.

    Paul V.

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #6
    Fanatical Contributor Tim's Avatar
    Join Date
    Jan 2003
    Posts
    7,676
    Thumbs Up
    Received: 47
    Given: 95
    Total Downloaded
    1.32 GB

    0 Not allowed!

    Default

    Since the data is buffered in an array there is no reason you cannot read the array to tell what is in there before hand

    If you are constantly looking for headers and then want to load the next x bytes into an array then I would not use Les's code. Its a generic replacement for the HRSIN command with buffering.

    Far better you write your own and do all the parsing in the interrupt routine and just flag the main code when the data is in.

    I have posted just such code many times on this forum
    Tim

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

    Thread Information

    Users Browsing this Thread

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

       

    Similar Threads

    1. Les & Tim modified version of serial buffer. Error ...(__HRSIN1__)
      By wirecut in forum Proton Plus Compiler v3
      Replies: 8
      Last Post: 3rd May 2019, 20:18
    2. Serial Buffer
      By Peter Truman in forum Proton Plus Compiler v3
      Replies: 3
      Last Post: 3rd December 2010, 19:43
    3. [SOLVED !] Serial output buffer
      By ~ Sy ~ in forum The Lounge
      Replies: 1
      Last Post: 21st August 2009, 10:26
    4. query regarding Les' Interrupt-driven serial buffer
      By richardy in forum Proton Plus Compiler v3
      Replies: 8
      Last Post: 1st April 2009, 18:17
    5. 16F serial buffer
      By all77 in forum Proton Plus Compiler v3
      Replies: 8
      Last Post: 25th April 2008, 13:25

    Members who have read this thread since 21st November 2019, 13:44 : 0

    Actions :  (Set Date)  (Clear 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