Modifier error?


Closed Thread
Results 1 to 3 of 3

Thread: Modifier error?

Hybrid View

  1. #1
    Join Date
    Sep 2009
    Posts
    755

    Default Modifier error?

    When I try to access bits from the second byte in a array, strange things happen.

    Code:
    SEROUT2 tx,mode,[bin8 NDDate[0],13,bin8 NDDate[1],13,#NDDate.BIT7[1],#NDDate.BIT6[1],#NDDate.BIT5[1],#NDDate.BIT4[1]]
    As a result I get this
    0 0 1 1 0 0 1 0 (0D)
    0 0 0 1 0 1 0 1 (0D)
    1 0 0 1
    If i try to access to first byte
    Code:
    SEROUT2 tx,mode,[bin8 NDDate[0],13,bin8 NDDate[1],13,#NDDate.BIT7[0],#NDDate.BIT6[0],#NDDate.BIT5[0],#NDDate.BIT4[0]]
    Results:
    0 0 1 1 0 0 1 0 (0D)
    0 0 0 1 0 1 0 1 (0D)
    0 0 1 1
    It seems everything is OK. So what causing this error?
    I'm using pbp 2.60C, PIC18F452

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,604


    Did you find this post helpful? Yes | No

    Default Re: Modifier error?

    Hi,
    If NDDate is the byte array you access the 7th bit of the first byte (NDDate[0]) thru NDDate.0[7] and the 7th byte of the second byte thru NDDate.0[15].
    Please see Melanies excelent writeup on the subject for further details.

    (Where's Melaine by the way, haven't "seen" her around for ages?)

  3. #3
    Join Date
    Sep 2009
    Posts
    755


    Did you find this post helpful? Yes | No

    Default Re: Modifier error?

    Thanks. Seems to be something I did not understand so well...
    Last edited by pedja089; - 5th June 2011 at 15:54.

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