Mosaic Well-Known Member Dec 22, 2010 #1 Code: MOVF PORTB,W ; Read DQ ANDLW 1<<DQ ; Mask off the DQ bit Can anyone explain the andlw 1<<DQ line function please?
Code: MOVF PORTB,W ; Read DQ ANDLW 1<<DQ ; Mask off the DQ bit Can anyone explain the andlw 1<<DQ line function please?
P Pommie Well-Known Member Most Helpful Member Dec 22, 2010 #2 It means shift left and so, 1<<3 would be 1000 = 8 and 1<<7 = 10000000 = 128. Mike.
Mosaic Well-Known Member Dec 22, 2010 #3 ok thx. so DQ must be a fixed number, not updatable within the code.
blueroomelectronics Well-Known Member Dec 22, 2010 #4 Yep, it's done during assembly. If you want to shift a variable use the rotate instruction.
bryan1 Well-Known Member Dec 22, 2010 #5 Mosaic said: ok thx. so DQ must be a fixed number, not updatable within the code. Click to expand... Mosaic, Read the comments on the code ; Read DQ (bit) ; mask off the DQ bit so now do you think DQ is fixed ?????? I'll near bet this is Maxims one wire code Cheers Bryan
Mosaic said: ok thx. so DQ must be a fixed number, not updatable within the code. Click to expand... Mosaic, Read the comments on the code ; Read DQ (bit) ; mask off the DQ bit so now do you think DQ is fixed ?????? I'll near bet this is Maxims one wire code Cheers Bryan