-
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
-
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?)
-
Re: Modifier error?
Thanks. Seems to be something I did not understand so well...