Menu

What does this mean?

Help
MBB
2019-06-17
2019-06-21
  • MBB

    MBB - 2019-06-17

    I'm using this Magnetometer IC:
    https://cdn.sparkfun.com/assets/2/2/4/d/6/MLX90393-Datasheet-Melexis_revision_003.pdf

    On Page 17, in the Read Register row they use this terminology {A5…A0,0,0}

    Does anyone know what {A5…A0,0,0} means?

     
  • Chris Roper

    Chris Roper - 2019-06-17

    It is telling you the bit range that is returned, its justification and the padding.

    So in this case if the register name is RR then it will return RR.5 then RR.4, RR.3, RR.2, RR.1, RR.0 then 0. 0

    So the resulting byte will be the equivalent of RR left shifted twice then ANDed with 0b11111100.

    I am not sure how to make that explanation clearer and it still looks awkward, so I hope it is not even more confusing.

     
  • MBB

    MBB - 2019-06-17

    Thanks Chris! That helps

     
  • MBB

    MBB - 2019-06-21

    I have a follow up question. The above response says:
    "So the resulting byte will be the equivalent of RR left shifted twice then ANDed with 0b11111100."

    I don't understand why the "then ANDed with 0b11111100." is needed.

    For example: If RR = 43 = b101011, then left shifting twice and adding 0, 0 at the end gives b10101100 =172. ANDing this with b11111100 gives:
    b10101100 =172
    b11111100 = 252
    ---------------
    b10101100 = 172 the same number I started with before ANDing.

    Did I do this correctly?  Is the ANDing necessary?
    
     
    • Chris Roper

      Chris Roper - 2019-06-21

      Is the ANDing necessary?

      I think you misunderstood my reply.

      I was not saying that "You" have to do the shift followed by AND, I was pointing out that that is what "They" have done to give you the result.

      will be the equivalent of RR left shifted twice then ANDed with 0b11111100

       
  • MBB

    MBB - 2019-06-21

    Thanks Chris! I did misunderstand.

     

Log in to post a comment.