Skip incoming bytes in SERIN


Closed Thread
Results 1 to 17 of 17

Hybrid View

  1. #1
    Join Date
    Dec 2009
    Location
    Canada
    Posts
    68

    Default Skip incoming bytes in SERIN

    Hi Guys,

    Could someone advise please how can I skip some bytes when read a stream using SERIN? The chip I use does not support serin2 or hserin and it's program memory is too small, but I noticed that skipping bytes by using something like
    SERIN PORT,MODE,["CHAR"],BYTE,BYTE,BYTE,BYTE,BYTE,BYTE,BYTE,BYTE
    uses too much program memory for skipping bytes. Is there a better way?

    Thank you,
    Alexey

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Welcome to the forum.

    The chip I use does not support serin2 or hserin
    What chip are you using?
    It may not have a USART but I can not think why SERIN2 would not work on any chip.
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Dec 2009
    Location
    Canada
    Posts
    68


    Did you find this post helpful? Yes | No

    Default

    Hi Mackrackit,

    Thank you.

    It is PIC16HV540.

    it has only 512 words of program memory, 25 bytes or RAM (enough for only three variables) and nothing else. BUT it is 15 volt chip including full 8 bit 15 volt port B (actually I use only two lines of them)

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Alexey View Post
    It is PIC16HV540.

    it has only 512 words of program memory, 25 bytes or RAM (enough for only three variables) and nothing else. BUT it is 15 volt chip including full 8 bit 15 volt port B (actually I use only two lines of them)
    Oh....
    I will need to think about that one...
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    This is interesting. I have never used a chip this "small"....

    What does the data stream look like and what part do you want to skip? Then what do you want to do with it?
    Dave
    Always wear safety glasses while programming.

  6. #6
    Join Date
    Dec 2009
    Location
    Canada
    Posts
    68


    Did you find this post helpful? Yes | No

    Default

    it is a repeating string and the bytes I need are located 9 bytes after symbol 85. Ideally there are 7 bytes I want to know but I have room only for three variables, so I may have to read them one by one every next sycle or use only the first one as it is most important and I only need to ignite a warning LED at certain read value. Now I do it this way:
    SERIN PORTB.3,T2400,4000,CLR,[85],VAR,VAR,VAR,VAR,VAR,VAR,VAR,VAR,VAR,VAR

    Skipping 9 bytes cost me 45 words of memory which is near 9% of what I have totally

    Yes, this chip is very small, but I could not find another one with at least one 15 volt port (regular or open drain) to read and write serial data directly

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