Decoding serial data bytes and nibbles.


Closed Thread
Results 1 to 7 of 7

Hybrid View

  1. #1
    Join Date
    May 2013
    Location
    australia
    Posts
    2,653


    Did you find this post helpful? Yes | No

    Default Re: Decoding serial data bytes and nibbles.

    daves idea compiles to be 200 words shorter . I like that
    but I still can't get it going
    Last edited by richard; - 18th January 2018 at 01:11. Reason: still trying
    Warning I'm not a teacher

  2. #2
    Join Date
    May 2013
    Location
    australia
    Posts
    2,653


    Did you find this post helpful? Yes | No

    Default Re: Decoding serial data bytes and nibbles.

    to make I work
    the input array needs its bit order endianness reversed then the result needs the same treatment
    which defeats any gain


    Code:
        for d=0 to 14
        inbuff[d]= inbuff[d] rev 8
        next
    
    
    
     outpointer = 0
     while outpointer < 10
     inpointer = outpointer*12
     d=0
     while d<12
     dataword.0((outpointer * 16) + d) = inbuff.0(d + inpointer)
     d=d+1
     wend
     dataword[outpointer]=dataword[outpointer] rev 12
     outpointer= outpointer + 1
     wend
    Warning I'm not a teacher

  3. #3


    Did you find this post helpful? Yes | No

    Default Re: Decoding serial data bytes and nibbles.

    Thanks to all your help.

    I ended up using this bit but it's still boggling my mind a bit as to how it actually works.

    Code:
       for d=0 to 4
        dataword[d*2]=inbuff[d*3]*16+inbuff[d*3+1]>>4
        dataword[d*2+1]=inbuff[d*3+2]+(inbuff[d*3+1]&$f)*256
        next

Similar Threads

  1. I need to play with Nibbles, am i on the right track?
    By OldMarty in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 5th July 2016, 13:32
  2. Replies: 7
    Last Post: - 11th September 2010, 00:32
  3. incorrect requested number of data bytes recieved
    By doxdlite in forum mel PIC BASIC
    Replies: 0
    Last Post: - 17th April 2010, 22:47
  4. Word to nibbles
    By Gauge Guy in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 11th September 2005, 04:08
  5. Serial Data Recorder
    By d1camero in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 8th April 2005, 12:45

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