Hi,
That is weird.... This code:Produces the following result on the serial terminal:Code:MR var word: H var byte MR = 0 HSEROUT ["First, all zeros:",13] HSEROUT ["MR = ", BIN16 MR,13,13] MR=65535 HSEROUT ["Then, all ones:",13] HSEROUT ["MR = ", BIN16 MR,13,13] for H=0 to 15 MR.0[H]=0 'reset bit H of MR next H HSEROUT ["Next, all zeros again:",13] HSEROUT ["MR = ",BIN16 MR,13,13] for H=0 to 15 MR.0[H]=1 'set bit H of MR next H HSEROUT ["And finally, all ones:",13] HSEROUT ["MR = ", BIN16 MR,13,13] Pause 10 ENDThe FOR-NEXT loop is copy-pasted from your post above. How do you know it's not setting the bit? Do you have serial line to which you can send the data as above? Is there any chanse something else in the program is resetting/changing MR before you have chanse to see it? What version of PBP? (I'm using 2.60)Code:First, all zeros: MR = 0000000000000000 Then, all ones: MR = 1111111111111111 Next, all zeros again: MR = 0000000000000000 And finally, all ones: MR = 1111111111111111
/Henrik.


Reply With Quote

Bookmarks